Learn R Programming

RprobitB (version 1.2.0)

update_U: Update utility vector

Description

Update utility vector

Usage

update_U(U, y, sys, Sigma_inv)

Value

An update for (a single) U.

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.

Examples

Run this code
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