Learn R Programming

echoice2 (version 0.2.4)

vd_LL_vdmss: Log-Likelihood for volumetric demand model with set-size variation

Description

Log-Likelihood for volumetric demand model with set-size variation

Usage

vd_LL_vdmss(draw, vd, fromdraw = 1)

Value

N x Draws Matrix of log-Likelihood values

Arguments

draw

A list, 'echoice2' draws object

vd

A tibble, tidy choice data (before dummy-coding)

fromdraw

An integer, from which draw onwards to compute LL (i.e., excl. burnin)

Examples

Run this code
data(icecream)
#fit model
#note: this is just for demo purposes
#on this demo dataset, the model is not identified
#due to a lack of set size variation
icecream_est <- icecream %>% vd_est_vdm_ss(R=10, keep=1, cores=2)
#compute likelihood for each subject in each draw
loglls<-vd_LL_vdmss(icecream_est, icecream, fromdraw = 2)
#300 respondents, 10 draws
dim(loglls)

Run the code above in your browser using DataLab