class: center, middle, inverse, title-slide .title[ # Going beyond the Simple MNL model ] .subtitle[ ## Using latent Gold and R packages to build more advanced choice models ] .author[ ### Going beyond the Simple MNL model.Rmd ] .date[ ### 2025-01-28 ] --- # Multinomial logit choice models + Advantages + Simple utility function - linear in its parameters + Readily available software + CBCHB, LatentGold, SPSS, Stata, SAS + R: Bayesm , ChoiceModelR , Mlogit , Apollo, RSGHB … + Can be applied to almost any choice modeling context + Easy to implement in a simulator + Disadvantages + Only strict linear-in-its-parameters utility functions + Assumes proportional substitution - IIA --- # Going beyond the MNL choice model + Wouldn’t it be nice to be able to fit some of the more advanced models seen at Sawtooth without writing your own programs: + Model diminishing returns in a utility function? + Fit a nested logit model? + Fit a volume model + A MaxDiff model with a scalar to model the best choices differently than the worst choices. --- # Build more complex models using R + R Basics + Using RSGHB + Simple MNL model + Using Latent Gold to produce the RSGHB program + More advanced models + Diminishing returns on additional features in a simple MNL model + The nested logit model + The Joint/Discrete volumetric model --- # R Basics + R editors + R itself + Rstudio + Visual Studio Code + R packages + Tidyverse , + RSGHB, Bayesm , ChoiceModelR , mlogit + Requirements + Input data + Transform data --- # MNL model + Utility function + V in = b i0 + b 1 X in1 + b 2 X in2 + … b K X inK + V in = + where + n is the respondent; + i is the alternative; + k is the number of variables; and + b 0 is an intercept + V in = b in0 + b i1 X in1 + b i2 X in2 + … b iK X inK + A respondent’s utility function… --- # MNL model + MNL formula + Where i is the respondent; + k is the number of variables; and b 0 is an intercept --- # MNL model likelihood + Likelihood formula + + Where y in = 1 if respondent n chose alternative i ; 0 = otherwise + C n is the choice set respondent i sees + J is the number of alternatives in C n + Log Likelihood --- # What we are going to do + Go over some Model and R basics + Model + Utility functions + The MNL model + What is a MNL model likelihood function + R basics + Some experience in R programming desirable + Input and output of data sets + Creating new and coded variables for RSGHB + R functions + Output intermediate and final data/results --- # What we are going to do + RSGHB basics + Data input + Data coding + Likelihood function + Output results --- # Model and R Basics + R Basics + Read and write datasets + Creating new variables + Executing function + MNL basics + Utility functions + MNL model likelihood function + Aggregate + RUM - HB + Latent class – LG choice model --- # Using Latent Gold to produce a RSGHB program + Jay shows LG syntax approach + Demo RUM LG syntax using Flynn MaxDiff data --- # Diminishing Returns in a MNL Utility Function --- # The Nested Logit Model + Tom intro NL + Jay demos syntax for NL + Demo RSGHB run using NL --- # The Joint/Discrete volumetric model