Dear Michel, and all,
I hope this email finds you in good health. I am currently in the process of testing the incorporation of three latent variables into a Discrete Choice Model (DCM). However, I have encountered multiple challenges along the way. I am writing to seek your guidance and expertise in addressing these issues.
Issue 1: One of the primary hurdles I am facing involves the computation of integrals for each of the random variables within the DCM. Specifically, I am unsure about the validity of the following code segment:
integral_1 = Integrate(condlike * density_1, 'omega_1')
integral_2 = Integrate(condlike * density_2, 'omega_2')
integral_3 = Integrate(condlike * density_3, 'omega_3’)
loglike = log(integral_1 + integral_2 + integral_3)
Could you please provide insight into whether this approach is appropriate for calculating the integrals and overall log likelihood?
Issue 2: After implementing this approach, I encountered two bugs:
I believe these errors are related to the integration of the random variables. However, I am uncertain about the exact cause and how to resolve them.
Below is a snippet of the code where I define the random variables:
omega_1 = RandomVariable('omega_1')
omega_2 = RandomVariable('omega_2')
omega_3 = RandomVariable('omega_3’)
density_1 = dist.normalpdf(omega_1)
density_2 = dist.normalpdf(omega_2)
density_3 = dist.normalpdf(omega_3)
sigma_s_1 = Beta('sigma_s_1', 1, None, None, 0)
sigma_s_2 = Beta('sigma_s_2', 1, None, None, 0)
sigma_s_3 = Beta('sigma_s_3', 1, None, None, 0)
Your expertise would be incredibly valuable in helping me navigate through these complexities. If you require more specific information about the model setup or the code, I am more than willing to provide it.
Thank you very much for your time and assistance. I am eagerly anticipating your guidance.
Best regards, Leos