Apollo vs. BIOGEME comparison

41 views
Skip to first unread message

Kevin Dj

unread,
Oct 22, 2025, 6:42:04 AMOct 22
to Biogeme
Hello Prof. Bierlaire,

I am translating some models from Apollo to BIOGEME for teaching purposes, but I encountered some issues with Nested Logit models, where BIOGEME doesn't converge for a simple Nested Logit problem. I tried to change the settings (starting values, upper/lower bounds, estimation algorithm, etc.), but the issue still occurs. It would be much appreciated if you could help me solve the issue.

I attach the codes from both R and Python, as well as their results, with this message.

Thank you so much in advance.

Best Regards,
Kevin Djoenneady Poetera
NL2_model.R
NL2 result.png
Error message.png
NL2_model.ipynb

Michel Bierlaire

unread,
Oct 28, 2025, 6:16:07 AMOct 28
to Kevin Dj, Michel Bierlaire, Biogeme
Dear Kevin,

Sorry, I was traveling.

In the biogeme.toml file, you need to set the parameter numerically_safe to "True". It is False by default, in order to speed up the estimation.

Let me know if it works.

Michel




> On 28 Oct 2025, at 10:06, Kevin Dj <kevinp...@gmail.com> wrote:
>
> Hello Prof. Bierlaire,
>
> I hope you’re doing well. I wanted to follow up on my previous email regarding the NL issue between Apollo vs. BIOGEME, where the one from BIOGEME doesn't converge for a simple NL model. I wanted to know whether you have found the cause of the problem.
>
> Your assistance on this matter is greatly appreciated. Please let me know if you need any additional information from my side to help resolve the issue.
>
> Thank you, and I am looking forward to your response.
>
>
> Best regards,
> Kevin Djoenneady Poetera
>
>
> On Wed, Oct 22, 2025 at 12:56 PM Kevin Dj <kevinp...@gmail.com> wrote:
> Hello Prof. Bierlaire,
>
> Thank you for your response. You'll find the dataset and the py file attached to this email.
>
> Please let me know if you need anything else.
>
> Best Regards,
> Kevin
>
> On Wed, Oct 22, 2025 at 12:48 PM Michel Bierlaire <michel.b...@epfl.ch> wrote:
> Dear Kevin,
>
> Can you please send me the data file (to me, not to the group), as well as a python script exported from your jupyter notebook, so that I can replicate the problem?
>
> Thanks,
>
> Michel
> > --
> > 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/87527826-dc04-4166-83e1-3eef7bc7762en%40googlegroups.com.
> > <NL2_model.R><NL2 result.png><Error message.png><NL2_model.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
>
>
>
> --
> Regards,
> Kevin Djoenneady Poetera
>
>
>
> --
> Regards,
> Kevin Djoenneady Poetera


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

Kevin Dj

unread,
Nov 5, 2025, 9:13:21 AMNov 5
to Biogeme
Hello Prof. Bierlaire,

Thank you for the suggestions,  it works perfectly and I don't get the error message anymore. However, for the CNL model, I get slightly different results compared to Apollo (results and script in screenshot). I assume we would have somewhat similar results, but the difference is a bit too noticeable. This might be due to different precision parameters in the estimation process. Are there any other settings in the toml file that I can change to solve this?

Thank you so much in advance.

Best,
Kevin Djoenneady Poetera
BIOGEME_CNL_result.png
Apollo_CNL_result.png
CNL.py
CNL.R

Michel Bierlaire

unread,
Nov 5, 2025, 9:28:00 AMNov 5
to kevinp...@gmail.com, Michel Bierlaire, Biogeme
The tolerance for the convergence can always be decreased. The default value is
tolerance = 6.055454452393343e-06
> To view this discussion visit https://groups.google.com/d/msgid/biogeme/a0f19cd0-8ca8-4a8a-a803-14a28df4b309n%40googlegroups.com.
> <BIOGEME_CNL_result.png><Apollo_CNL_result.png><CNL.py><CNL.R>
Reply all
Reply to author
Forward
0 new messages