Numerical integration and Monte-Carlo integration to deal 2-dimension problem

31 views
Skip to first unread message

可可

unread,
Feb 7, 2025, 2:08:51 AM2/7/25
to Biogeme
Dear Biogeme-group,
I set two latent variables, CC and AA, when I calibrated the ICLV model. Can I set just one omega at the structural equations?

omega = RandomVariable('omega')
density = dist.normalpdf(omega)
sigma_CC = Beta('sigma_CC', 1, None, None, 0)
sigma_AA = Beta('sigma_AA', 1, None, None, 0)
CC = Intercept_CC + coef_edu_CC * edu + ....  + sigma_CC * omega
AA = Intercept_AA + coef_edu_AA * edu + ....  + sigma_AA * omega

To deal 2-dimension problem, I used integrate() numerical integration:

loglike = log(Integrate(condlike * density,'omega'))

Is this correct, and if not, how should I modify this code for 2-dimension integration?

Additionally, I see that you generally recommend Monte-Carlo integration for 2-dimension problems, I'll try to modify the structural equations like this:

omega_1 = bioDraws ( 'omega_1' , 'NORMAL')
omega_2 = bioDraws ( 'omega_2' , 'NORMAL')
sigma_CC = Beta('sigma_CC', 1, None, None, 0)
sigma_AA = Beta('sigma_AA', 1, None, None, 0)
CC = Intercept_CC + coef_edu_CC * edu + ....  + sigma_CC * omega_1
AA = Intercept_AA + coef_edu_AA * edu + ....  + sigma_AA * omega_2

And the integration is modified to this:

logprob = log (MonteCarlo (condlike))
biogeme = bio.BIOGEME(database,  logprob, numberOfDraws=500)
results = biogeme.estimate()

May I ask if this part of code is now correct? My colleagues and I are very concerned about this problem and would appreciate your any response!
Reply all
Reply to author
Forward
0 new messages