MATLAB Code to Estimate Logit-Mixed Logit Model (Preference space, fixed and random parameters)
收藏资源简介:
This is a sample MATLAB code to estimate Logit-Mixed Logit Model in preference space. The example is provided for a model with 2 fixed parameters, 2 random parameters, and 3 alternatives. This code is an extension of the original code by Kenneth Train which considers all utility parameters to be random and the model is estimated in willingness-to-pay space. This code uses a simuated data. data_generation.m generate this data and give test.csv and test_save.mat as outputs. In the attached folder, main_test.m is the main file which takes test.csv and test_save.mat as inputs. The default setting is "no bootstrapping" because it would take some time to run. You can change WantBoot=1 to get the bootstrapped standard errors. You can increase the number of repetitions (NReps) to 50 to get stable standard error estimates. To get the histogram of random coefficient 1, use bar(MidEst(1,:),FreqEst(1,:)). Please cite the following papers if you use this code in any form: Bansal, P., Daziano, R. A., & Achtnicht, M. (2018). Extending the logit-mixed logit model for a combination of random and fixed parameters. Journal of choice modelling, 27, 88-96. Bansal, P., Daziano, R. A., & Achtnicht, M. (2018). Comparison of parametric and semiparametric representations of unobserved preference heterogeneity in logit models. Journal of choice modelling, 27, 97-113.
本示例为用于在偏好空间中估计Logit混合Logit模型(Logit-Mixed Logit Model)的MATLAB代码。本示例针对包含2个固定参数、2个随机参数以及3个备择选项的模型构建。本代码是Kenneth Train原有代码的扩展版本,原有代码将所有效用参数视为随机参数,并在支付意愿空间中完成模型估计。 本代码使用模拟生成的数据集。脚本data_generation.m可生成该数据集,并输出test.csv与test_save.mat两个文件。 在附带的文件夹中,main_test.m为主运行文件,其输入为test.csv与test_save.mat。默认设置为"不使用Bootstrap自助法(Bootstrap)",因为该操作需要较长运行时间。若需获取自助法标准误,可将参数WantBoot修改为1;若需获得稳定的标准误估计结果,可将重复次数(NReps)调整至50。 若需绘制随机参数1的直方图,可使用代码bar(MidEst(1,:),FreqEst(1,:))。 若以任何形式使用本代码,请引用以下文献: Bansal, P., Daziano, R. A. 与 Achtnicht, M. (2018). 针对随机与固定参数组合的Logit混合Logit模型扩展. 《选择建模期刊》(Journal of Choice Modelling), 27, 88-96. Bansal, P., Daziano, R. A. 与 Achtnicht, M. (2018). Logit模型中未观测偏好异质性的参数与半参数表征对比. 《选择建模期刊》(Journal of Choice Modelling), 27, 97-113.



