Model run by stephane.hess using Apollo 0.2.9 on R 4.0.5 for Darwin. www.ApolloChoiceModelling.com Model name : normal_density Model description : Normal density function fitted to attitudinal question in drug choice data Model run at : 2023-05-10 22:03:53 Estimation method : bfgs Model diagnosis : successful convergence Optimisation diagnosis : Maximum found hessian properties : Negative definitive maximum eigenvalue : -56.632145 Number of individuals : 1000 Number of rows in database : 10000 Number of modelled outcomes : 1000 Number of cores used : 1 Model without mixing LL(start) : -2738.46 LL at equal shares, LL(0) : NA LL at observed shares, LL(C) : NA LL(final) : -2146.11 Rho-squared vs equal shares : Not applicable Adj.Rho-squared vs equal shares : Not applicable Rho-squared vs observed shares : Not applicable Adj.Rho-squared vs observed shares : Not applicable AIC : 4300.22 BIC : 4319.85 Estimated parameters : 4 Time taken (hh:mm:ss) : 00:00:0.67 pre-estimation : 00:00:0.25 estimation : 00:00:0.22 initial estimation : 00:00:0.18 estimation after rescaling : 00:00:0.05 post-estimation : 00:00:0.2 Iterations : 16 initial estimation : 15 estimation after rescaling : 1 Unconstrained optimisation. Estimates: Estimate s.e. t.rat.(0) Rob.s.e. Rob.t.rat.(0) beta_reg_user 1.240 0.12074 10.27 0.09538 13.00 beta_university 1.421 0.11623 12.22 0.08877 16.00 beta_age_50 1.963 0.11680 16.81 0.08756 22.42 sigma 2.069 0.04627 44.72 0.04065 50.91 Summary statistics for model component : Min. 1st Qu. Median Mean 3rd Qu. Max. 1 2 3 2.741 3 5 Classical covariance matrix: beta_reg_user beta_university beta_age_50 sigma beta_reg_user 0.014578 -0.003545 -0.003344 8.599e-08 beta_university -0.003545 0.013510 -0.004011 -4.972e-07 beta_age_50 -0.003344 -0.004011 0.013643 1.534e-07 sigma 8.599e-08 -4.972e-07 1.534e-07 0.002141 Robust covariance matrix: beta_reg_user beta_university beta_age_50 sigma beta_reg_user 0.009098 -0.002209 -0.001585 1.9369e-04 beta_university -0.002209 0.007880 -0.002228 1.5292e-04 beta_age_50 -0.001585 -0.002228 0.007668 -1.9235e-04 sigma 1.9369e-04 1.5292e-04 -1.9235e-04 0.001652 Classical correlation matrix: beta_reg_user beta_university beta_age_50 sigma beta_reg_user 1.0000 -0.2526 -0.2371 1.539e-05 beta_university -0.2526 1.0000 -0.2955 -9.244e-05 beta_age_50 -0.2371 -0.2955 1.0000 2.838e-05 sigma 1.539e-05 -9.244e-05 2.838e-05 1.000 Robust correlation matrix: beta_reg_user beta_university beta_age_50 sigma beta_reg_user 1.00000 -0.26095 -0.18983 0.04996 beta_university -0.26095 1.00000 -0.28668 0.04238 beta_age_50 -0.18983 -0.28668 1.00000 -0.05404 sigma 0.04996 0.04238 -0.05404 1.00000 20 worst outliers in terms of lowest average per choice prediction: ID Avg prob per choice 40 0.6334677 90 0.6334677 92 0.6334677 103 0.6334677 116 0.6334677 164 0.6334677 239 0.6334677 267 0.6334677 281 0.6334677 297 0.6334677 440 0.6334677 477 0.6334677 522 0.6334677 555 0.6334677 580 0.6334677 663 0.6334677 676 0.6334677 704 0.6334677 717 0.6334677 729 0.6334677 Changes in parameter estimates from starting values: Initial Estimate Difference beta_reg_user 0.000 1.240 1.23980 beta_university 0.000 1.421 1.42071 beta_age_50 0.000 1.963 1.96330 sigma 2.000 2.069 0.06925 Settings and functions used in model definition: apollo_control -------------- Value modelName "normal_density" modelDescr "Normal density function fitted to attitudinal question in drug choice 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 beta_reg_user 1.239797 beta_university 1.420696 beta_age_50 1.963294 sigma 2.069297 Scaling used in computing Hessian --------------------------------- Value beta_reg_user 1.239798 beta_university 1.420709 beta_age_50 1.963296 sigma 2.069249 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() ### Calculate probabilities using Normal Density normalDensity_settings = list(outcomeNormal = attitude_quality, xNormal = beta_reg_user*regular_user + beta_university*university_educated + beta_age_50*over_50, mu = 0, sigma = sigma, rows = (task==1)) P[["model"]] = apollo_normalDensity(normalDensity_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) }