Skip to contents

Update utility vector

Usage

update_U(U, y, sys, Sigma_inv)

Arguments

U

[numeric(J - 1)]
The current utility vector.

y

[integer(1)]
The index of the chosen alternative, from 1 to J.

sys

[numeric(J - 1)]
The systematic utility.

Sigma_inv

[matrix(J - 1, J - 1)]
The inverted error covariance matrix.

Value

An update for (a single) U.

Examples

U <- sys <- c(0, 0, 0)
Sigma_inv <- diag(3)
lapply(1:4, function(y) update_U(U, y, sys, Sigma_inv))
#> [[1]]
#>             [,1]
#> [1,]  0.04103214
#> [2,] -2.00688474
#> [3,] -0.27267550
#> 
#> [[2]]
#>            [,1]
#> [1,] -0.1171715
#> [2,]  0.1128788
#> [3,] -1.6196667
#> 
#> [[3]]
#>           [,1]
#> [1,] -1.489569
#> [2,] -1.009613
#> [3,]  1.692941
#> 
#> [[4]]
#>            [,1]
#> [1,] -0.4423781
#> [2,] -1.8218303
#> [3,] -0.5895430
#>