Model run by stephane.hess using Apollo 0.2.9 on R 4.0.5 for Darwin. www.ApolloChoiceModelling.com Model name : MNL_SP Model description : Simple MNL model on mode choice SP data Model run at : 2023-05-10 19:49:17 Estimation method : bfgs Model diagnosis : successful convergence Optimisation diagnosis : Maximum found hessian properties : Negative definitive maximum eigenvalue : -3.296355 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:3.75 pre-estimation : 00:00:1.08 estimation : 00:00:1.09 initial estimation : 00:00:0.99 estimation after rescaling : 00:00:0.1 post-estimation : 00:00:1.57 Iterations : 23 initial estimation : 22 estimation after rescaling : 1 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.061909 0.538553 0.1150 0.533044 0.1161 asc_air 0.238310 0.340125 0.7007 0.329272 0.7237 asc_rail -1.481374 0.327325 -4.5257 0.309844 -4.7810 b_tt_car -0.011602 6.5322e-04 -17.7615 6.7831e-04 -17.1045 b_tt_bus -0.017367 0.001452 -11.9620 0.001464 -11.8603 b_tt_air -0.019484 0.002587 -7.5301 0.002475 -7.8718 b_tt_rail -0.006365 0.001704 -3.7350 0.001623 -3.9207 b_access -0.023193 0.002689 -8.6266 0.002645 -8.7678 b_cost -0.058756 0.001487 -39.5177 0.001660 -35.3948 b_no_frills 0.000000 NA NA NA NA b_wifi 0.937557 0.052981 17.6961 0.055184 16.9898 b_food 0.409558 0.052181 7.8489 0.052628 7.7821 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 asc_bus 0.29004 0.033491 0.027795 9.467e-05 -7.1334e-04 -2.329e-05 1.913e-05 -4.894e-05 asc_air 0.03349 0.115685 0.049672 1.3200e-04 3.724e-05 -6.2688e-04 1.726e-05 -5.2591e-04 asc_rail 0.02780 0.049672 0.107142 1.3847e-04 4.386e-05 -2.902e-05 -4.2599e-04 -3.751e-05 b_tt_car 9.467e-05 1.3200e-04 1.3847e-04 4.267e-07 1.188e-07 -5.668e-08 -4.990e-08 -1.837e-08 b_tt_bus -7.1334e-04 3.724e-05 4.386e-05 1.188e-07 2.108e-06 -2.330e-08 -4.995e-08 -9.770e-08 b_tt_air -2.329e-05 -6.2688e-04 -2.902e-05 -5.668e-08 -2.330e-08 6.695e-06 -2.508e-07 2.329e-06 b_tt_rail 1.913e-05 1.726e-05 -4.2599e-04 -4.990e-08 -4.995e-08 -2.508e-07 2.904e-06 -5.919e-07 b_access -4.894e-05 -5.2591e-04 -3.751e-05 -1.837e-08 -9.770e-08 2.329e-06 -5.919e-07 7.228e-06 b_cost 2.028e-05 -8.220e-05 -3.463e-05 2.468e-07 2.528e-07 9.027e-07 5.224e-07 6.306e-07 b_wifi -3.5989e-04 -0.002317 -0.001517 -5.838e-06 -5.052e-06 -3.184e-06 -9.591e-06 -4.147e-06 b_food -2.1649e-04 -0.001440 -0.001485 -3.034e-06 -2.417e-06 -5.193e-06 -4.345e-06 -4.198e-06 b_cost b_wifi b_food asc_bus 2.028e-05 -3.5989e-04 -2.1649e-04 asc_air -8.220e-05 -0.002317 -0.001440 asc_rail -3.463e-05 -0.001517 -0.001485 b_tt_car 2.468e-07 -5.838e-06 -3.034e-06 b_tt_bus 2.528e-07 -5.052e-06 -2.417e-06 b_tt_air 9.027e-07 -3.184e-06 -5.193e-06 b_tt_rail 5.224e-07 -9.591e-06 -4.345e-06 b_access 6.306e-07 -4.147e-06 -4.198e-06 b_cost 2.211e-06 -1.845e-05 -1.052e-05 b_wifi -1.845e-05 0.002807 0.001523 b_food -1.052e-05 0.001523 0.002723 Robust covariance matrix: asc_bus asc_air asc_rail b_tt_car b_tt_bus b_tt_air b_tt_rail b_access asc_bus 0.284136 0.025233 0.020214 8.844e-05 -6.9983e-04 -3.251e-05 4.735e-05 7.429e-05 asc_air 0.025233 0.108420 0.043448 1.3604e-04 6.657e-05 -5.2336e-04 5.960e-05 -4.9919e-04 asc_rail 0.020214 0.043448 0.096003 1.3297e-04 5.963e-05 3.252e-05 -3.5524e-04 -3.794e-05 b_tt_car 8.844e-05 1.3604e-04 1.3297e-04 4.601e-07 1.752e-07 4.835e-08 6.102e-08 -7.382e-08 b_tt_bus -6.9983e-04 6.657e-05 5.963e-05 1.752e-07 2.144e-06 9.818e-08 -1.633e-09 -4.737e-07 b_tt_air -3.251e-05 -5.2336e-04 3.252e-05 4.835e-08 9.818e-08 6.126e-06 -3.109e-07 1.806e-06 b_tt_rail 4.735e-05 5.960e-05 -3.5524e-04 6.102e-08 -1.633e-09 -3.109e-07 2.636e-06 -6.387e-07 b_access 7.429e-05 -4.9919e-04 -3.794e-05 -7.382e-08 -4.737e-07 1.806e-06 -6.387e-07 6.997e-06 b_cost 4.522e-05 -8.030e-07 2.027e-05 3.662e-07 2.922e-07 6.893e-07 4.481e-07 5.627e-07 b_wifi -0.002793 -0.001849 -0.001278 -6.772e-06 4.308e-07 -1.392e-05 -1.386e-05 1.280e-06 b_food 6.3581e-04 -0.001149 -0.001704 -4.808e-06 -6.389e-06 -1.586e-05 -5.822e-06 -6.565e-06 b_cost b_wifi b_food asc_bus 4.522e-05 -0.002793 6.3581e-04 asc_air -8.030e-07 -0.001849 -0.001149 asc_rail 2.027e-05 -0.001278 -0.001704 b_tt_car 3.662e-07 -6.772e-06 -4.808e-06 b_tt_bus 2.922e-07 4.308e-07 -6.389e-06 b_tt_air 6.893e-07 -1.392e-05 -1.586e-05 b_tt_rail 4.481e-07 -1.386e-05 -5.822e-06 b_access 5.627e-07 1.280e-06 -6.565e-06 b_cost 2.756e-06 -1.152e-05 -1.244e-05 b_wifi -1.152e-05 0.003045 0.001591 b_food -1.244e-05 0.001591 0.002770 Classical correlation matrix: asc_bus asc_air asc_rail b_tt_car b_tt_bus b_tt_air b_tt_rail b_access asc_bus 1.000000 0.18284 0.15767 0.26911 -0.912311 -0.016717 0.02084 -0.03380 asc_air 0.182838 1.00000 0.44617 0.59414 0.075414 -0.712320 0.02978 -0.57511 asc_rail 0.157674 0.44617 1.00000 0.64759 0.092298 -0.034268 -0.76369 -0.04262 b_tt_car 0.269105 0.59414 0.64759 1.00000 0.125271 -0.033533 -0.04482 -0.01046 b_tt_bus -0.912311 0.07541 0.09230 0.12527 1.000000 -0.006203 -0.02019 -0.02503 b_tt_air -0.016717 -0.71232 -0.03427 -0.03353 -0.006203 1.000000 -0.05688 0.33475 b_tt_rail 0.020843 0.02978 -0.76369 -0.04482 -0.020189 -0.056882 1.00000 -0.12919 b_access -0.033800 -0.57511 -0.04262 -0.01046 -0.025030 0.334752 -0.12919 1.00000 b_cost 0.025333 -0.16254 -0.07115 0.25409 0.117095 0.234655 0.20618 0.15776 b_wifi -0.012613 -0.12856 -0.08749 -0.16868 -0.065678 -0.023226 -0.10622 -0.02911 b_food -0.007704 -0.08111 -0.08697 -0.08902 -0.031903 -0.038465 -0.04887 -0.02993 b_cost b_wifi b_food asc_bus 0.02533 -0.01261 -0.007704 asc_air -0.16254 -0.12856 -0.081109 asc_rail -0.07115 -0.08749 -0.086968 b_tt_car 0.25409 -0.16868 -0.089020 b_tt_bus 0.11710 -0.06568 -0.031903 b_tt_air 0.23465 -0.02323 -0.038465 b_tt_rail 0.20618 -0.10622 -0.048867 b_access 0.15776 -0.02911 -0.029926 b_cost 1.00000 -0.23420 -0.135577 b_wifi -0.23420 1.00000 0.550904 b_food -0.13558 0.55090 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 asc_bus 1.00000 0.143763 0.12239 0.24460 -0.896599 -0.02464 0.05472 0.052687 asc_air 0.14376 1.000000 0.42586 0.60907 0.138067 -0.64217 0.11149 -0.573112 asc_rail 0.12239 0.425862 1.00000 0.63265 0.131422 0.04240 -0.70623 -0.046291 b_tt_car 0.24460 0.609073 0.63265 1.00000 0.176381 0.02880 0.05541 -0.041139 b_tt_bus -0.89660 0.138067 0.13142 0.17638 1.000000 0.02709 -6.8686e-04 -0.122294 b_tt_air -0.02464 -0.642169 0.04240 0.02880 0.027090 1.00000 -0.07738 0.275910 b_tt_rail 0.05472 0.111489 -0.70623 0.05541 -6.8686e-04 -0.07738 1.00000 -0.148728 b_access 0.05269 -0.573112 -0.04629 -0.04114 -0.122294 0.27591 -0.14873 1.000000 b_cost 0.05110 -0.001469 0.03941 0.32526 0.120223 0.16776 0.16629 0.128141 b_wifi -0.09495 -0.101744 -0.07477 -0.18091 0.005331 -0.10189 -0.15469 0.008766 b_food 0.02266 -0.066283 -0.10451 -0.13468 -0.082911 -0.12178 -0.06814 -0.047158 b_cost b_wifi b_food asc_bus 0.051099 -0.094953 0.02266 asc_air -0.001469 -0.101744 -0.06628 asc_rail 0.039406 -0.074768 -0.10451 b_tt_car 0.325260 -0.180911 -0.13468 b_tt_bus 0.120223 0.005331 -0.08291 b_tt_air 0.167755 -0.101894 -0.12178 b_tt_rail 0.166293 -0.154690 -0.06814 b_access 0.128141 0.008766 -0.04716 b_cost 1.000000 -0.125805 -0.14236 b_wifi -0.125805 1.000000 0.54789 b_food -0.142360 0.547886 1.00000 20 worst outliers in terms of lowest average per choice prediction: ID Avg prob per choice 464 0.1815939 272 0.2158490 457 0.2243956 82 0.2251271 151 0.2385041 263 0.2422008 186 0.2425682 196 0.2428436 278 0.2514737 77 0.2541716 147 0.2563695 146 0.2608279 276 0.2617125 293 0.2647152 25 0.2674984 400 0.2683083 369 0.2688840 309 0.2704936 304 0.2708662 446 0.2711951 Changes in parameter estimates from starting values: Initial Estimate Difference asc_car 0.000 0.000000 0.000000 asc_bus 0.000 0.061909 0.061909 asc_air 0.000 0.238310 0.238310 asc_rail 0.000 -1.481374 -1.481374 b_tt_car 0.000 -0.011602 -0.011602 b_tt_bus 0.000 -0.017367 -0.017367 b_tt_air 0.000 -0.019484 -0.019484 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.937557 0.937557 b_food 0.000 0.409558 0.409558 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" panelData "TRUE" analyticGrad "TRUE" analyticGrad_manualSet "FALSE" overridePanel "FALSE" preventOverridePanel "FALSE" noModification "FALSE" Hessian routines attempted -------------------------- numerical jacobian of LL analytical gradient Scaling in estimation --------------------- Value asc_bus 0.061909273 asc_air 0.238310133 asc_rail 1.481375385 b_tt_car 0.011602208 b_tt_bus 0.017367189 b_tt_air 0.019483602 b_tt_rail 0.006364949 b_access 0.023193160 b_cost 0.058756149 b_wifi 0.937557383 b_food 0.409558353 Scaling used in computing Hessian --------------------------------- Value asc_bus 0.061909275 asc_air 0.238310118 asc_rail 1.481374447 b_tt_car 0.011602241 b_tt_bus 0.017367131 b_tt_air 0.019483608 b_tt_rail 0.006364946 b_access 0.023193157 b_cost 0.058756167 b_wifi 0.937557365 b_food 0.409558377 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) }