Newsha Bagheri
unread,May 5, 2023, 1:24:41 AM5/5/23Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Biogeme
Dear Professor Bierlaire,
I am writing to seek your expertise regarding a problem while using Biogeme. I created a synthetic dataset for which I know the true values of parameters. I have created a model with two latent variables p1 and p2, and I am using Biogeme for estimation.
Here is the specification of the model and the code that I am using (I tried to make the formulation as simple as possible, so I consider Sigmas be equal to one):
Dataset = pd.read_excel('Dataset.xlsx')
database = db.Database('Data', Dataset)
globals().update(database.variables)
B_a = Beta('B_a', 0, None, None, 0)
B_b = Beta('B_b', 0, None, None, 0)
B_p = Beta('B_p', 0, None, None, 0)
B_z = Beta('B_z', 1, None, None, 1)
B_wz = Beta('B_wz', 0, None, None, 0)
p1 = B_z * z1 + B_wz * wz1 + bioDraws('p1','NORMAL')
p2 = B_z * z2 + B_wz * wz2 + bioDraws('p2','NORMAL')
V1 = B_a * a1 + B_b * b1 + B_p * p1
V2 = B_a * a2 + B_b * b2 + B_p * p2
V = {0: V1,
1: V2}
condprob = models.loglogit(V, None, choice)
biogeme = bio.BIOGEME(database, MonteCarlo(condprob),numberOfDraws= 200)
biogeme.modelName = '01choice'
results = biogeme.estimate(algorithm=opt.bioNewton)
My problem is that when I use different names for bioDraws of p1 and p2, the estimated values are not close to the true values. However, when I use the same name for bioDraws of p1 and p2 (e.g.
bioDraws('p1','NORMAL') for both ), the estimated values are close to the true values.
Could you please explain to me why this is happening? Any insight you can provide would be greatly appreciated.
Thank you very much for your time and help.
Best regards,
Niousha