Page 1 of 1

Why can I get s.e. from BHHH matrix (when I run BFGS), but the numerical derivation produces NAN?

Posted: 29 Sep 2023, 04:58
by yaoyao7031
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.

Re: Why can I get s.e. from BHHH matrix (when I run BFGS), but the numerical derivation produces NAN?

Posted: 03 Oct 2023, 09:41
by stephanehess
Hi

to help us answer this question, please provide some outputs and details about your model.

Thanks

Re: Why can I get s.e. from BHHH matrix (when I run BFGS), but the numerical derivation produces NAN?

Posted: 12 Nov 2023, 00:21
by yaoyao7031
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.

Re: Why can I get s.e. from BHHH matrix (when I run BFGS), but the numerical derivation produces NAN?

Posted: 04 Dec 2023, 11:01
by stephanehess
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