mixed logit model

416 views
Skip to first unread message

farnaz F

unread,
Jun 27, 2018, 3:37:35 AM6/27/18
to Biogeme
Hi Michel,

I am trying to estimate a mixed logit model using Pythonbiogeme. The problem is when I change the starting values of the parameters, the estimated parameters change too. but in your example which is on the Biogeme website, by changing starting values, the model does not change.

Is this something usual for mixed logit models or you guess there are some mistakes in my syntax?

Best Regards,
Farnaz


002mixed.py

Bierlaire Michel

unread,
Jun 27, 2018, 3:38:15 AM6/27/18
to farnaz.f...@gmail.com, Bierlaire Michel, Biogeme
It is not a good idea to start the estimation of standard errors with 0, as it may be a local optimum. 
Use 0.1 instead.

Also, numerical integration may generate numerical issues. If problems persist, use Monte-Carlo integration.


--
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.
<002mixed.py>

farnaz F

unread,
Jun 28, 2018, 6:49:37 AM6/28/18
to Biogeme
thanks a lot.

farnaz F

unread,
Jun 28, 2018, 10:28:17 AM6/28/18
to Biogeme
Dear Michel,

Thank you for your advice. I saw monte-carlo examples on Biogeme website. I wrote my model based on 06normalMixture.py and it sounds the problem has been solved, but I am not sure if I use true syntax. May I ask you to take a look and tell me if I use wrong syntax?

Thanks again,
Farnaz


omega = bioDraws('B_costs_RND')

B_costs_RND = B_costs + B_costs_s omega
choice=DefineVariable('choice', (ois==1) + (ois==0)*2 )
V1 = ASC1 + B_coe coe + B_aware1 aware1 + B_occu1 occu1 + B_OI OI + B_costsale costsale coe + salesph B_salesph + B_costs_RND * costs
V2 = ASC2

V = {1: V1, 2: V2,}
av = {1: 1, 2: 1}
integrand = bioLogit(V, av, choice)
simulatedI = MonteCarlo(integrand)
rowIterator('obsIter')
BIOGEME_OBJECT.ESTIMATE = Sum(log(simulatedI),'obsIter')
BIOGEME_OBJECT.EXCLUDE = excluded
BIOGEME_OBJECT.STATISTICS['Num of individuals']=Sum(1,'obsIter')
BIOGEME_OBJECT.PARAMETERS['NbrOfDraws'] = "500"
BIOGEME_OBJECT.PARAMETERS['optimizationAlgorithm'] = "BIO"
BIOGEME_OBJECT.DRAWS = { 'B_costs_RND': ('NORMAL','ID')}


On Wednesday, 27 June 2018 00:37:35 UTC-7, farnaz F wrote:
Message has been deleted

Mohammad Kiani

unread,
Jul 5, 2018, 3:56:17 AM7/5/18
to Biogeme
Hi Michel

I am trying to estimate a mixed logit model using Pythonbiogeme. I have been trying different kinds of distributions to find the best one for my parameters. When I use some distributions (eg. normal) the p-values of some standard errors (like B_COST_FUEL_S) exactly equal to 1. I do not know if my model has predicaments in syntaxes or something or it is a common result. I will be grateful If you help me with this Problem.


With regards,
Mohammad
001logit.py
Reply all
Reply to author
Forward
0 new messages