update_U: Update latent utility vector

View source: R/RcppExports.R

update_UR Documentation

Update latent utility vector

Description

This function updates the latent utility vector, where (independent across deciders and choice occasions) the utility for each alternative is updated conditional on the other utilities.

Usage

update_U(U, y, sys, Sigmainv)

Arguments

U

The current utility vector of length J-1.

y

An integer from 1 to J, the index of the chosen alternative.

sys

A vector of length J-1, the systematic utility part.

Sigmainv

The inverted error term covariance matrix of dimension J-1 x J-1.

Details

The key ingredient to Gibbs sampling for probit models is considering the latent utilities as parameters themselves which can be updated (data augmentation). Independently for all deciders n=1,\dots,N and choice occasions t=1,...,T_n, the utility vectors (U_{nt})_{n,t} in the linear utility equation U_{nt} = X_{nt} \beta + \epsilon_{nt} follow a J-1-dimensional truncated normal distribution, where J is the number of alternatives, X_{nt} \beta the systematic (i.e. non-random) part of the utility and \epsilon_{nt} \sim N(0,\Sigma) the error term. The truncation points are determined by the choices y_{nt}. To draw from a truncated multivariate normal distribution, this function implemented the approach of Geweke (1998) to conditionally draw each component separately from a univariate truncated normal distribution. See Oelschläger (2020) for the concrete formulas.

Value

An updated utility vector of length J-1.

References

See Geweke (1998) Efficient Simulation from the Multivariate Normal and Student-t Distributions Subject to Linear Constraints and the Evaluation of Constraint Probabilities for Gibbs sampling from a truncated multivariate normal distribution. See Oelschläger and Bauer (2020) Bayes Estimation of Latent Class Mixed Multinomial Probit Models for its application to probit utilities.

Examples

U <- c(0,0,0)
y <- 3
sys <- c(0,0,0)
Sigmainv <- solve(diag(3))
update_U(U, y, sys, Sigmainv)

RprobitB documentation built on May 29, 2024, 7:59 a.m.