Re: [biogeme] Route choice model calibration with synthetic data using Biogeme

91 views
Skip to first unread message

Bierlaire Michel

unread,
Aug 18, 2021, 2:28:04 AM8/18/21
to licun...@gmail.com, Bierlaire Michel, Biogeme
You need to format your data such that there is one row per observation. 
In this case, it seems that you have only one observation, with 12 alternatives. In your specification, you declare only 3 alternatives.

Also, I strongly recommend to move to the newest version of biogeme. The one that you are using is outdated.


On 18 Aug 2021, at 05:41, guoyuan li <licun...@gmail.com> wrote:

Dear Michel,

Sorry to bother you.

My question is summarized: I want to use the synthetic data of a small network to examine the route choice model, and only route length (or travel time) is considered in the (dis)utility function (for data synthetization). However, when I only consider route length (or adding alternative specific constant) for utility using Biogeme, the result is wrong (strange final log likelihood and very large alpha value in MNL model compared to the paper). Actually, I have tested some other networks, and same issues appear. The detail of one example is as follows:

I am replicating the small example of MNL model in a paper "Impact of route choice set on route choice probabilities" to learn Biogeme for my own reseach problem.
<1629256985(1).jpg>
(1) Based on the paper, I obtain the synthetic data with probit results, which obtained similar route probabilities to that in that paper.
<1629256496(1).jpg>
(2) Then, I just adopted the (dis)utility function in Eq. (17) in that paper with only route length in Biogeme:
<1629257145(1).jpg>
<E%8]AA]@`@J9TWXSF$PMLRP.png>
(3) However, the likelihood results look strange, and the calibrated alpha in MNL model is quite large (in that paper, alpha=-2.08).
<1629256753(1).jpg>

Would you give me some suggestions about which step might be wrong? (how to calibrate route choice models using synthetic data considering only route length (or travel time))?

Thank you.

Sincerely,
Guoyuan LI


--
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/cf715514-a624-40e5-9adf-3545816742c1n%40googlegroups.com.
<1629256753(1).jpg><1629256985(1).jpg><1629257145(1).jpg><E%8]AA]@`@J9TWXSF$PMLRP.png><1629256496(1).jpg>

guoyuan li

unread,
Aug 18, 2021, 5:06:17 AM8/18/21
to Biogeme
Dear Michel,

Thank you for your response, and sorry to bother you again. I am sorry that I uploaded the wrong figure in the first question.

For the same 12 path network, I have redone it using the python version (3.2.8).
1.png

(1) The synthetic route choice data is as follows (one row per observation with 12 alternatives):
2.jpg

(2) And the python code modified from your mnl version is:
3.jpg
However, the estimated alpha (B_TIME in the code, -44680.643458) and final loglikelihood are very strange. Would you give me some suggestions? Or should the problem happen on the synthetic route choice data?
4.jpg

Thank you.

Sincerely,
Guoyuan LI

Bierlaire Michel

unread,
Aug 19, 2021, 9:22:57 AM8/19/21
to licun...@gmail.com, Bierlaire Michel, Biogeme
It seems that the chosen path is always the fastest. If you, the logliekilood is not bounded, and the beta parameter goes to infinity. So, this is not strange at all.


On 18 Aug 2021, at 10:28, guoyuan li <licun...@gmail.com> wrote:

Dear Michel,

Thank you for your response, and sorry to bother you again. I am sorry that I uploaded the wrong figure in the first question.

For the same 12 path network, I have redone it using the python version (3.2.8).
<1.png>

(1) The synthetic route choice data is as follows (one row per observation with 12 alternatives):
<2.jpg>

(2) And the python code modified from your mnl version is:
<3.jpg>
However, the estimated alpha (B_TIME in the code, -44680.643458) and final loglikelihood are very strange. Would you give me some suggestions? Or should the problem happen on the synthetic route choice data?
To view this discussion on the web visit https://groups.google.com/d/msgid/biogeme/5b60adcb-4f1b-445e-a011-79bb800b710bn%40googlegroups.com.
<4.jpg><3.jpg><1.png><2.jpg>

Reply all
Reply to author
Forward
0 new messages