< Warning > Numerical problem with the second derivative matrix

Skip to first unread message

linlin zhang

Sep 3, 2022, 12:55:07 PMSep 3
to Biogeme
Dear Michel,

I am runing NL and CNL model. After several iterations, both encountered the following Warning:
< Warning >   Numerical problem with the second derivative matrix. Norm = inf. Replaced by the identity matrix.

What does this mean? Does it matter? If so, what can I do for this?

I attached the relevant code as below for your reference.
MU1 = Beta('MU1', 1, 1, None, 0)
MU2 = Beta('MU2', 1, 1, None, 0)
Alpha1a = Beta("Alpha1a", 0.5, 0, 1, 0)
Alpha1b = 1 - Alpha1a
Alpha2a = Beta("Alpha2a", 0.5, 0, 1, 0)
Alpha2b = 1 - Alpha2a
Alpha3a = Beta("Alpha3a", 0.5, 0, 1, 0)
Alpha3b = 1 - Alpha3a
Alpha4a = Beta("Alpha4a", 0.5, 0, 1, 0)
Alpha4b = 1 - Alpha4a

Many thanks!

Best, Lin 

Bierlaire Michel

Sep 3, 2022, 12:59:36 PMSep 3
to linlin...@gmail.com, Bierlaire Michel, Biogeme
Build your model incrementally. 
First make sure that the logit model with this specification works well. 
Second, focus on the nested logit. Usually, it is straightforward to estimate, except if the nests are poorly defined. 
Only then, start investigating the cross-nested logit. This model is tricky to estimate. I would start with fixed alpha’s. Estimate only the mu’s. 
Once you have a model that makes sense, try to estimate the alpha’s.  

You received this message because you are subscribed to the Google Groups "Biogeme" group.
To unsubscribe from this group and stop receiving emails from it, send an email to biogeme+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/biogeme/671e88e1-fa0b-470f-ba4a-1c275b4f9a16n%40googlegroups.com.

linlin zhang

Sep 20, 2022, 5:23:46 AMSep 20
to Biogeme
Hi Michel,

I am wondering if this warning is because I used a small Random Sample (500/5000) to run the models, and I have over 1200,000 observations that will be devided into 9 alternatives. Please let me know what do you think.

I used all my observations to run NL and CNL models, but have not finished yet in 18 days. So far, NL and CNL models have 56 and 9 iterations, respectively. But I have no idea how many iterations NL and CNL will have, respectively. What do you think?

If I manually set the number of iterations, will this significantly affect the model estimation results compared to the number of iterations that automatically reach the optimum/maximum?

Many thanks, 


linlin zhang

Oct 28, 2022, 1:40:19 AMOct 28
to Biogeme
Dear Michel,

I did run the logit model first and it showed my utility functions work. I'm wondering if it is possible to filter the independent variables that  significantly affect for each Choice, that means only those variable will be added into the choice's utility function? 

If yes, when I put the independent variables one by one into the MNL model to experiment, each independent variable showed a significant correlation with each Choice (i.e., dependent variable). This means that there is no reason for any independent variable to be omitted from the utility function for each Choice. Is this correct? Otherwise, how should this step be performed?

Many thanks, Linlin
在2022年9月3日星期六 UTC+2 18:59:36<michel.b...@epfl.ch> 写道:
Reply all
Reply to author
0 new messages