Model run by stephane.hess using Apollo 0.2.9 on R 4.0.5 for Darwin. www.ApolloChoiceModelling.com Model name : MMNL_preference_space Model description : Mixed logit model on Swiss route choice data, uncorrelated Lognormals in preference space Model run at : 2023-05-10 23:37:02 Estimation method : bfgs Model diagnosis : successful convergence Optimisation diagnosis : Maximum found hessian properties : Negative definitive maximum eigenvalue : -35.331579 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) : -2253.78 LL at equal shares, LL(0) : -2420.47 LL at observed shares, LL(C) : -2420.39 LL(final) : -1444.47 Rho-squared vs equal shares : 0.4032 Adj.Rho-squared vs equal shares : 0.3999 Rho-squared vs observed shares : 0.4032 Adj.Rho-squared vs observed shares : 0.4003 AIC : 2904.94 BIC : 2954.2 Estimated parameters : 8 Time taken (hh:mm:ss) : 00:01:42.97 pre-estimation : 00:00:23.63 estimation : 00:00:38.07 initial estimation : 00:00:35.26 estimation after rescaling : 00:00:2.8 post-estimation : 00:00:41.27 Iterations : 35 initial estimation : 34 estimation after rescaling : 1 Unconstrained optimisation. Estimates: Estimate s.e. t.rat.(0) Rob.s.e. Rob.t.rat.(0) mu_log_b_tt -1.9834 0.08812 -22.507 0.11479 -17.278 sigma_log_b_tt -0.4662 0.07753 -6.013 0.07436 -6.269 mu_log_b_tc -1.0246 0.13792 -7.428 0.17908 -5.721 sigma_log_b_tc -0.9843 0.09134 -10.776 0.09383 -10.490 mu_log_b_hw -2.9339 0.08465 -34.661 0.09071 -32.345 sigma_log_b_hw 0.8163 0.11757 6.943 0.13150 6.208 mu_log_b_ch 0.6234 0.07391 8.434 0.08289 7.521 sigma_log_b_ch -0.8263 0.12050 -6.857 0.15557 -5.311 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_tc mu_log_b_hw sigma_log_b_hw mu_log_b_tt 0.007765 0.002381 0.008200 0.002116 0.001783 0.001040 sigma_log_b_tt 0.002381 0.006011 0.001184 8.858e-05 -6.3330e-04 6.4981e-04 mu_log_b_tc 0.008200 0.001184 0.019023 0.007230 0.001919 0.001317 sigma_log_b_tc 0.002116 8.858e-05 0.007230 0.008343 -4.8354e-04 2.0721e-04 mu_log_b_hw 0.001783 -6.3330e-04 0.001919 -4.8354e-04 0.007165 -0.002584 sigma_log_b_hw 0.001040 6.4981e-04 0.001317 2.0721e-04 -0.002584 0.013823 mu_log_b_ch 0.002046 -5.2093e-04 0.002265 -1.6621e-04 0.001405 0.001298 sigma_log_b_ch -0.001518 2.9514e-04 -0.003043 -0.001538 -6.9075e-04 0.001099 mu_log_b_ch sigma_log_b_ch mu_log_b_tt 0.002046 -0.001518 sigma_log_b_tt -5.2093e-04 2.9514e-04 mu_log_b_tc 0.002265 -0.003043 sigma_log_b_tc -1.6621e-04 -0.001538 mu_log_b_hw 0.001405 -6.9075e-04 sigma_log_b_hw 0.001298 0.001099 mu_log_b_ch 0.005463 -7.8704e-04 sigma_log_b_ch -7.8704e-04 0.014520 Robust covariance matrix: mu_log_b_tt sigma_log_b_tt mu_log_b_tc sigma_log_b_tc mu_log_b_hw sigma_log_b_hw mu_log_b_tt 0.013177 0.003716 0.016909 0.004284 0.003858 7.9213e-04 sigma_log_b_tt 0.003716 0.005530 0.004565 0.001315 -1.3383e-04 0.001143 mu_log_b_tc 0.016909 0.004565 0.032071 0.010527 0.004488 0.002051 sigma_log_b_tc 0.004284 0.001315 0.010527 0.008804 -3.3865e-04 9.1104e-04 mu_log_b_hw 0.003858 -1.3383e-04 0.004488 -3.3865e-04 0.008227 -0.002933 sigma_log_b_hw 7.9213e-04 0.001143 0.002051 9.1104e-04 -0.002933 0.017292 mu_log_b_ch 0.004524 -2.004e-05 0.006101 9.2309e-04 0.003265 8.7736e-04 sigma_log_b_ch -0.001806 7.7374e-04 -0.006629 -0.004573 -2.453e-05 0.002271 mu_log_b_ch sigma_log_b_ch mu_log_b_tt 0.004524 -0.001806 sigma_log_b_tt -2.004e-05 7.7374e-04 mu_log_b_tc 0.006101 -0.006629 sigma_log_b_tc 9.2309e-04 -0.004573 mu_log_b_hw 0.003265 -2.453e-05 sigma_log_b_hw 8.7736e-04 0.002271 mu_log_b_ch 0.006871 -0.001732 sigma_log_b_ch -0.001732 0.024203 Classical correlation matrix: mu_log_b_tt sigma_log_b_tt mu_log_b_tc sigma_log_b_tc mu_log_b_hw sigma_log_b_hw mu_log_b_tt 1.0000 0.34850 0.67464 0.26294 0.23900 0.10037 sigma_log_b_tt 0.3485 1.00000 0.11073 0.01251 -0.09650 0.07129 mu_log_b_tc 0.6746 0.11073 1.00000 0.57393 0.16440 0.08120 sigma_log_b_tc 0.2629 0.01251 0.57393 1.00000 -0.06254 0.01930 mu_log_b_hw 0.2390 -0.09650 0.16440 -0.06254 1.00000 -0.25962 sigma_log_b_hw 0.1004 0.07129 0.08120 0.01930 -0.25962 1.00000 mu_log_b_ch 0.3142 -0.09091 0.22221 -0.02462 0.22451 0.14941 sigma_log_b_ch -0.1429 0.03159 -0.18312 -0.13972 -0.06772 0.07759 mu_log_b_ch sigma_log_b_ch mu_log_b_tt 0.31420 -0.14293 sigma_log_b_tt -0.09091 0.03159 mu_log_b_tc 0.22221 -0.18312 sigma_log_b_tc -0.02462 -0.13972 mu_log_b_hw 0.22451 -0.06772 sigma_log_b_hw 0.14941 0.07759 mu_log_b_ch 1.00000 -0.08837 sigma_log_b_ch -0.08837 1.00000 Robust correlation matrix: mu_log_b_tt sigma_log_b_tt mu_log_b_tc sigma_log_b_tc mu_log_b_hw sigma_log_b_hw mu_log_b_tt 1.00000 0.435378 0.82251 0.39774 0.370528 0.05248 sigma_log_b_tt 0.43538 1.000000 0.34277 0.18850 -0.019842 0.11684 mu_log_b_tc 0.82251 0.342771 1.00000 0.62644 0.276309 0.08709 sigma_log_b_tc 0.39774 0.188504 0.62644 1.00000 -0.039790 0.07383 mu_log_b_hw 0.37053 -0.019842 0.27631 -0.03979 1.000000 -0.24589 sigma_log_b_hw 0.05248 0.116841 0.08709 0.07383 -0.245888 1.00000 mu_log_b_ch 0.47540 -0.003250 0.41100 0.11868 0.434182 0.08049 sigma_log_b_ch -0.10114 0.066884 -0.23792 -0.31327 -0.001738 0.11101 mu_log_b_ch sigma_log_b_ch mu_log_b_tt 0.475399 -0.101141 sigma_log_b_tt -0.003250 0.066884 mu_log_b_tc 0.410996 -0.237925 sigma_log_b_tc 0.118679 -0.313270 mu_log_b_hw 0.434182 -0.001738 sigma_log_b_hw 0.080488 0.111006 mu_log_b_ch 1.000000 -0.134282 sigma_log_b_ch -0.134282 1.000000 20 worst outliers in terms of lowest average per choice prediction: ID Avg prob per choice 15174 0.2512418 16178 0.2613784 22580 0.2736035 23205 0.2754709 21623 0.2973460 76862 0.3245055 16489 0.3384696 21922 0.3468843 12534 0.3497504 15056 0.3640767 16184 0.3687629 22820 0.3753113 24627 0.3773522 20100 0.3822803 16617 0.3836619 15312 0.3852332 22961 0.3854026 14754 0.3907632 17187 0.4035466 17645 0.4051282 Changes in parameter estimates from starting values: Initial Estimate Difference mu_log_b_tt -3.00000 -1.9834 1.01665 sigma_log_b_tt -0.01000 -0.4662 -0.45618 mu_log_b_tc -3.00000 -1.0246 1.97544 sigma_log_b_tc -0.01000 -0.9843 -0.97431 mu_log_b_hw -3.00000 -2.9339 0.06610 sigma_log_b_hw -0.01000 0.8163 0.82634 mu_log_b_ch -3.00000 0.6234 3.62341 sigma_log_b_ch -0.01000 -0.8263 -0.81627 Settings and functions used in model definition: apollo_control -------------- Value modelName "MMNL_preference_space" modelDescr "Mixed logit model on Swiss route choice data, uncorrelated Lognormals in preference space" indivID "ID" nCores "4" outputDirectory "output/" mixing "TRUE" debug "FALSE" workInLogs "FALSE" seed "13" 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 mu_log_b_tt 1.9834902 sigma_log_b_tt 0.4661742 mu_log_b_tc 1.0245299 sigma_log_b_tc 0.9843334 mu_log_b_hw 2.9342245 sigma_log_b_hw 0.8163361 mu_log_b_ch 0.6234332 sigma_log_b_ch 0.8262556 Scaling used in computing Hessian --------------------------------- Value mu_log_b_tt 1.9833544 sigma_log_b_tt 0.4661803 mu_log_b_tc 1.0245623 sigma_log_b_tc 0.9843068 mu_log_b_hw 2.9338968 sigma_log_b_hw 0.8163407 mu_log_b_ch 0.6234130 sigma_log_b_ch 0.8262684 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_tc * draws_tc ) randcoeff[["b_hw"]] = -exp( mu_log_b_hw + sigma_log_b_hw * draws_hw ) randcoeff[["b_ch"]] = -exp( mu_log_b_ch + 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, 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) ### 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) }