powered by
Update utility vector
update_U(U, y, sys, Sigma_inv)
An update for (a single) U.
U
[numeric(J - 1)] The current utility vector.
numeric(J - 1)
[integer(1)] The index of the chosen alternative, from 1 to J.
integer(1)
1
J
[numeric(J - 1)] The systematic utility.
[matrix(J - 1, J - 1)] The inverted error covariance matrix.
matrix(J - 1, J - 1)
U <- sys <- c(0, 0, 0) Sigma_inv <- diag(3) lapply(1:4, function(y) update_U(U, y, sys, Sigma_inv))
Run the code above in your browser using DataLab