Dear Professor Bierlaire,
I have a question regarding how to specify heteroscedasticity in nest logit (NL) models. I have learned the method you used in swissmetro, specifically b03scale.py, which is based on the MNL model. I also watched your lecture on Youtube (https://www.youtube.com/watch?v=CMAKwIS_d28), and I found it very helpful.
I would like to know if the method used to
specify heteroscedasticity in b03scale.py for the MNL model can also be applied
to NL models.
If this method is not suitable for NL models, I believe I will need to define and estimate mu_g and lambda_g for different groups. In this scenario, I assume I would need to simultaneously calibrate mu_g and lambda_g in Biogeme.
For instance, consider a NL model with three alternatives: red_bus, blue_bus, and car, with red_bus and blue_bus in one nest. We have two groups of samples. I think I would need to estimate two lambdas (one for each group) and estimate one mu (the mu of one of the two groups) while normalizing the other one (if I normalize mu and estimate lambda). This approach would require me to estimate one mu and two lambda simultaneously. Do you have any relevant examples or cases to share for simultaneously calibrate mu and lambda in Biogeme?
Thank you so much for your help.
Best regards,
Jing
Thank you so much for your response, Professor Bierlaire. I have a follow-up question.
If it's an NL model, and I consider the example in your 09nested.py case, to specify heteroscedasticity, would I only need to add the following statements in specification? These statements are adapted from the 03scale.py case and aim to define a scale parameter, which is then multiplied by the utility function of each alternative in the 09nested.py case to achieve the goal. For example:
“
# Scale associated with group 3 is estimated
scale = (GROUP != 3) + (GROUP == 3) * Scale_group3
# Scale the utility functions and associate them with the alternative numbering
V = {1: scale * V1,
2: scale * V2,
3: scale * V3}
“
In this scenario, the result of my estimation would still yield one lambda (consistent with the NL estimation method in your 09 file, where mu is normalized to 1), and an estimated coefficient for Scale_group3. I would then use the estimated Scale_group3 to determine whether there is heteroscedasticity by checking if it is significantly different from 1.
So, does this mean that for NL models, like the 09nested.py case, it's sufficient to express heteroscedasticity using only one lambda and one estimated coefficient for the scale parameter (Scale_group3)?
In this case, it appears that I've assumed that the ratio of mu_g to lambda_g (mu_g/lambda_g) for different groups remains constant. Would I not need to estimate two lambdas for two groups (e.g., lambda_1 and lambda_2) and another mu for group 2 (assuming I set group 1 as the reference)?
I apologize for this additional question, but I wanted to clarify whether one lambda and a scale parameter are adequate.
Thank you once again for your guidance.
Best regards,
Jing
Thank you for your response, Professor Bierlaire. I genuinely appreciate it.
Additionally, I would like to express my gratitude to you for developing Biogeme. It has proven to be a very valuable tool for me.
Best regards,
Jing