Model run by stephane.hess using Apollo 0.3.4 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 Model description : Simple MNL model on mode choice SP data Model run at : 2024-09-27 15:14:35.432499 Estimation method : bgw Model diagnosis : Relative function convergence Optimisation diagnosis : Maximum found hessian properties : Negative definite maximum eigenvalue : -3.296391 reciprocal of condition number : 2.9939e-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.77 pre-estimation : 00:00:0.17 estimation : 00:00:0.11 post-estimation : 00:00:0.49 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.062410 0.538550 0.1159 0.533037 0.1171 asc_air 0.238276 0.340124 0.7006 0.329272 0.7236 asc_rail -1.481369 0.327325 -4.5257 0.309844 -4.7810 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_no_frills 0.000000 NA NA NA NA b_wifi 0.937555 0.052981 17.6961 0.055184 16.9898 b_food 0.409560 0.052180 7.8489 0.052628 7.7822 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 asc_bus 0.29004 0.033491 0.027795 9.467e-05 -7.1333e-04 asc_air 0.03349 0.115685 0.049672 1.3200e-04 3.724e-05 asc_rail 0.02779 0.049672 0.107142 1.3847e-04 4.386e-05 b_tt_car 9.467e-05 1.3200e-04 1.3847e-04 4.267e-07 1.188e-07 b_tt_bus -7.1333e-04 3.724e-05 4.386e-05 1.188e-07 2.108e-06 b_tt_air -2.329e-05 -6.2688e-04 -2.902e-05 -5.668e-08 -2.330e-08 b_tt_rail 1.913e-05 1.726e-05 -4.2599e-04 -4.990e-08 -4.995e-08 b_access -4.894e-05 -5.2591e-04 -3.751e-05 -1.837e-08 -9.771e-08 b_cost 2.028e-05 -8.220e-05 -3.463e-05 2.468e-07 2.528e-07 b_wifi -3.5986e-04 -0.002317 -0.001517 -5.838e-06 -5.052e-06 b_food -2.1650e-04 -0.001440 -0.001485 -3.034e-06 -2.417e-06 b_tt_air b_tt_rail b_access b_cost b_wifi asc_bus -2.329e-05 1.913e-05 -4.894e-05 2.028e-05 -3.5986e-04 asc_air -6.2688e-04 1.726e-05 -5.2591e-04 -8.220e-05 -0.002317 asc_rail -2.902e-05 -4.2599e-04 -3.751e-05 -3.463e-05 -0.001517 b_tt_car -5.668e-08 -4.990e-08 -1.837e-08 2.468e-07 -5.838e-06 b_tt_bus -2.330e-08 -4.995e-08 -9.771e-08 2.528e-07 -5.052e-06 b_tt_air 6.695e-06 -2.508e-07 2.329e-06 9.027e-07 -3.184e-06 b_tt_rail -2.508e-07 2.904e-06 -5.919e-07 5.224e-07 -9.591e-06 b_access 2.329e-06 -5.919e-07 7.228e-06 6.306e-07 -4.147e-06 b_cost 9.027e-07 5.224e-07 6.306e-07 2.211e-06 -1.845e-05 b_wifi -3.184e-06 -9.591e-06 -4.147e-06 -1.845e-05 0.002807 b_food -5.193e-06 -4.345e-06 -4.198e-06 -1.052e-05 0.001523 b_food asc_bus -2.1650e-04 asc_air -0.001440 asc_rail -0.001485 b_tt_car -3.034e-06 b_tt_bus -2.417e-06 b_tt_air -5.193e-06 b_tt_rail -4.345e-06 b_access -4.198e-06 b_cost -1.052e-05 b_wifi 0.001523 b_food 0.002723 Robust covariance matrix: asc_bus asc_air asc_rail b_tt_car b_tt_bus asc_bus 0.284129 0.025233 0.020214 8.844e-05 -6.9982e-04 asc_air 0.025233 0.108420 0.043448 1.3604e-04 6.657e-05 asc_rail 0.020214 0.043448 0.096003 1.3297e-04 5.963e-05 b_tt_car 8.844e-05 1.3604e-04 1.3297e-04 4.601e-07 1.752e-07 b_tt_bus -6.9982e-04 6.657e-05 5.963e-05 1.752e-07 2.144e-06 b_tt_air -3.251e-05 -5.2336e-04 3.252e-05 4.834e-08 9.818e-08 b_tt_rail 4.735e-05 5.960e-05 -3.5524e-04 6.102e-08 -1.620e-09 b_access 7.429e-05 -4.9919e-04 -3.794e-05 -7.382e-08 -4.737e-07 b_cost 4.522e-05 -8.011e-07 2.027e-05 3.662e-07 2.922e-07 b_wifi -0.002793 -0.001849 -0.001278 -6.772e-06 4.299e-07 b_food 6.3583e-04 -0.001149 -0.001704 -4.808e-06 -6.390e-06 b_tt_air b_tt_rail b_access b_cost b_wifi asc_bus -3.251e-05 4.735e-05 7.429e-05 4.522e-05 -0.002793 asc_air -5.2336e-04 5.960e-05 -4.9919e-04 -8.011e-07 -0.001849 asc_rail 3.252e-05 -3.5524e-04 -3.794e-05 2.027e-05 -0.001278 b_tt_car 4.834e-08 6.102e-08 -7.382e-08 3.662e-07 -6.772e-06 b_tt_bus 9.818e-08 -1.620e-09 -4.737e-07 2.922e-07 4.299e-07 b_tt_air 6.126e-06 -3.109e-07 1.806e-06 6.893e-07 -1.392e-05 b_tt_rail -3.109e-07 2.636e-06 -6.387e-07 4.481e-07 -1.386e-05 b_access 1.806e-06 -6.387e-07 6.997e-06 5.627e-07 1.280e-06 b_cost 6.893e-07 4.481e-07 5.627e-07 2.756e-06 -1.152e-05 b_wifi -1.392e-05 -1.386e-05 1.280e-06 -1.152e-05 0.003045 b_food -1.586e-05 -5.822e-06 -6.565e-06 -1.244e-05 0.001591 b_food asc_bus 6.3583e-04 asc_air -0.001149 asc_rail -0.001704 b_tt_car -4.808e-06 b_tt_bus -6.390e-06 b_tt_air -1.586e-05 b_tt_rail -5.822e-06 b_access -6.565e-06 b_cost -1.244e-05 b_wifi 0.001591 b_food 0.002770 Classical correlation matrix: asc_bus asc_air asc_rail b_tt_car b_tt_bus asc_bus 1.000000 0.18284 0.15767 0.26910 -0.912310 asc_air 0.182838 1.00000 0.44617 0.59414 0.075416 asc_rail 0.157673 0.44617 1.00000 0.64759 0.092300 b_tt_car 0.269105 0.59414 0.64759 1.00000 0.125273 b_tt_bus -0.912310 0.07542 0.09230 0.12527 1.000000 b_tt_air -0.016717 -0.71232 -0.03427 -0.03353 -0.006203 b_tt_rail 0.020843 0.02978 -0.76369 -0.04482 -0.020190 b_access -0.033799 -0.57511 -0.04262 -0.01046 -0.025032 b_cost 0.025331 -0.16254 -0.07115 0.25409 0.117098 b_wifi -0.012612 -0.12856 -0.08749 -0.16868 -0.065679 b_food -0.007704 -0.08111 -0.08697 -0.08902 -0.031903 b_tt_air b_tt_rail b_access b_cost b_wifi asc_bus -0.016717 0.02084 -0.03380 0.02533 -0.01261 asc_air -0.712320 0.02978 -0.57511 -0.16254 -0.12856 asc_rail -0.034267 -0.76369 -0.04262 -0.07115 -0.08749 b_tt_car -0.033533 -0.04482 -0.01046 0.25409 -0.16868 b_tt_bus -0.006203 -0.02019 -0.02503 0.11710 -0.06568 b_tt_air 1.000000 -0.05688 0.33475 0.23465 -0.02323 b_tt_rail -0.056883 1.00000 -0.12919 0.20618 -0.10622 b_access 0.334752 -0.12919 1.00000 0.15776 -0.02911 b_cost 0.234654 0.20618 0.15776 1.00000 -0.23420 b_wifi -0.023226 -0.10622 -0.02911 -0.23420 1.00000 b_food -0.038465 -0.04887 -0.02993 -0.13558 0.55090 b_food asc_bus -0.007704 asc_air -0.081109 asc_rail -0.086968 b_tt_car -0.089021 b_tt_bus -0.031903 b_tt_air -0.038465 b_tt_rail -0.048867 b_access -0.029926 b_cost -0.135578 b_wifi 0.550904 b_food 1.000000 Robust correlation matrix: asc_bus asc_air asc_rail b_tt_car b_tt_bus asc_bus 1.00000 0.143765 0.12239 0.24460 -0.896598 asc_air 0.14377 1.000000 0.42586 0.60907 0.138067 asc_rail 0.12239 0.425861 1.00000 0.63265 0.131421 b_tt_car 0.24460 0.609074 0.63265 1.00000 0.176385 b_tt_bus -0.89660 0.138067 0.13142 0.17638 1.000000 b_tt_air -0.02464 -0.642170 0.04240 0.02880 0.027090 b_tt_rail 0.05471 0.111490 -0.70623 0.05541 -6.8166e-04 b_access 0.05269 -0.573112 -0.04629 -0.04114 -0.122295 b_cost 0.05110 -0.001466 0.03941 0.32526 0.120219 b_wifi -0.09494 -0.101745 -0.07477 -0.18091 0.005320 b_food 0.02267 -0.066284 -0.10451 -0.13468 -0.082912 b_tt_air b_tt_rail b_access b_cost b_wifi asc_bus -0.02464 0.05471 0.052688 0.051103 -0.094943 asc_air -0.64217 0.11149 -0.573112 -0.001466 -0.101745 asc_rail 0.04240 -0.70623 -0.046290 0.039408 -0.074769 b_tt_car 0.02880 0.05541 -0.041139 0.325261 -0.180911 b_tt_bus 0.02709 -6.8166e-04 -0.122295 0.120219 0.005320 b_tt_air 1.00000 -0.07738 0.275910 0.167754 -0.101894 b_tt_rail -0.07738 1.00000 -0.148730 0.166293 -0.154689 b_access 0.27591 -0.14873 1.000000 0.128137 0.008766 b_cost 0.16775 0.16629 0.128137 1.000000 -0.125803 b_wifi -0.10189 -0.15469 0.008766 -0.125803 1.000000 b_food -0.12178 -0.06814 -0.047158 -0.142360 0.547886 b_food asc_bus 0.02267 asc_air -0.06628 asc_rail -0.10451 b_tt_car -0.13468 b_tt_bus -0.08291 b_tt_air -0.12178 b_tt_rail -0.06814 b_access -0.04716 b_cost -0.14236 b_wifi 0.54789 b_food 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.2243954 82 0.2251270 151 0.2385036 263 0.2422002 186 0.2425681 196 0.2428432 278 0.2514740 77 0.2541713 147 0.2563694 146 0.2608293 276 0.2617144 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.062410 0.062410 asc_air 0.000 0.238276 0.238276 asc_rail 0.000 -1.481369 -1.481369 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_no_frills 0.000 0.000000 0.000000 b_wifi 0.000 0.937555 0.937555 b_food 0.000 0.409560 0.409560 Settings and functions used in model definition: apollo_control -------------- Value modelName "MNL_SP" modelDescr "Simple MNL model on mode choice SP data" indivID "ID" outputDirectory "output/" debug "FALSE" 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.062410464 asc_air 0.238276270 asc_rail 1.481369438 b_tt_car 0.011602184 b_tt_bus 0.017368460 b_tt_air 0.019483364 b_tt_rail 0.006364931 b_access 0.023192675 b_cost 0.058755940 b_wifi 0.937555475 b_food 0.409559747 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() ### 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) }