Page 1 of 1

Fully correlated MXL model

Posted: 03 Jun 2021, 06:43
by nicok
Hi!

First of all, thanks a lot for having developed such as great package! It is very useful and likely a game changer - so congratulations!

I would like to know whether this is possible to simplify the coding/specification of the random terms in apollo_randCoeff().
I've tried different things and it seems that the different random coefficients need to be manually specified (eg mu_x1 + sd_x1 * draw_x1).
This is fine when the model has a limited number of parameters but it can quickly become tedious and error prone when model has many more random parameters. I initially tried to use a loop (see below), as this can be done for the specification of the indirect utility functions, but it does not seem to work.

I am especially interested in estimating a fully correlated MXL model. I've initially used the bayesian approach to "estimate" such model but there is something odd with the results (ie, the improvement in the loglik is way too large to be true) and when i use the bayesian approach to estimate an uncorrelated (diagonal) MXL model, the results don't match what i obtain with the "gmnl" (mlogit) package.

Many thanks for your help/thoughts!

randcoeff = list()
randcoeff = lapply(lX, function(x) eval(paste(text=paste0('mu_',x,'+sd_',x,'*draws_',x))))
names(randcoeff) = paste0('b_',lX)
return(randcoeff)
The error is about "e" needing to be a function/symbol/call/value

Re: Fully correlated MXL model

Posted: 03 Jun 2021, 17:57
by stephanehess
Hi

we are working on developing an interface, but it will take some time. Please see http://apollochoicemodelling.com/forum/ ... t=286#p958

Thanks

Re: Fully correlated MXL model

Posted: 10 Jun 2021, 07:58
by cybey

Code: Select all

I've initially used the bayesian approach to "estimate" such model but there is something odd with the results (ie, the improvement in the loglik is way too large to be true) and when i use the bayesian approach to estimate an uncorrelated (diagonal) MXL model, the results don't match what i obtain with the "gmnl" (mlogit) package.
The LL reported in RSGHB is the LL at the posterior means, so using the lower level model. If you want to compare results with classical estimation, you should look at the upper level model. May this explain the differences in your results?

Regarding the differences between Apollo/RSGHB with Bayesian estimation and mlogit: Are you sure that your chains have converged, e.g. by using a sufficiently high number of draws? Differences can also occur if you used too few random draws in classical estimation, or your model simply converged to an inferior solution, which is more likely to happen the more complex your model is.

Nico