01logit_simul.py: Warning chosen alternative not available

402 views
Skip to first unread message

Jason Hawkins

unread,
Nov 10, 2018, 11:08:50 AM11/10/18
to Biogeme
I am running the 01logit_simul for Python Biogeme with Pandas. It gives me the message:  
WARNING  [biogeme.py:140] The chosen alternative is not available for the following observations (rownumber[choice]): 9[3]-10[3]-11[3]-12[3]-13[3]-14[3] ...

There is no warning when running 01logit.py. I checked the database and alt3 (car) is not available for these observations, but the chosen alternative is alt2 (SM). Perhaps there is an off-by-1 error in the simulate code somewhere? I had a look through the source but couldn't find anything out of place.

Thanks,
Jason

Michel Bierlaire

unread,
Nov 10, 2018, 12:05:03 PM11/10/18
to jfha...@gmail.com, Michel Bierlaire, Biogeme
Because the model is applied to all alternatives for all observations, irrespectively of their availability. 
prob1 = models.logit(V,av,1)
prob2 = models.logit(V,av,2)
prob3 = models.logit(V,av,3)

The warning can be ignored as the probability is 0. 

In the 01logit, the model is calculated for the chosen alternative only, which, in principle, is always available. 
logprob = bioLogLogit(V,av,CHOICE)

In the future, I plan to include parameters to turn off the warnings. But it is not available now. 

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 post to this group, send email to bio...@googlegroups.com.
Visit this group at https://groups.google.com/group/biogeme.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages