Fully correlated MXL model
Posted: 03 Jun 2021, 06:43
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
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