Page 1 of 1

Mixed Multinomial Logit with heterogeneity in means and variances

Posted: 06 Jun 2020, 13:32
by LPowell
I am rather new to choice modeling and Apollo. Trying to run a mixed multinomial logit model with heterogeneity in means and variances on a large sample of vehicle crash data. I can estimate the model with NLogit, but it runs very slowly (I gave up after it ran for 48 hours on a fast AWS cluster). Apollo's multi-threading capability could make this task more practical, given that we need to compare results from dozens of specifications. However, I cannot find reference to mean/variance heterogeneity in the random parameters model in the Apollo documentation.

Is it possible to run such a model in Apollo? If so, can someone please boost me up the learning curve?

For those familiar with NLogit, the following code is a reduced form of what we want to achieve in Apollo:

RPLOGIT;
LHS=DAMAGE;
CHOICES = C1, C2, C3;
MODEL:
U(C1)= C1*ONE + C1*X1 + C1*X2 /
U(C2) = C2*X3 + C2*X4 + C2*X5 +C2*X6 /
U(C3)= C3*ONE + C3*X7 + C3*X8 + C3*X9 + C3*X10 + C3*X11 ;
PTS=1000; HALTON;
RPL = X2, X5;
HFR = X2, X5, X6;
FCN = X12(N|#11!111), X13(N|#11!010), X14(N|#11!010) $

The LHS "choices" (C1, C2, C3) are levels of damage to vehicles and the independent variables (X1-X14) are mostly 0/1 dummies describing the crash and contributing factors (e.g. head on collision, driver age, type of vehicle, speeding). Hence, the independent variables are not choice-specific.

A paper that estimates a similar model is Seraneeprakarn, P., Huang, S., Shankar, V., Mannering, F., Venkataraman, N., Milton, J., 2017. Occupant injury severities in hybrid-vehicle involved crashes: A random parameters approach with heterogeneity in means and variances. Analytic Methods in Accident Research 15, 41-55. Available from
https://www.dropbox.com/s/am3v78i8q4tpy ... e.pdf?dl=0

Thank you.

Re: Mixed Multinomial Logit with heterogeneity in means and variances

Posted: 06 Jun 2020, 16:43
by stephanehess
Hi

yes, this is very straightforward to do.

Let's use a simple example where you have that beta_cost follows a negative lognormal distribution, where we then estimate the parameters (mean and sd) of the Normal distribution of log(-beta_cost). Let's call these mu and sig and assume that mu is different for men and women, while sig is interacted continuously with income.

We could specify this as follows. Where I put ... is to add other things for your model. Here, I assume that you have variables in your data called male, female and income, and that the cost for the first alternative is cost_1:

Code: Select all

apollo_beta = c(mu_male    = 0,
                        mu_female = 0,
                        sig              = 0.1,
                        lambda_inc_sig = 0,
                        ...)

apollo_draws = list(
...
  interNormDraws = c("draws_beta_cost"...),
...
)

apollo_randCoeff = function(apollo_beta, apollo_inputs){
  randcoeff = list()

  randcoeff[["beta_cost"]] = -exp( mu_male * male + mu_female * female + sig * income ^ lambda_inc_sig * draws_beta_cost)
...

  return(randcoeff)
}

apollo_probabilities=function(apollo_beta, apollo_inputs, functionality="estimate"){

...
  V[['alt1']] = b_cost * cost_1 
...

Re: Mixed Multinomial Logit with heterogeneity in means and variances

Posted: 06 Jun 2020, 19:11
by LPowell
This is very helpful. Thank you for the fast reply.