Model run by stephane.hess using Apollo 0.2.9 on R 4.0.5 for Darwin. www.ApolloChoiceModelling.com Model name : ECL_preference_space_panel_effect Model description : Error components logit model on Swiss route choice data, uncorrelated Lognormals in preference space, with panel effect term Model run at : 2023-05-10 23:22:02 Estimation method : bfgs Model diagnosis : successful convergence Optimisation diagnosis : Maximum found hessian properties : Negative definitive maximum eigenvalue : -21.83241 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 (mlhs) LL(start) : -2253.78 LL at equal shares, LL(0) : -2420.47 LL at observed shares, LL(C) : -2420.39 LL(final) : -1443.25 Rho-squared vs equal shares : 0.4037 Adj.Rho-squared vs equal shares : 0.4 Rho-squared vs observed shares : 0.4037 Adj.Rho-squared vs observed shares : 0.4004 AIC : 2904.51 BIC : 2959.93 Estimated parameters : 9 Time taken (hh:mm:ss) : 00:02:0.13 pre-estimation : 00:00:28.94 estimation : 00:00:43.24 initial estimation : 00:00:40.04 estimation after rescaling : 00:00:3.2 post-estimation : 00:00:47.95 Iterations : 38 initial estimation : 37 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.9992 0.09444 -21.171 0.13048 -15.323 sigma_log_b_tt -0.4714 0.07133 -6.608 0.06531 -7.217 mu_log_b_tc -1.0679 0.17576 -6.076 0.26524 -4.026 sigma_log_b_tc -1.0722 0.12716 -8.432 0.17588 -6.096 mu_log_b_hw -2.9097 0.08634 -33.701 0.09173 -31.720 sigma_log_b_hw 0.7947 0.12543 6.336 0.16014 4.962 mu_log_b_ch 0.6779 0.07763 8.732 0.08571 7.909 sigma_log_b_ch -0.8444 0.09455 -8.931 0.09737 -8.672 sigma_panel -0.3627 0.09419 -3.851 0.12235 -2.965 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.008918 0.002238 0.011124 0.004321 0.001883 7.1793e-04 sigma_log_b_tt 0.002238 0.005088 1.290e-05 5.1253e-04 -6.9686e-04 0.001641 mu_log_b_tc 0.011124 1.290e-05 0.030892 0.016306 0.002071 -0.001102 sigma_log_b_tc 0.004321 5.1253e-04 0.016306 0.016170 -8.7744e-04 -0.001069 mu_log_b_hw 0.001883 -6.9686e-04 0.002071 -8.7744e-04 0.007454 -0.002860 sigma_log_b_hw 7.1793e-04 0.001641 -0.001102 -0.001069 -0.002860 0.015732 mu_log_b_ch 0.002459 -2.7963e-04 0.002280 -7.8196e-04 0.001674 0.002000 sigma_log_b_ch -0.001432 7.126e-05 -0.002427 2.536e-05 -6.2779e-04 -0.001034 sigma_panel -0.001903 1.4775e-04 -0.001986 7.239e-05 -0.001785 -9.631e-05 mu_log_b_ch sigma_log_b_ch sigma_panel mu_log_b_tt 0.002459 -0.001432 -0.001903 sigma_log_b_tt -2.7963e-04 7.126e-05 1.4775e-04 mu_log_b_tc 0.002280 -0.002427 -0.001986 sigma_log_b_tc -7.8196e-04 2.536e-05 7.239e-05 mu_log_b_hw 0.001674 -6.2779e-04 -0.001785 sigma_log_b_hw 0.002000 -0.001034 -9.631e-05 mu_log_b_ch 0.006026 -2.3512e-04 -0.002167 sigma_log_b_ch -2.3512e-04 0.008939 5.023e-05 sigma_panel -0.002167 5.023e-05 0.008871 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.017024 0.003075 0.028674 0.013378 0.003351 -8.7458e-04 sigma_log_b_tt 0.003075 0.004265 0.002603 0.002514 -5.6025e-04 0.003436 mu_log_b_tc 0.028674 0.002603 0.070353 0.038376 0.004311 -0.005517 sigma_log_b_tc 0.013378 0.002514 0.038376 0.030935 -8.9188e-04 -0.002549 mu_log_b_hw 0.003351 -5.6025e-04 0.004311 -8.9188e-04 0.008415 -0.003827 sigma_log_b_hw -8.7458e-04 0.003436 -0.005517 -0.002549 -0.003827 0.025645 mu_log_b_ch 0.004769 4.1740e-04 0.005841 9.501e-05 0.002964 0.002912 sigma_log_b_ch -0.002043 1.5865e-04 -0.005415 -0.001381 -2.2066e-04 -0.002557 sigma_panel -0.001939 -8.0888e-04 -0.001276 5.8138e-04 -7.9056e-04 -0.002334 mu_log_b_ch sigma_log_b_ch sigma_panel mu_log_b_tt 0.004769 -0.002043 -0.001939 sigma_log_b_tt 4.1740e-04 1.5865e-04 -8.0888e-04 mu_log_b_tc 0.005841 -0.005415 -0.001276 sigma_log_b_tc 9.501e-05 -0.001381 5.8138e-04 mu_log_b_hw 0.002964 -2.2066e-04 -7.9056e-04 sigma_log_b_hw 0.002912 -0.002557 -0.002334 mu_log_b_ch 0.007347 -3.5064e-04 -0.002682 sigma_log_b_ch -3.5064e-04 0.009481 3.7584e-04 sigma_panel -0.002682 3.7584e-04 0.014968 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.00000 0.332257 0.670183 0.359872 0.23093 0.060612 sigma_log_b_tt 0.33226 1.000000 0.001029 0.056504 -0.11315 0.183394 mu_log_b_tc 0.67018 0.001029 1.000000 0.729584 0.13645 -0.049973 sigma_log_b_tc 0.35987 0.056504 0.729584 1.000000 -0.07992 -0.067011 mu_log_b_hw 0.23093 -0.113148 0.136450 -0.079920 1.00000 -0.264134 sigma_log_b_hw 0.06061 0.183394 -0.049973 -0.067011 -0.26413 1.000000 mu_log_b_ch 0.33544 -0.050499 0.167091 -0.079217 0.24972 0.205376 sigma_log_b_ch -0.16043 0.010566 -0.146066 0.002109 -0.07691 -0.087224 sigma_panel -0.21399 0.021990 -0.119988 0.006044 -0.21951 -0.008152 mu_log_b_ch sigma_log_b_ch sigma_panel mu_log_b_tt 0.33544 -0.160426 -0.213995 sigma_log_b_tt -0.05050 0.010566 0.021990 mu_log_b_tc 0.16709 -0.146066 -0.119988 sigma_log_b_tc -0.07922 0.002109 0.006044 mu_log_b_hw 0.24972 -0.076906 -0.219508 sigma_log_b_hw 0.20538 -0.087224 -0.008152 mu_log_b_ch 1.00000 -0.032035 -0.296351 sigma_log_b_ch -0.03204 1.000000 0.005640 sigma_panel -0.29635 0.005640 1.000000 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.36081 0.82856 0.582949 0.28001 -0.04186 sigma_log_b_tt 0.36081 1.00000 0.15028 0.218889 -0.09351 0.32857 mu_log_b_tc 0.82856 0.15028 1.00000 0.822601 0.17718 -0.12989 sigma_log_b_tc 0.58295 0.21889 0.82260 1.000000 -0.05528 -0.09051 mu_log_b_hw 0.28001 -0.09351 0.17718 -0.055278 1.00000 -0.26048 sigma_log_b_hw -0.04186 0.32857 -0.12989 -0.090514 -0.26048 1.00000 mu_log_b_ch 0.42644 0.07456 0.25690 0.006302 0.37697 0.21212 sigma_log_b_ch -0.16077 0.02495 -0.20967 -0.080664 -0.02470 -0.16397 sigma_panel -0.12148 -0.10123 -0.03931 0.027017 -0.07044 -0.11914 mu_log_b_ch sigma_log_b_ch sigma_panel mu_log_b_tt 0.426443 -0.16077 -0.12148 sigma_log_b_tt 0.074563 0.02495 -0.10123 mu_log_b_tc 0.256903 -0.20967 -0.03931 sigma_log_b_tc 0.006302 -0.08066 0.02702 mu_log_b_hw 0.376966 -0.02470 -0.07044 sigma_log_b_hw 0.212124 -0.16397 -0.11914 mu_log_b_ch 1.000000 -0.04201 -0.25573 sigma_log_b_ch -0.042013 1.00000 0.03155 sigma_panel -0.255727 0.03155 1.00000 20 worst outliers in terms of lowest average per choice prediction: ID Avg prob per choice 16178 0.2487912 22580 0.2736971 15174 0.2803797 76862 0.3144858 21623 0.3152805 16489 0.3309156 23205 0.3336028 21922 0.3399822 12534 0.3487522 15056 0.3584790 22961 0.3674726 24627 0.3686841 22820 0.3759762 16184 0.3778237 17187 0.3850300 14754 0.3866527 82613 0.3904646 16617 0.3994926 20100 0.4019651 15489 0.4247264 Changes in parameter estimates from starting values: Initial Estimate Difference mu_log_b_tt -3.00000 -1.9992 1.00075 sigma_log_b_tt -0.01000 -0.4714 -0.46136 mu_log_b_tc -3.00000 -1.0679 1.93212 sigma_log_b_tc -0.01000 -1.0722 -1.06217 mu_log_b_hw -3.00000 -2.9097 0.09026 sigma_log_b_hw -0.01000 0.7947 0.80469 mu_log_b_ch -3.00000 0.6779 3.67787 sigma_log_b_ch -0.01000 -0.8444 -0.83437 sigma_panel 0.00000 -0.3627 -0.36273 Settings and functions used in model definition: apollo_control -------------- Value modelName "ECL_preference_space_panel_effect" modelDescr "Error components logit model on Swiss route choice data, uncorrelated Lognormals in preference space, with panel effect term" 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.9992506 sigma_log_b_tt 0.4713614 mu_log_b_tc 1.0678830 sigma_log_b_tc 1.0721651 mu_log_b_hw 2.9097295 sigma_log_b_hw 0.7946860 mu_log_b_ch 0.6778737 sigma_log_b_ch 0.8443706 sigma_panel 0.3627296 Scaling used in computing Hessian --------------------------------- Value mu_log_b_tt 1.9992495 sigma_log_b_tt 0.4713614 mu_log_b_tc 1.0678832 sigma_log_b_tc 1.0721672 mu_log_b_hw 2.9097396 sigma_log_b_hw 0.7946863 mu_log_b_ch 0.6778742 sigma_log_b_ch 0.8443704 sigma_panel 0.3627297 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 ) randcoeff[["ec_alt1"]] = sigma_panel * draws_alt1 randcoeff[["ec_alt2"]] = sigma_panel * draws_alt2 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 + ec_alt1 V[["alt2"]] = b_tt * tt2 + b_tc * tc2 + b_hw * hw2 + b_ch * ch2 + ec_alt2 ### 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) }