Mixture of logit with panel data

8 views
Skip to first unread message

amneh nassar

unread,
Jan 13, 2026, 10:44:42 AM (3 days ago) Jan 13
to Biogeme

Dear Prof. Berlier,

I need your assistance with an issue I am encountering while estimating a Mixture of logit Model that combines panel data effect.

I receive the error shown below

The norm of the gradient at OFF_PEAK_ASC=0, OFF_PEAK_ASC_S=10, PEAK_ASC=0, PEAK_ASC_S=10 is nan: g=nan, nan, nan, nan
The norm of the gradient at OFF_PEAK_ASC=0, OFF_PEAK_ASC_S=10, PEAK_ASC=0, PEAK_ASC_S=10 is nan: g=nan, nan, nan, nan
Numerical problems in calculating the analytical hessian. Finite differences is tried instead.
The norm of the gradient at OFF_PEAK_ASC=0, OFF_PEAK_ASC_S=10, PEAK_ASC=0, PEAK_ASC_S=10 is nan: g=nan, nan, nan, nan
The norm of the gradient at OFF_PEAK_ASC=1e-07, OFF_PEAK_ASC_S=10, PEAK_ASC=0, PEAK_ASC_S=10 is nan: g=nan, nan, nan, nan
The norm of the gradient at OFF_PEAK_ASC=0, OFF_PEAK_ASC_S=10, PEAK_ASC=0, PEAK_ASC_S=10 is nan: g=nan, nan, nan, nan
The norm of the gradient at OFF_PEAK_ASC=0, OFF_PEAK_ASC_S=10, PEAK_ASC=1e-07, PEAK_ASC_S=10 is nan: g=nan, nan, nan, nan
The norm of the gradient at OFF_PEAK_ASC=0, OFF_PEAK_ASC_S=10, PEAK_ASC=0, PEAK_ASC_S=10 is nan: g=nan, nan, nan, nan
Numerical problems with finite difference hessian as well.

 the model includes 3 alternatives and constant parameters. 

I tried to estimate the model based on initial Beta values from the MNL model results, also i tried to increase the initial value of the standard deviation parameters,  but I received the same error.

the data is not flattened, and i followed this example 
https://biogeme.epfl.ch/sphinx/auto_examples/swissmetro/plot_b12_panel.html

Attached my script

 Thanks a lot for your help!

Amneh

Panel_Car.ipynb

Michel Bierlaire

unread,
Jan 14, 2026, 2:07:54 AM (2 days ago) Jan 14
to amnehe...@gmail.com, Michel Bierlaire, Biogeme
The problem is likely to be caused by the starting values of the scale parameter. It seems that you have tried 100 and 10. Try 1.

If it does not work, use Biogeme in simulation mode to generate the contribution to the likelihood function of each observation. It will help you to identify the cause of the problem.
> --
> 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 visit https://groups.google.com/d/msgid/biogeme/a5f82d4c-a069-4402-9d10-c300c72c12can%40googlegroups.com.
> <Panel_Car.ipynb>

Michel Bierlaire
Transport and Mobility Laboratory
School of Architecture, Civil and Environmental Engineering
EPFL - Ecole Polytechnique Fédérale de Lausanne
http://transp-or.epfl.ch
http://people.epfl.ch/michel.bierlaire

Reply all
Reply to author
Forward
0 new messages