Hi,
Thank you for providing so much help on this forum!
I have a general question when running an EMDC model embedded in a latent class framework. When the estimation is done (showing converged), it shows estimated parameters with approximate standard errors from BHHH matrix, which is all fine.
However, after "computing covariance matrixi using numeric methods (numDeriv)", some of the s.e. shows NAN. And this step takes a lot longer than the actual estimation.
May I know why I could get all the s.e. without a problem in the BHHH matrix, but not after numerical derivation? Also, why does the post-estimation process take so long compared to the estimation?
Thank you.
Important: Read this before posting to this forum
- This forum is for questions related to the use of Apollo. We will answer some general choice modelling questions too, where appropriate, and time permitting. We cannot answer questions about how to estimate choice models with other software packages.
- There is a very detailed manual for Apollo available at http://www.ApolloChoiceModelling.com/manual.html. This contains detailed descriptions of the various Apollo functions, and numerous examples are available at http://www.ApolloChoiceModelling.com/examples.html. In addition, help files are available for all functions, using e.g. ?apollo_mnl
- Before asking a question on the forum, users are kindly requested to follow these steps:
- Check that the same issue has not already been addressed in the forum - there is a search tool.
- Ensure that the correct syntax has been used. For any function, detailed instructions are available directly in Apollo, e.g. by using ?apollo_mnl for apollo_mnl
- Check the frequently asked questions section on the Apollo website, which discusses some common issues/failures. Please see http://www.apollochoicemodelling.com/faq.html
- Make sure that R is using the latest official release of Apollo.
- Users can check which version they are running by entering packageVersion("apollo").
- Then check what is the latest full release (not development version) at http://www.ApolloChoiceModelling.com/code.html.
- To update to the latest official version, just enter install.packages("apollo"). To update to a development version, download the appropriate binary file from http://www.ApolloChoiceModelling.com/code.html, and install the package from file
- If the above steps do not resolve the issue, then users should follow these steps when posting a question:
- provide full details on the issue, including the entire code and output, including any error messages
- posts will not immediately appear on the forum, but will be checked by a moderator first. This may take a day or two at busy times. There is no need to submit the post multiple times.
Why can I get s.e. from BHHH matrix (when I run BFGS), but the numerical derivation produces NAN?
-
- Posts: 9
- Joined: 28 Aug 2021, 01:54
-
- Site Admin
- Posts: 1050
- Joined: 24 Apr 2020, 16:29
Re: Why can I get s.e. from BHHH matrix (when I run BFGS), but the numerical derivation produces NAN?
Hi
to help us answer this question, please provide some outputs and details about your model.
Thanks
to help us answer this question, please provide some outputs and details about your model.
Thanks
-
- Posts: 9
- Joined: 28 Aug 2021, 01:54
Re: Why can I get s.e. from BHHH matrix (when I run BFGS), but the numerical derivation produces NAN?
Hi Stephane,
I run an EMDC model with latent class (say there are two latent segments, the membership of which is associated with demographics, and each segment has a different set of parameters for the baseline utility and the satiation parameters). I tried to use the default BGW algorithm for optimization, but I I often cannot get the results. I have been trying to do some debugging. I realized that I often get the warning message saying: In log(Gi): NaNs produced (I found that Gi is the last term in the log form in Equation (10) of the paper Palma and Hess (2022). It seems that we cannot always ensure that this term Gi is positive in optimization procedure.)
I also found that the code some time produces the warning message: In log(Jdet) : NaNs produced. Even in the example code on the website "eMDC_with_budget", I can run the code and get the result, but still produces this warning message. So I guess Jdet is not guaranteed to be positive and may lead to the estimation fail sometimes?
I also have another question general question: is it ok to include the same covariates in both the baseline utility and satiation in the MDCEV or EMDC model?
Thank you in advance.
I run an EMDC model with latent class (say there are two latent segments, the membership of which is associated with demographics, and each segment has a different set of parameters for the baseline utility and the satiation parameters). I tried to use the default BGW algorithm for optimization, but I I often cannot get the results. I have been trying to do some debugging. I realized that I often get the warning message saying: In log(Gi): NaNs produced (I found that Gi is the last term in the log form in Equation (10) of the paper Palma and Hess (2022). It seems that we cannot always ensure that this term Gi is positive in optimization procedure.)
I also found that the code some time produces the warning message: In log(Jdet) : NaNs produced. Even in the example code on the website "eMDC_with_budget", I can run the code and get the result, but still produces this warning message. So I guess Jdet is not guaranteed to be positive and may lead to the estimation fail sometimes?
I also have another question general question: is it ok to include the same covariates in both the baseline utility and satiation in the MDCEV or EMDC model?
Thank you in advance.
-
- Site Admin
- Posts: 1050
- Joined: 24 Apr 2020, 16:29
Re: Why can I get s.e. from BHHH matrix (when I run BFGS), but the numerical derivation produces NAN?
Hi
this sounds like an identification issue with your model - could you show us the results?
Regarding covariates, in theory yes, but in practice, identifying the effects in the satiation terms is much harder
Stephane & David
this sounds like an identification issue with your model - could you show us the results?
Regarding covariates, in theory yes, but in practice, identifying the effects in the satiation terms is much harder
Stephane & David