Model run by stephane.hess using Apollo 0.3.5 on R 4.4.0 for Darwin. Please acknowledge the use of Apollo by citing Hess & Palma (2019) DOI 10.1016/j.jocm.2019.100170 www.ApolloChoiceModelling.com Model name : MNL_SP_effects Model description : Simple MNL model on mode choice SP data using effects coding Model run at : 2025-03-10 17:01:25.983109 Estimation method : bgw Model diagnosis : Relative function convergence Optimisation diagnosis : Maximum found hessian properties : Negative definite maximum eigenvalue : -3.30049 reciprocal of condition number : 2.99763e-08 Number of individuals : 500 Number of rows in database : 7000 Number of modelled outcomes : 7000 Number of cores used : 1 Model without mixing LL(start) : -8196.02 LL at equal shares, LL(0) : -8196.02 LL at observed shares, LL(C) : -6706.94 LL(final) : -5598.9 Rho-squared vs equal shares : 0.3169 Adj.Rho-squared vs equal shares : 0.3155 Rho-squared vs observed shares : 0.1652 Adj.Rho-squared vs observed shares : 0.164 AIC : 11219.8 BIC : 11295.19 Estimated parameters : 11 Time taken (hh:mm:ss) : 00:00:0.8 pre-estimation : 00:00:0.16 estimation : 00:00:0.1 post-estimation : 00:00:0.54 Iterations : 9 Unconstrained optimisation. Estimates: Estimate s.e. t.rat.(0) Rob.s.e. Rob.t.rat.(0) asc_car 0.000000 NA NA NA NA asc_bus 0.062408 0.538550 0.1159 0.533037 0.1171 asc_air 0.687314 0.337836 2.0345 0.327752 2.0971 asc_rail -1.032332 0.325719 -3.1694 0.308244 -3.3491 b_tt_car -0.011602 6.5322e-04 -17.7614 6.7831e-04 -17.1044 b_tt_bus -0.017368 0.001452 -11.9630 0.001464 -11.8612 b_tt_air -0.019483 0.002587 -7.5300 0.002475 -7.8717 b_tt_rail -0.006365 0.001704 -3.7350 0.001623 -3.9207 b_access -0.023193 0.002689 -8.6264 0.002645 -8.7676 b_cost -0.058756 0.001487 -39.5176 0.001660 -35.3946 b_wifi 0.488517 0.029550 16.5320 0.030887 15.8164 b_food -0.039479 0.029071 -1.3580 0.029362 -1.3445 Overview of choices for MNL model component : car bus air rail Times available 5446.00 6314.00 5264.00 6118.00 Times chosen 1946.00 358.00 1522.00 3174.00 Percentage chosen overall 27.80 5.11 21.74 45.34 Percentage chosen when available 35.73 5.67 28.91 51.88 Classical covariance matrix: asc_bus asc_air asc_rail b_tt_car b_tt_bus b_tt_air b_tt_rail b_access b_cost b_wifi b_food asc_bus 0.29004 0.03330 0.02760 9.467e-05 -7.1333e-04 -2.329e-05 1.913e-05 -4.894e-05 2.028e-05 -1.6774e-04 -2.438e-05 asc_air 0.03330 0.11413 0.04837 1.2905e-04 3.475e-05 -6.2967e-04 1.262e-05 -5.2869e-04 -9.185e-05 -5.7420e-04 2.7498e-04 asc_rail 0.02760 0.04837 0.10609 1.3551e-04 4.137e-05 -3.181e-05 -4.3063e-04 -4.029e-05 -4.428e-05 -2.595e-05 -2.209e-05 b_tt_car 9.467e-05 1.2905e-04 1.3551e-04 4.267e-07 1.188e-07 -5.668e-08 -4.990e-08 -1.837e-08 2.468e-07 -2.880e-06 -7.697e-08 b_tt_bus -7.1333e-04 3.475e-05 4.137e-05 1.188e-07 2.108e-06 -2.330e-08 -4.995e-08 -9.771e-08 2.528e-07 -2.562e-06 7.274e-08 b_tt_air -2.329e-05 -6.2967e-04 -3.181e-05 -5.668e-08 -2.330e-08 6.695e-06 -2.508e-07 2.329e-06 9.027e-07 -3.915e-07 -2.401e-06 b_tt_rail 1.913e-05 1.262e-05 -4.3063e-04 -4.990e-08 -4.995e-08 -2.508e-07 2.904e-06 -5.919e-07 5.224e-07 -4.945e-06 3.000e-07 b_access -4.894e-05 -5.2869e-04 -4.029e-05 -1.837e-08 -9.771e-08 2.329e-06 -5.919e-07 7.228e-06 6.306e-07 -1.365e-06 -1.417e-06 b_cost 2.028e-05 -9.185e-05 -4.428e-05 2.468e-07 2.528e-07 9.027e-07 5.224e-07 6.306e-07 2.211e-06 -8.793e-06 -8.629e-07 b_wifi -1.6774e-04 -5.7420e-04 -2.595e-05 -2.880e-06 -2.562e-06 -3.915e-07 -4.945e-06 -1.365e-06 -8.793e-06 8.7319e-04 -3.8272e-04 b_food -2.438e-05 2.7498e-04 -2.209e-05 -7.697e-08 7.274e-08 -2.401e-06 3.000e-07 -1.417e-06 -8.629e-07 -3.8272e-04 8.4513e-04 Robust covariance matrix: asc_bus asc_air asc_rail b_tt_car b_tt_bus b_tt_air b_tt_rail b_access b_cost b_wifi b_food asc_bus 0.284129 0.02451 0.01950 8.844e-05 -6.9982e-04 -3.251e-05 4.735e-05 7.429e-05 4.522e-05 -0.002074 0.001355 asc_air 0.024514 0.10742 0.04245 1.3218e-04 6.458e-05 -5.3328e-04 5.304e-05 -5.0095e-04 -8.788e-06 -3.0385e-04 3.0442e-04 asc_rail 0.019495 0.04245 0.09501 1.2911e-04 5.764e-05 2.259e-05 -3.6180e-04 -3.970e-05 1.228e-05 2.6154e-04 -2.5603e-04 b_tt_car 8.844e-05 1.3218e-04 1.2911e-04 4.601e-07 1.752e-07 4.834e-08 6.102e-08 -7.382e-08 3.662e-07 -2.912e-06 -9.480e-07 b_tt_bus -6.9982e-04 6.458e-05 5.764e-05 1.752e-07 2.144e-06 9.818e-08 -1.620e-09 -4.737e-07 2.922e-07 2.416e-06 -4.403e-06 b_tt_air -3.251e-05 -5.3328e-04 2.259e-05 4.834e-08 9.818e-08 6.126e-06 -3.109e-07 1.806e-06 6.893e-07 -3.991e-06 -5.936e-06 b_tt_rail 4.735e-05 5.304e-05 -3.6180e-04 6.102e-08 -1.620e-09 -3.109e-07 2.636e-06 -6.387e-07 4.481e-07 -7.298e-06 7.381e-07 b_access 7.429e-05 -5.0095e-04 -3.970e-05 -7.382e-08 -4.737e-07 1.806e-06 -6.387e-07 6.997e-06 5.627e-07 3.041e-06 -4.803e-06 b_cost 4.522e-05 -8.788e-06 1.228e-05 3.662e-07 2.922e-07 6.893e-07 4.481e-07 5.627e-07 2.756e-06 -3.537e-06 -4.450e-06 b_wifi -0.002074 -3.0385e-04 2.6154e-04 -2.912e-06 2.416e-06 -3.991e-06 -7.298e-06 3.041e-06 -3.537e-06 9.5399e-04 -4.0822e-04 b_food 0.001355 3.0442e-04 -2.5603e-04 -9.480e-07 -4.403e-06 -5.936e-06 7.381e-07 -4.803e-06 -4.450e-06 -4.0822e-04 8.6215e-04 Classical correlation matrix: asc_bus asc_air asc_rail b_tt_car b_tt_bus b_tt_air b_tt_rail b_access b_cost b_wifi b_food asc_bus 1.000000 0.18302 0.157356 0.269105 -0.912310 -0.016717 0.020843 -0.03380 0.02533 -0.010541 -0.001557 asc_air 0.183020 1.00000 0.439588 0.584764 0.070851 -0.720339 0.021915 -0.58207 -0.18286 -0.057518 0.027998 asc_rail 0.157356 0.43959 1.000000 0.636885 0.087491 -0.037750 -0.775828 -0.04601 -0.09144 -0.002696 -0.002333 b_tt_car 0.269105 0.58476 0.636885 1.000000 0.125273 -0.033533 -0.044824 -0.01046 0.25409 -0.149222 -0.004053 b_tt_bus -0.912310 0.07085 0.087491 0.125273 1.000000 -0.006203 -0.020190 -0.02503 0.11710 -0.059727 0.001723 b_tt_air -0.016717 -0.72034 -0.037750 -0.033533 -0.006203 1.000000 -0.056883 0.33475 0.23465 -0.005121 -0.031918 b_tt_rail 0.020843 0.02191 -0.775828 -0.044824 -0.020190 -0.056883 1.000000 -0.12919 0.20618 -0.098205 0.006055 b_access -0.033799 -0.58207 -0.046010 -0.010460 -0.025032 0.334752 -0.129191 1.00000 0.15776 -0.017185 -0.018123 b_cost 0.025331 -0.18286 -0.091442 0.254090 0.117098 0.234654 0.206180 0.15776 1.00000 -0.200132 -0.019962 b_wifi -0.010541 -0.05752 -0.002696 -0.149222 -0.059727 -0.005121 -0.098205 -0.01718 -0.20013 1.000000 -0.445522 b_food -0.001557 0.02800 -0.002333 -0.004053 0.001723 -0.031918 0.006055 -0.01812 -0.01996 -0.445522 1.000000 Robust correlation matrix: asc_bus asc_air asc_rail b_tt_car b_tt_bus b_tt_air b_tt_rail b_access b_cost b_wifi b_food asc_bus 1.00000 0.14032 0.11865 0.24460 -0.89660 -0.02464 0.05471 0.05269 0.05110 -0.12596 0.08656 asc_air 0.14032 1.00000 0.42022 0.59454 0.13457 -0.65738 0.09968 -0.57780 -0.01615 -0.03002 0.03163 asc_rail 0.11865 0.42022 1.00000 0.61748 0.12770 0.02961 -0.72300 -0.04869 0.02400 0.02747 -0.02829 b_tt_car 0.24460 0.59454 0.61748 1.00000 0.17638 0.02880 0.05541 -0.04114 0.32526 -0.13899 -0.04760 b_tt_bus -0.89660 0.13457 0.12770 0.17638 1.00000 0.02709 -6.8167e-04 -0.12230 0.12022 0.05343 -0.10241 b_tt_air -0.02464 -0.65738 0.02961 0.02880 0.02709 1.00000 -0.07738 0.27591 0.16775 -0.05220 -0.08168 b_tt_rail 0.05471 0.09968 -0.72300 0.05541 -6.8167e-04 -0.07738 1.00000 -0.14873 0.16629 -0.14555 0.01548 b_access 0.05269 -0.57780 -0.04869 -0.04114 -0.12230 0.27591 -0.14873 1.00000 0.12814 0.03723 -0.06184 b_cost 0.05110 -0.01615 0.02400 0.32526 0.12022 0.16775 0.16629 0.12814 1.00000 -0.06899 -0.09130 b_wifi -0.12596 -0.03002 0.02747 -0.13899 0.05343 -0.05220 -0.14555 0.03723 -0.06899 1.00000 -0.45013 b_food 0.08656 0.03163 -0.02829 -0.04760 -0.10241 -0.08168 0.01548 -0.06184 -0.09130 -0.45013 1.00000 20 most extreme outliers in terms of lowest average per choice prediction: ID Avg prob per choice 464 0.1815921 272 0.2158480 457 0.2243953 82 0.2251270 151 0.2385036 263 0.2422002 186 0.2425681 196 0.2428431 278 0.2514740 77 0.2541712 147 0.2563694 146 0.2608293 276 0.2617143 293 0.2647152 25 0.2674995 400 0.2683087 369 0.2688814 309 0.2704937 304 0.2708669 446 0.2711953 Changes in parameter estimates from starting values: Initial Estimate Difference asc_car 0.000 0.000000 0.000000 asc_bus 0.000 0.062408 0.062408 asc_air 0.000 0.687314 0.687314 asc_rail 0.000 -1.032332 -1.032332 b_tt_car 0.000 -0.011602 -0.011602 b_tt_bus 0.000 -0.017368 -0.017368 b_tt_air 0.000 -0.019483 -0.019483 b_tt_rail 0.000 -0.006365 -0.006365 b_access 0.000 -0.023193 -0.023193 b_cost 0.000 -0.058756 -0.058756 b_wifi 0.000 0.488517 0.488517 b_food 0.000 -0.039479 -0.039479 Settings and functions used in model definition: apollo_control -------------- Value modelDescr "Simple MNL model on mode choice SP data using effects coding" indivID "ID" outputDirectory "output/" debug "FALSE" modelName "MNL_SP_effects" nCores "1" workInLogs "FALSE" seed "13" mixing "FALSE" HB "FALSE" noValidation "FALSE" noDiagnostics "FALSE" calculateLLC "TRUE" analyticHessian "FALSE" memorySaver "FALSE" panelData "TRUE" analyticGrad "TRUE" analyticGrad_manualSet "FALSE" overridePanel "FALSE" preventOverridePanel "FALSE" noModification "FALSE" Hessian routines attempted -------------------------- numerical jacobian of LL analytical gradient Scaling used in computing Hessian --------------------------------- Value asc_bus 0.062407825 asc_air 0.687314429 asc_rail 1.032331771 b_tt_car 0.011602184 b_tt_bus 0.017368454 b_tt_air 0.019483362 b_tt_rail 0.006364927 b_access 0.023192677 b_cost 0.058755944 b_wifi 0.488517047 b_food 0.039478674 apollo_probabilities ---------------------- function(apollo_beta, apollo_inputs, functionality="estimate"){ ### 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() ### Effects coding constraint b_no_frills = - b_wifi - b_food ### List of utilities: these must use the same names as in mnl_settings, order is irrelevant V = list() V[["car"]] = asc_car + b_tt_car * time_car + b_cost * cost_car V[["bus"]] = asc_bus + b_tt_bus * time_bus + b_access * access_bus + b_cost * cost_bus V[["air"]] = asc_air + b_tt_air * time_air + b_access * access_air + b_cost * cost_air + b_no_frills * ( service_air == 1 ) + b_wifi * ( service_air == 2 ) + b_food * ( service_air == 3 ) V[["rail"]] = asc_rail + b_tt_rail * time_rail + b_access * access_rail + b_cost * cost_rail + b_no_frills * ( service_rail == 1 ) + b_wifi * ( service_rail == 2 ) + b_food * ( service_rail == 3 ) ### Define settings for MNL model component mnl_settings = list( alternatives = c(car=1, bus=2, air=3, rail=4), avail = list(car=av_car, bus=av_bus, air=av_air, rail=av_rail), choiceVar = choice, utilities = 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) ### Prepare and return outputs of function P = apollo_prepareProb(P, apollo_inputs, functionality) return(P) }