Estimation the random heterogeneity model

133 views
Skip to first unread message

Valeriy

unread,
Jul 10, 2019, 8:55:05 AM7/10/19
to Biogeme

Hello,

I tried to estimate the random heterogeneity model, and every time I got a message with error:
"The kernel appears to have died. It will restart automatically".
I don't understand where is my problem.
Can you  help me please?

Thank you.

Here you can see the my code

In [1]:
import pandas as pd
import biogeme.database as db
import biogeme.biogeme as bio
import biogeme.models as models
In [2]:
pandas = pd.read_excel("desktop\SP6ModeChoiceTLV.xlsx")
database = db.Database("SP6ModeChoiceTLV",pandas)
database.panel("ID")
from headers import *
In [3]:
ASC1 = Beta('ASC1', 0, None, None, 0)
ASC2 = Beta('ASC2', 0, None, None, 0)
ASC4 = Beta('ASC4', 0, None, None, 0)
ASC5 = Beta('ASC5', 0, None, None, 0)
ASC8 = Beta('ASC8', 0, None, None, 0)
ASC9 = Beta('ASC9', 0, None, None, 1)
Itt1 = Beta('Itt1', 0, None, None, 0)
Itt3 = Beta('Itt3', 0, None, None, 0)
ovt = Beta('ovt', 0, None, None, 0)
Cst1 = Beta('Cst1', 0, None, None, 0)
Cst3 = Beta('Cst3', 0, None, None, 0)
Cst4 = Beta('Cst4', 0, None, None, 0)
awt = Beta('awt', 0, None, None, 0)
dlay = Beta('dlay', 0, None, None, 0)
adt = Beta('adt', 0, None, None, 0)
Ott1 = Beta('Ott1', 0, None, None, 0)
Ott2 = Beta('Ott2', 0, None, None, 0)
B_Er = Beta('B_er',0,None,None,0)
In [4]:
B_RND = B_Er * bioDraws('B_RND','NORMAL')
In [5]:
V1 = ASC1 + Itt1 * binvt + ovt * bovt + Cst1 * bfare + awt * bawt + dlay * bsdpct + B_RND
V2 = ASC2 + Itt1 * binvt + ovt * bovt + Cst1 * bfare + adt * badt + dlay * bsdpct + B_RND
V4 = ASC4 + Itt1 * minvt + ovt * movt + Cst1 * mfare + awt * mawt + dlay * mdpct + B_RND
V5 = ASC5 + Itt1 * minvt + ovt * movt + Cst1 * mfare + adt * madt + dlay * mdpct + B_RND
V8 = ASC8 + Itt3 * ctime + Cst3 * cfuel + Ott1 * csrch + Ott2 * cwalk + B_RND  
V9 = ASC9 + Cst4 * cfuel + Ott1 * csrch 
In [ ]:
 
In [6]:
V = {1: V1, 2: V2, 4: V4, 5: V5, 8: V8, 9: V9}
av = {1: av1, 2: av2, 4: av4, 5: av5, 8: av8, 9: av9}
In [7]:
obsprob = models.logit(V,av,choice)
condprobIndiv = PanelLikelihoodTrajectory(obsprob)
logprob = log(MonteCarlo(condprobIndiv))
In [8]:
biogeme  = bio.BIOGEME(database,logprob,numberOfDraws=50)
biogeme.modelName = "SP6ModeChoiceTLV"
In [ ]:
results = biogeme.estimate(bootstrap=10)
In [ ]:
print("Results=",results)
In [ ]:
print(results)

Ercan Kurtuluş

unread,
Jul 11, 2019, 8:06:10 AM7/11/19
to Biogeme
It appears that you defined same error component for each alternative. You should define different error components for each alternative except for your base alternative.

10 Temmuz 2019 Çarşamba 15:55:05 UTC+3 tarihinde Valeriy yazdı:
Reply all
Reply to author
Forward
0 new messages