Try to run the example indicators model in 07cross_elasticities.py

29 views
Skip to first unread message

Zhe Ji

unread,
Dec 1, 2022, 2:25:23 AM12/1/22
to Biogeme
Dear Professor Bierlaire,

I tried to run your example model for indicator estimation but it gives an error as follows:
===quotes===
Traceback (most recent call last):
  File "C:\Users\User\IdeaProjects\MNL\02simulation.py", line 35, in <module>
    simulated_choices = logprob.getValue_c(
TypeError: getValue_c() got an unexpected keyword argument 'betas'
...
Process finished with exit code 1
===end quotes===

The version of my local Biogeme is 3.2.8 since it shows DLLs not found with 3.2.10. An interesting finding is: although the error occurs, the estimation result is the same shown as in the example result "02estimation.html". But each time I run the code, the result will never be the same... I think the reason is maybe it saves my data frame in the database somehow and the next run will base on my previous result. I am not good at coding and could you please kindly help to find out if I made any mistakes in it?
Thank you very much in advance.

Best Regards
Zhe Ji

Bierlaire Michel

unread,
Dec 1, 2022, 3:33:43 AM12/1/22
to ernes...@gmail.com, Bierlaire Michel, Biogeme

On 1 Dec 2022, at 02:09, Zhe Ji <ernes...@gmail.com> wrote:

Dear Professor Bierlaire,

I tried to run your example model for indicator estimation but it gives an error as follows:
===quotes===
Traceback (most recent call last):
  File "C:\Users\User\IdeaProjects\MNL\02simulation.py", line 35, in <module>
    simulated_choices = logprob.getValue_c(
TypeError: getValue_c() got an unexpected keyword argument 'betas'
...
Process finished with exit code 1
===end quotes===

The version of my local Biogeme is 3.2.8 since it shows DLLs not found with 3.2.10.

The solution of this problem has been posted recently on the users group.

An interesting finding is: although the error occurs, the estimation result is the same shown as in the example result "02estimation.html". But each time I run the code, the result will never be the same... I think the reason is maybe it saves my data frame in the database somehow and the next run will base on my previous result.

Yes, by default Biogeme is saving each iteration of the optimization algorithm on a file. The next time it is run it starts from the saved iterate.

I am not good at coding and could you please kindly help to find out if I made any mistakes in it?
Thank you very much in advance.

Best Regards
Zhe Ji

--
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/02cb6e46-b30d-472e-90b4-28d8079654f0n%40googlegroups.com.

Reply all
Reply to author
Forward
Message has been deleted
0 new messages