Model run using Apollo for R, version 0.2.3 on Darwin by stephane.hess www.ApolloChoiceModelling.com Model name : Apollo_example_15 Model description : Mixed logit model on Swiss route choice data, correlated Lognormals in utility space Model run at : 2021-02-04 18:24:16 Estimation method : bfgs Model diagnosis : successful convergence Number of individuals : 388 Number of rows in database : 3492 Number of modelled outcomes : 3492 Number of cores used : 4 Number of inter-individual draws : 500 (halton) LL(start) : -1437.356 LL(0) : -2420.47 LL(final) : -1405.156 Rho-square (0) : 0.4195 Adj.Rho-square (0) : 0.4137 AIC : 2838.31 BIC : 2924.53 Estimated parameters : 14 Time taken (hh:mm:ss) : 00:03:31.86 pre-estimation : 00:00:33.98 estimation : 00:01:13.83 post-estimation : 00:01:44.05 Iterations : 39 Min abs eigenvalue of Hessian : 4.73265 Estimates: Estimate s.e. t.rat.(0) Rob.s.e. Rob.t.rat.(0) mu_log_b_tt -1.36922 0.16453 -8.322 0.19202 -7.131 sigma_log_b_tt 1.41493 0.19353 7.311 0.22369 6.325 mu_log_b_tc -0.52411 0.17673 -2.965 0.20544 -2.551 sigma_log_b_tt_tc 1.78302 0.19478 9.154 0.22233 8.020 sigma_log_b_tc 0.88920 0.02903 30.625 0.01992 44.644 mu_log_b_hw -2.33538 0.15944 -14.648 0.18092 -12.908 sigma_log_b_tt_hw 0.80757 0.18564 4.350 0.20865 3.870 sigma_log_b_tc_hw 0.23667 0.07087 3.340 0.05301 4.465 sigma_log_b_hw 1.03117 0.05085 20.277 0.04308 23.938 mu_log_b_ch 1.19901 0.15995 7.496 0.18221 6.581 sigma_log_b_tt_ch 1.22129 0.19701 6.199 0.22835 5.348 sigma_log_b_tc_ch 0.04252 0.03260 1.304 0.02140 1.987 sigma_log_b_hw_ch 0.55462 0.04750 11.675 0.04182 13.262 sigma_log_b_ch 0.74359 0.05342 13.920 0.04145 17.941 Overview of choices for MNL model component : alt1 alt2 Times available 3492.00 3492.00 Times chosen 1734.00 1758.00 Percentage chosen overall 49.66 50.34 Percentage chosen when available 49.66 50.34 Classical covariance matrix: mu_log_b_tt sigma_log_b_tt mu_log_b_tc sigma_log_b_tt_tc sigma_log_b_tc mu_log_b_tt 0.027069 0.021003 0.027622 0.021132 4.4361e-04 sigma_log_b_tt 0.021003 0.037453 0.021902 0.037380 2.2380e-04 mu_log_b_tc 0.027622 0.021902 0.031235 0.020817 3.388e-05 sigma_log_b_tt_tc 0.021132 0.037380 0.020817 0.037940 3.1455e-04 sigma_log_b_tc 4.4361e-04 2.2380e-04 3.388e-05 3.1455e-04 8.4303e-04 mu_log_b_hw 0.021536 0.022431 0.022717 0.022123 1.0138e-04 sigma_log_b_tt_hw 0.021256 0.034341 0.021250 0.034415 7.1251e-04 sigma_log_b_tc_hw -8.246e-05 -7.8718e-04 -5.7892e-04 -5.6194e-04 9.4981e-04 sigma_log_b_hw 0.002649 0.002080 0.003442 0.001979 -2.2169e-04 mu_log_b_ch 0.023784 0.021538 0.025456 0.021003 2.0440e-04 sigma_log_b_tt_ch 0.022596 0.037318 0.022687 0.037811 5.5153e-04 sigma_log_b_tc_ch -1.529e-05 -3.0430e-04 -2.7899e-04 -1.007e-05 1.0755e-04 sigma_log_b_hw_ch 0.001472 0.001756 0.001863 0.001798 -3.4492e-04 sigma_log_b_ch 8.6090e-04 0.001055 0.001071 7.2859e-04 9.2385e-04 mu_log_b_hw sigma_log_b_tt_hw sigma_log_b_tc_hw sigma_log_b_hw mu_log_b_ch mu_log_b_tt 0.021536 0.021256 -8.246e-05 0.002649 0.023784 sigma_log_b_tt 0.022431 0.034341 -7.8718e-04 0.002080 0.021538 mu_log_b_tc 0.022717 0.021250 -5.7892e-04 0.003442 0.025456 sigma_log_b_tt_tc 0.022123 0.034415 -5.6194e-04 0.001979 0.021003 sigma_log_b_tc 1.0138e-04 7.1251e-04 9.4981e-04 -2.2169e-04 2.0440e-04 mu_log_b_hw 0.025421 0.019822 -0.001702 9.2430e-04 0.021739 sigma_log_b_tt_hw 0.019822 0.034463 -1.7245e-04 0.001108 0.020814 sigma_log_b_tc_hw -0.001702 -1.7245e-04 0.005022 -0.001295 -2.7122e-04 sigma_log_b_hw 9.2430e-04 0.001108 -0.001295 0.002586 0.002043 mu_log_b_ch 0.021739 0.020814 -2.7122e-04 0.002043 0.025584 sigma_log_b_tt_ch 0.022204 0.034590 -6.684e-05 0.002298 0.020818 sigma_log_b_tc_ch -6.834e-07 -3.9878e-04 -5.4743e-04 2.5074e-04 -4.6754e-04 sigma_log_b_hw_ch 0.001672 8.9162e-04 -0.001504 0.001189 0.001066 sigma_log_b_ch 5.3710e-04 0.001121 0.001136 -1.0575e-04 7.7617e-04 sigma_log_b_tt_ch sigma_log_b_tc_ch sigma_log_b_hw_ch sigma_log_b_ch mu_log_b_tt 0.022596 -1.529e-05 0.001472 8.6090e-04 sigma_log_b_tt 0.037318 -3.0430e-04 0.001756 0.001055 mu_log_b_tc 0.022687 -2.7899e-04 0.001863 0.001071 sigma_log_b_tt_tc 0.037811 -1.007e-05 0.001798 7.2859e-04 sigma_log_b_tc 5.5153e-04 1.0755e-04 -3.4492e-04 9.2385e-04 mu_log_b_hw 0.022204 -6.834e-07 0.001672 5.3710e-04 sigma_log_b_tt_hw 0.034590 -3.9878e-04 8.9162e-04 0.001121 sigma_log_b_tc_hw -6.684e-05 -5.4743e-04 -0.001504 0.001136 sigma_log_b_hw 0.002298 2.5074e-04 0.001189 -1.0575e-04 mu_log_b_ch 0.020818 -4.6754e-04 0.001066 7.7617e-04 sigma_log_b_tt_ch 0.038812 1.2197e-04 0.001537 9.5782e-04 sigma_log_b_tc_ch 1.2197e-04 0.001063 2.6161e-04 -7.8566e-04 sigma_log_b_hw_ch 0.001537 2.6161e-04 0.002257 -7.3230e-04 sigma_log_b_ch 9.5782e-04 -7.8566e-04 -7.3230e-04 0.002853 Robust covariance matrix: mu_log_b_tt sigma_log_b_tt mu_log_b_tc sigma_log_b_tt_tc sigma_log_b_tc mu_log_b_tt 0.036872 0.033523 0.038587 0.033581 7.6347e-04 sigma_log_b_tt 0.033523 0.050037 0.036471 0.049570 5.3022e-04 mu_log_b_tc 0.038587 0.036471 0.042207 0.035835 4.8104e-04 sigma_log_b_tt_tc 0.033581 0.049570 0.035835 0.049432 6.1487e-04 sigma_log_b_tc 7.6347e-04 5.3022e-04 4.8104e-04 6.1487e-04 3.9670e-04 mu_log_b_hw 0.030878 0.032639 0.033321 0.032211 2.3680e-04 sigma_log_b_tt_hw 0.031923 0.045775 0.033862 0.045550 8.3098e-04 sigma_log_b_tc_hw -7.0490e-04 -0.001749 -0.001426 -0.001624 6.9790e-04 sigma_log_b_hw 0.004842 0.004891 0.005748 0.004815 -1.1743e-04 mu_log_b_ch 0.032996 0.032006 0.035928 0.031303 3.1858e-04 sigma_log_b_tt_ch 0.035300 0.050571 0.037512 0.050541 7.9073e-04 sigma_log_b_tc_ch 3.8711e-04 6.492e-06 2.3989e-04 2.0463e-04 -1.0746e-04 sigma_log_b_hw_ch 0.003942 0.004590 0.004652 0.004610 -1.8428e-04 sigma_log_b_ch 0.001325 0.001738 0.001436 0.001552 6.5902e-04 mu_log_b_hw sigma_log_b_tt_hw sigma_log_b_tc_hw sigma_log_b_hw mu_log_b_ch mu_log_b_tt 0.030878 0.031923 -7.0490e-04 0.004842 0.032996 sigma_log_b_tt 0.032639 0.045775 -0.001749 0.004891 0.032006 mu_log_b_tc 0.033321 0.033862 -0.001426 0.005748 0.035928 sigma_log_b_tt_tc 0.032211 0.045550 -0.001624 0.004815 0.031303 sigma_log_b_tc 2.3680e-04 8.3098e-04 6.9790e-04 -1.1743e-04 3.1858e-04 mu_log_b_hw 0.032733 0.028614 -0.002349 0.003480 0.029380 sigma_log_b_tt_hw 0.028614 0.043534 -5.7991e-04 0.004037 0.030093 sigma_log_b_tc_hw -0.002349 -5.7991e-04 0.002810 -0.001029 -8.5937e-04 sigma_log_b_hw 0.003480 0.004037 -0.001029 0.001856 0.004049 mu_log_b_ch 0.029380 0.030093 -8.5937e-04 0.004049 0.033199 sigma_log_b_tt_ch 0.033073 0.046513 -0.001441 0.005229 0.031806 sigma_log_b_tc_ch 2.6811e-04 -1.7771e-04 -6.9321e-04 4.1698e-04 -2.7941e-04 sigma_log_b_hw_ch 0.003731 0.003689 -0.001296 0.001378 0.003168 sigma_log_b_ch 0.001082 0.001833 0.001269 -1.8370e-04 0.001224 sigma_log_b_tt_ch sigma_log_b_tc_ch sigma_log_b_hw_ch sigma_log_b_ch mu_log_b_tt 0.035300 3.8711e-04 0.003942 0.001325 sigma_log_b_tt 0.050571 6.492e-06 0.004590 0.001738 mu_log_b_tc 0.037512 2.3989e-04 0.004652 0.001436 sigma_log_b_tt_tc 0.050541 2.0463e-04 0.004610 0.001552 sigma_log_b_tc 7.9073e-04 -1.0746e-04 -1.8428e-04 6.5902e-04 mu_log_b_hw 0.033073 2.6811e-04 0.003731 0.001082 sigma_log_b_tt_hw 0.046513 -1.7771e-04 0.003689 0.001833 sigma_log_b_tc_hw -0.001441 -6.9321e-04 -0.001296 0.001269 sigma_log_b_hw 0.005229 4.1698e-04 0.001378 -1.8370e-04 mu_log_b_ch 0.031806 -2.7941e-04 0.003168 0.001224 sigma_log_b_tt_ch 0.052145 3.3281e-04 0.004830 0.001802 sigma_log_b_tc_ch 3.3281e-04 4.5814e-04 5.5567e-04 -5.5168e-04 sigma_log_b_hw_ch 0.004830 5.5567e-04 0.001749 -6.0357e-04 sigma_log_b_ch 0.001802 -5.5168e-04 -6.0357e-04 0.001718 Classical correlation matrix: mu_log_b_tt sigma_log_b_tt mu_log_b_tc sigma_log_b_tt_tc sigma_log_b_tc mu_log_b_tt 1.000000 0.65964 0.949933 0.659411 0.092863 sigma_log_b_tt 0.659636 1.00000 0.640342 0.991618 0.039828 mu_log_b_tc 0.949933 0.64034 1.000000 0.604715 0.006603 sigma_log_b_tt_tc 0.659411 0.99162 0.604715 1.000000 0.055619 sigma_log_b_tc 0.092863 0.03983 0.006603 0.055619 1.000000 mu_log_b_hw 0.820999 0.72697 0.806201 0.712369 0.021900 sigma_log_b_tt_hw 0.695934 0.95586 0.647672 0.951741 0.132187 sigma_log_b_tc_hw -0.007073 -0.05740 -0.046223 -0.040710 0.461611 sigma_log_b_hw 0.316578 0.21135 0.382937 0.199798 -0.150145 mu_log_b_ch 0.903787 0.69578 0.900518 0.674132 0.044013 sigma_log_b_tt_ch 0.697140 0.97880 0.651585 0.985356 0.096421 sigma_log_b_tc_ch -0.002851 -0.04823 -0.048418 -0.001585 0.113609 sigma_log_b_hw_ch 0.188288 0.19097 0.221863 0.194298 -0.250072 sigma_log_b_ch 0.097956 0.10209 0.113415 0.070024 0.595653 mu_log_b_hw sigma_log_b_tt_hw sigma_log_b_tc_hw sigma_log_b_hw mu_log_b_ch mu_log_b_tt 0.82100 0.69593 -0.007073 0.31658 0.90379 sigma_log_b_tt 0.72697 0.95586 -0.057397 0.21135 0.69578 mu_log_b_tc 0.80620 0.64767 -0.046223 0.38294 0.90052 sigma_log_b_tt_tc 0.71237 0.95174 -0.040710 0.19980 0.67413 sigma_log_b_tc 0.02190 0.13219 0.461611 -0.15014 0.04401 mu_log_b_hw 1.00000 0.66968 -0.150652 0.11400 0.85244 sigma_log_b_tt_hw 0.66968 1.00000 -0.013108 0.11732 0.70098 sigma_log_b_tc_hw -0.15065 -0.01311 1.000000 -0.35944 -0.02393 sigma_log_b_hw 0.11400 0.11732 -0.359439 1.00000 0.25119 mu_log_b_ch 0.85244 0.70098 -0.023928 0.25119 1.00000 sigma_log_b_tt_ch 0.70690 0.94579 -0.004788 0.22936 0.66065 sigma_log_b_tc_ch -1.3147e-04 -0.06589 -0.236935 0.15123 -0.08965 sigma_log_b_hw_ch 0.22079 0.10110 -0.446645 0.49236 0.14029 sigma_log_b_ch 0.06306 0.11303 0.300048 -0.03893 0.09084 sigma_log_b_tt_ch sigma_log_b_tc_ch sigma_log_b_hw_ch sigma_log_b_ch mu_log_b_tt 0.697140 -0.002851 0.1883 0.09796 sigma_log_b_tt 0.978799 -0.048227 0.1910 0.10209 mu_log_b_tc 0.651585 -0.048418 0.2219 0.11342 sigma_log_b_tt_tc 0.985356 -0.001585 0.1943 0.07002 sigma_log_b_tc 0.096421 0.113609 -0.2501 0.59565 mu_log_b_hw 0.706901 -1.3147e-04 0.2208 0.06306 sigma_log_b_tt_hw 0.945795 -0.065885 0.1011 0.11303 sigma_log_b_tc_hw -0.004788 -0.236935 -0.4466 0.30005 sigma_log_b_hw 0.229364 0.151230 0.4924 -0.03893 mu_log_b_ch 0.660652 -0.089654 0.1403 0.09084 sigma_log_b_tt_ch 1.000000 0.018990 0.1643 0.09102 sigma_log_b_tc_ch 0.018990 1.000000 0.1689 -0.45111 sigma_log_b_hw_ch 0.164267 0.168911 1.0000 -0.28858 sigma_log_b_ch 0.091015 -0.451115 -0.2886 1.00000 Robust correlation matrix: mu_log_b_tt sigma_log_b_tt mu_log_b_tc sigma_log_b_tt_tc sigma_log_b_tc mu_log_b_tt 1.00000 0.780443 0.97814 0.78657 0.19962 sigma_log_b_tt 0.78044 1.000000 0.79361 0.99671 0.11901 mu_log_b_tc 0.97814 0.793610 1.00000 0.78454 0.11756 sigma_log_b_tt_tc 0.78657 0.996709 0.78454 1.00000 0.13885 sigma_log_b_tc 0.19962 0.119009 0.11756 0.13885 1.00000 mu_log_b_hw 0.88881 0.806493 0.89645 0.80077 0.06571 sigma_log_b_tt_hw 0.79677 0.980778 0.78996 0.98191 0.19996 sigma_log_b_tc_hw -0.06925 -0.147532 -0.13096 -0.13777 0.66101 sigma_log_b_hw 0.58532 0.507537 0.64952 0.50276 -0.13687 mu_log_b_ch 0.94308 0.785270 0.95980 0.77271 0.08779 sigma_log_b_tt_ch 0.80504 0.990035 0.79959 0.99549 0.17385 sigma_log_b_tc_ch 0.09419 0.001356 0.05455 0.04300 -0.25208 sigma_log_b_hw_ch 0.49091 0.490670 0.54144 0.49581 -0.22123 sigma_log_b_ch 0.16643 0.187447 0.16865 0.16837 0.79831 mu_log_b_hw sigma_log_b_tt_hw sigma_log_b_tc_hw sigma_log_b_hw mu_log_b_ch mu_log_b_tt 0.88881 0.79677 -0.06925 0.5853 0.94308 sigma_log_b_tt 0.80649 0.98078 -0.14753 0.5075 0.78527 mu_log_b_tc 0.89645 0.78996 -0.13096 0.6495 0.95980 sigma_log_b_tt_tc 0.80077 0.98191 -0.13777 0.5028 0.77271 sigma_log_b_tc 0.06571 0.19996 0.66101 -0.1369 0.08779 mu_log_b_hw 1.00000 0.75801 -0.24494 0.4465 0.89125 sigma_log_b_tt_hw 0.75801 1.00000 -0.05243 0.4491 0.79157 sigma_log_b_tc_hw -0.24494 -0.05243 1.00000 -0.4507 -0.08898 sigma_log_b_hw 0.44653 0.44914 -0.45068 1.0000 0.51588 mu_log_b_ch 0.89125 0.79157 -0.08898 0.5159 1.00000 sigma_log_b_tt_ch 0.80052 0.97623 -0.11905 0.5316 0.76444 sigma_log_b_tc_ch 0.06923 -0.03979 -0.61096 0.4522 -0.07164 sigma_log_b_hw_ch 0.49312 0.42277 -0.58475 0.7652 0.41569 sigma_log_b_ch 0.14433 0.21195 0.57743 -0.1029 0.16212 sigma_log_b_tt_ch sigma_log_b_tc_ch sigma_log_b_hw_ch sigma_log_b_ch mu_log_b_tt 0.80504 0.094186 0.4909 0.1664 sigma_log_b_tt 0.99003 0.001356 0.4907 0.1874 mu_log_b_tc 0.79959 0.054553 0.5414 0.1686 sigma_log_b_tt_tc 0.99549 0.042999 0.4958 0.1684 sigma_log_b_tc 0.17385 -0.252076 -0.2212 0.7983 mu_log_b_hw 0.80052 0.069233 0.4931 0.1443 sigma_log_b_tt_hw 0.97623 -0.039792 0.4228 0.2120 sigma_log_b_tc_hw -0.11905 -0.610957 -0.5847 0.5774 sigma_log_b_hw 0.53159 0.452239 0.7652 -0.1029 mu_log_b_ch 0.76444 -0.071644 0.4157 0.1621 sigma_log_b_tt_ch 1.00000 0.068090 0.5058 0.1904 sigma_log_b_tc_ch 0.06809 1.000000 0.6208 -0.6219 sigma_log_b_hw_ch 0.50576 0.620768 1.0000 -0.3482 sigma_log_b_ch 0.19042 -0.621870 -0.3482 1.0000 20 worst outliers in terms of lowest average per choice prediction: ID Avg prob per choice 22580 0.3423307 23205 0.3431890 15174 0.3508250 16178 0.3565066 16617 0.3707317 76862 0.3732912 16489 0.3754532 21623 0.3812720 22961 0.3906268 15056 0.3917737 21922 0.3974964 20100 0.3996540 22820 0.4014179 17187 0.4038516 15312 0.4081757 16184 0.4084860 12534 0.4144599 17645 0.4169993 24627 0.4222895 20352 0.4243901 Changes in parameter estimates from starting values: Initial Estimate Difference mu_log_b_tt -1.9850 -1.36922 0.61581 sigma_log_b_tt 0.4740 1.41493 0.94092 mu_log_b_tc -1.0228 -0.52411 0.49871 sigma_log_b_tt_tc 0.1000 1.78302 1.68302 sigma_log_b_tc 1.0032 0.88920 -0.11400 mu_log_b_hw -2.9325 -2.33538 0.59716 sigma_log_b_tt_hw 0.1000 0.80757 0.70757 sigma_log_b_tc_hw 0.1000 0.23667 0.13667 sigma_log_b_hw 0.8046 1.03117 0.22659 mu_log_b_ch 0.6278 1.19901 0.57124 sigma_log_b_tt_ch 0.1000 1.22129 1.12129 sigma_log_b_tc_ch 0.1000 0.04252 -0.05748 sigma_log_b_hw_ch 0.1000 0.55462 0.45462 sigma_log_b_ch 0.8456 0.74359 -0.10205 Settings and functions used in model definition: apollo_control -------------- Value modelName "Apollo_example_15" modelDescr "Mixed logit model on Swiss route choice data, correlated Lognormals in utility space" indivID "ID" mixing "TRUE" nCores "4" debug "FALSE" workInLogs "FALSE" seed "13" HB "FALSE" noValidation "FALSE" noDiagnostics "FALSE" panelData "TRUE" analyticGrad "TRUE" Hessian routines attempted -------------- numerical jacobian of LL analytical gradient Scaling used in computing Hessian -------------- Value mu_log_b_tt 1.36921754 sigma_log_b_tt 1.41493434 mu_log_b_tc 0.52410660 sigma_log_b_tt_tc 1.78302484 sigma_log_b_tc 0.88919515 mu_log_b_hw 2.33538434 sigma_log_b_tt_hw 0.80756707 sigma_log_b_tc_hw 0.23666646 sigma_log_b_hw 1.03117468 mu_log_b_ch 1.19901245 sigma_log_b_tt_ch 1.22129166 sigma_log_b_tc_ch 0.04252151 sigma_log_b_hw_ch 0.55461776 sigma_log_b_ch 0.74358701 apollo_randCoeff ---------------- function(apollo_beta, apollo_inputs){ randcoeff = list() randcoeff[["b_tt"]] = -exp( mu_log_b_tt + sigma_log_b_tt * draws_tt ) randcoeff[["b_tc"]] = -exp( mu_log_b_tc + sigma_log_b_tt_tc * draws_tt + sigma_log_b_tc * draws_tc ) randcoeff[["b_hw"]] = -exp( mu_log_b_hw + sigma_log_b_tt_hw * draws_tt + sigma_log_b_tc_hw * draws_tc + sigma_log_b_hw * draws_hw ) randcoeff[["b_ch"]] = -exp( mu_log_b_ch + sigma_log_b_tt_ch * draws_tt + sigma_log_b_tc_ch * draws_tc + sigma_log_b_hw_ch * draws_hw + sigma_log_b_ch * draws_ch ) return(randcoeff) apollo_probabilities -------------------- function(apollo_beta, apollo_inputs, functionality="estimate"){ ### Function initialisation: do not change the following three commands ### Attach inputs and detach after function exit apollo_attach(apollo_beta, apollo_inputs) on.exit(apollo_detach(apollo_beta, apollo_inputs)) ### Create list of probabilities P P = list() ### List of utilities: these must use the same names as in mnl_settings, order is irrelevant V = list() V[['alt1']] = b_tt * tt1 + b_tc * tc1 + b_hw * hw1 + b_ch * ch1 V[['alt2']] = b_tt * tt2 + b_tc * tc2 + b_hw * hw2 + b_ch * ch2 ### Define settings for MNL model component mnl_settings = list( alternatives = c(alt1=1, alt2=2), avail = list(alt1=1, alt2=1), choiceVar = choice, V = V ) ### Compute probabilities using MNL model P[['model']] = apollo_mnl(mnl_settings, functionality) ### Take product across observation for same individual P = apollo_panelProd(P, apollo_inputs, functionality) ### Average across inter-individual draws P = apollo_avgInterDraws(P, apollo_inputs, functionality) ### Prepare and return outputs of function P = apollo_prepareProb(P, apollo_inputs, functionality) return(P)