Important: Read this before posting to this forum

  1. This forum is for questions related to the use of Apollo. We will answer some general choice modelling questions too, where appropriate, and time permitting. We cannot answer questions about how to estimate choice models with other software packages.
  2. There is a very detailed manual for Apollo available at http://www.ApolloChoiceModelling.com/manual.html. This contains detailed descriptions of the various Apollo functions, and numerous examples are available at http://www.ApolloChoiceModelling.com/examples.html. In addition, help files are available for all functions, using e.g. ?apollo_mnl
  3. Before asking a question on the forum, users are kindly requested to follow these steps:
    1. Check that the same issue has not already been addressed in the forum - there is a search tool.
    2. Ensure that the correct syntax has been used. For any function, detailed instructions are available directly in Apollo, e.g. by using ?apollo_mnl for apollo_mnl
    3. Check the frequently asked questions section on the Apollo website, which discusses some common issues/failures. Please see http://www.apollochoicemodelling.com/faq.html
    4. Make sure that R is using the latest official release of Apollo.
  4. If the above steps do not resolve the issue, then users should follow these steps when posting a question:
    1. provide full details on the issue, including the entire code and output, including any error messages
    2. posts will not immediately appear on the forum, but will be checked by a moderator first. This may take a day or two at busy times. There is no need to submit the post multiple times.

error in getiing Standarad error of e mdcev model

Ask questions about errors you encouunter. Please make sure to include full details about your model specifications, and ideally your model file.
Post Reply
NiluCapgi
Posts: 2
Joined: 04 Apr 2024, 13:20

error in getiing Standarad error of e mdcev model

Post by NiluCapgi »

hi iwas trying emdcev model but getting na in standrad error. please help ime with this context.
Iterates will be written to:
output/eMDC_without_budget_iterations.csv it nf F RELDF PRELDF RELDX MODEL stppar
0 1 7.621958780e+03
1 4 6.914026211e+03 9.288e-02 6.458e-02 2.95e-02 G 2.16e-03
2 5 6.366845555e+03 7.914e-02 7.599e-02 1.22e-01 G 8.15e-03
3 6 5.900183162e+03 7.330e-02 7.638e-02 1.81e-01 G 1.85e-02
4 7 5.409060997e+03 8.324e-02 7.110e-02 2.01e-01 G 1.48e-02
5 8 4.967740789e+03 8.159e-02 6.938e-02 2.52e-01 G 2.26e-02
6 10 4.738075741e+03 4.623e-02 3.880e-02 1.48e-02 G 3.55e+00
7 12 4.474014229e+03 5.573e-02 5.382e-02 7.64e-02 G 1.69e-01
8 13 4.281959232e+03 4.293e-02 6.551e-02 1.68e-01 G 9.35e-02
9 16 4.226180332e+03 1.303e-02 2.726e-02 2.77e-02 S-G 7.53e-01
10 18 4.180131860e+03 1.090e-02 1.853e-02 4.49e-02 G-S 5.68e-01
11 19 4.159343772e+03 4.973e-03 1.123e-02 5.47e-02 S 3.68e-01
12 20 4.126418075e+03 7.916e-03 8.967e-03 4.08e-02 S 1.22e-01
13 22 4.114146301e+03 2.974e-03 4.018e-03 2.30e-02 S 1.38e-01
14 23 4.108670141e+03 1.331e-03 2.506e-03 2.50e-02 S 7.41e-02
15 24 4.101785699e+03 1.676e-03 1.669e-03 1.61e-02 S 8.54e-03
16 25 4.098277338e+03 8.553e-04 1.059e-03 1.51e-02 S 7.64e-03
17 26 4.094874549e+03 8.303e-04 6.532e-04 1.93e-02 S 4.95e-03
18 27 4.091445415e+03 8.374e-04 7.799e-04 1.52e-02 S 6.06e-03
19 28 4.089386688e+03 5.032e-04 5.307e-04 1.78e-02 S 3.89e-03
20 29 4.087302896e+03 5.096e-04 4.046e-04 2.08e-02 S 3.03e-03
21 30 4.085339333e+03 4.804e-04 4.827e-04 1.89e-02 S 2.42e-03
22 31 4.084220600e+03 2.738e-04 3.087e-04 3.20e-02 S 1.42e-03
23 32 4.083414634e+03 1.973e-04 1.817e-04 3.08e-02 S 7.84e-04
24 33 4.082938942e+03 1.165e-04 1.524e-04 3.09e-02 S 4.91e-04
25 34 4.082756191e+03 4.476e-05 9.794e-05 2.72e-02 S 3.01e-04
26 35 4.082570799e+03 4.541e-05 6.650e-05 3.24e-02 S 1.13e-04
27 40 4.082533157e+03 9.220e-06 3.494e-05 1.67e-03 S 3.42e-02
28 41 4.082477081e+03 1.374e-05 2.396e-05 2.31e-03 S 4.60e-03
29 42 4.082463651e+03 3.290e-06 1.391e-05 2.44e-03 S 9.28e-04
30 43 4.082437476e+03 6.411e-06 1.049e-05 2.31e-03 S 9.15e-04
31 44 4.082426406e+03 2.712e-06 5.532e-06 2.00e-03 S 4.79e-04
32 45 4.082418524e+03 1.931e-06 3.199e-06 3.64e-03 S 3.97e-04
33 46 4.082411307e+03 1.768e-06 1.992e-06 4.13e-03 S 3.27e-04
34 47 4.082406506e+03 1.176e-06 1.082e-06 3.10e-03 S 3.25e-04
35 48 4.082401253e+03 1.287e-06 8.086e-07 3.39e-03 S 8.44e-05
36 49 4.082315622e+03 2.098e-05 4.669e-05 1.63e-02 G 2.45e-02
37 51 4.082190151e+03 3.074e-05 2.570e-05 1.10e-02 G-S 1.29e-04
38 54 4.082176369e+03 3.376e-06 1.533e-05 2.93e-03 S 8.42e-02
39 55 4.082173498e+03 7.033e-07 1.844e-05 2.56e-03 S 5.02e-02
40 56 4.082106585e+03 1.639e-05 1.694e-05 7.10e-04 S 2.02e-01
41 57 4.082087235e+03 4.740e-06 7.226e-06 7.33e-04 S 1.31e-01
42 58 4.082074299e+03 3.169e-06 3.332e-06 6.15e-04 S 2.98e-02
43 59 4.082062491e+03 2.893e-06 2.207e-06 5.96e-04 S 1.51e-02
44 60 4.082050060e+03 3.045e-06 2.873e-06 1.16e-03 S 2.47e-02
45 61 4.082042442e+03 1.866e-06 2.190e-06 8.93e-04 S 9.37e-03
46 62 4.082036061e+03 1.563e-06 1.363e-06 6.32e-04 S 2.87e-03
47 63 4.082034315e+03 4.277e-07 9.903e-07 7.48e-04 S 1.64e-03
48 64 4.082031936e+03 5.829e-07 7.068e-07 1.11e-03 S 6.47e-04
49 65 4.082031180e+03 1.853e-07 3.632e-07 1.04e-03 S 6.42e-04
50 66 4.082030291e+03 2.178e-07 2.401e-07 1.15e-03 S 5.64e-04
51 67 4.082029817e+03 1.161e-07 1.370e-07 1.26e-03 S 5.61e-04
52 68 4.082029413e+03 9.899e-08 8.796e-08 1.15e-03 S 5.61e-04
53 69 4.082028956e+03 1.118e-07 7.925e-08 1.25e-03 S 2.41e-04
54 70 4.082028188e+03 1.882e-07 1.550e-07 2.53e-03 S 2.41e-04
55 71 4.082027566e+03 1.523e-07 1.563e-07 2.45e-03 S 2.41e-04
56 72 4.082027329e+03 5.815e-08 9.007e-08 2.59e-03 S 2.14e-04
57 73 4.082027072e+03 6.307e-08 6.619e-08 2.45e-03 S 2.13e-04
58 74 4.082026901e+03 4.171e-08 4.443e-08 2.57e-03 S 1.87e-04
59 75 4.082026790e+03 2.728e-08 2.792e-08 2.37e-03 S 1.86e-04
60 78 4.082026451e+03 8.315e-08 9.904e-08 1.63e-02 S 2.42e-05
61 79 4.082026321e+03 3.174e-08 7.074e-08 1.65e-02 S 1.39e-05
62 80 4.082026152e+03 4.152e-08 5.327e-08 1.62e-02 S 3.08e-06
63 81 4.082026034e+03 2.872e-08 3.295e-08 1.26e-02 S 7.78e-07
64 82 4.082026011e+03 5.719e-09 1.652e-08 1.03e-02 S 4.09e-07
65 83 4.082025952e+03 1.449e-08 1.312e-08 1.30e-02 S 1.41e-07
66 84 4.082025927e+03 5.960e-09 8.265e-09 1.23e-02 S 6.86e-08
67 85 4.082025901e+03 6.403e-09 4.995e-09 1.51e-02 S 1.72e-08
68 86 4.082025871e+03 7.368e-09 5.548e-09 1.48e-02 S 3.21e-08
69 87 4.082025846e+03 6.170e-09 5.958e-09 2.15e-02 S 1.89e-07
70 88 4.082025829e+03 4.257e-09 4.132e-09 1.96e-02 S 1.87e-07
71 89 4.082025822e+03 1.608e-09 3.037e-09 2.12e-02 S 9.47e-08
72 90 4.082025817e+03 1.366e-09 1.874e-09 1.84e-02 S 1.59e-08
73 91 4.082025813e+03 9.613e-10 1.075e-09 2.02e-02 S 1.22e-08
74 92 4.082025812e+03 1.806e-10 5.259e-10 1.92e-02 S 1.20e-08
75 93 4.082025811e+03 3.065e-10 4.358e-10 1.77e-02 S 1.20e-08
76 94 4.082025810e+03 1.939e-10 2.725e-10 1.85e-02 S 9.83e-08
77 95 4.082025809e+03 1.375e-10 1.819e-10 1.97e-02 S 9.50e-08
78 96 4.082025809e+03 1.472e-10 1.690e-10 2.24e-02 S 1.20e-07

***** Singular convergence *****

Estimated parameters:
Estimate
bmdv -0.139165
bhdv 0.142881
b3pl_mdv 0.576389
b3pl_hdv 0.837180
bo_mdv -0.628290
bo_hdv -0.121446
btc_mdv -0.550138
btc_hdv -0.086945
btct_mdv -0.490018
btct_hdv -0.079976
bpm_mdv -0.533921
bpm_hdv 0.015002
bdfh_mdv -0.008148
bdfh_hdv -0.017649
bdfr_mdv -0.004460
bdfr_hdv 0.003419
bEMP_mdv 0.001666
bEMP_hdv -0.001131
btrip_mdv 0.004582
btrip_hdv -0.003012
BTL_MDV -0.095453
BTL_HDV 0.072689
bmining_mdv 1.392095
bfood_mdv 2.225836
btextile_mdv 2.201313
bwood_mdv 2.035433
bhardcoke_mdv -2.716303
bchemical_mdv 2.233558
bplastic_mdv 2.176931
bmineral_mdv 1.999359
bmetal_mdv 1.868434
bmachinary_mdv 2.024350
bwholesale_mdv 1.918299
bcourior_mdv 0.062726
bmin_mdv -0.475373
bmanu_mdv -0.668289
bwhole_mdv -0.349843
bother1_mdv 1.470633
bldv_mdv -0.415651
bmdv_mdv -0.254053
bhdv_mdv -1.101753
byear_mdv -0.001575
bfa_mdv -0.002331
bmining_hdv 0.156949
bfood_hdv -0.491887
btextile_hdv -0.659866
bwood_hdv -0.417587
bhardcoke_hdv 0.020215
bchemical_hdv -0.357922
bplastic_hdv -0.448739
bmineral_hdv -0.167451
bmetal_hdv -0.036915
bmachinary_hdv -0.132421
bwholesale_hdv -0.211187
bcourior_hdv 0.027180
bmin_hdv 1.088266
bmanu_hdv 1.256016
bwhole_hdv 1.068685
bother1_hdv 0.825553
bldv_hdv -1.546798
bmdv_hdv -1.497486
bhdv_hdv -0.542491
byear_hdv 0.003243
bfa_hdv 0.003218
gWork 4.061498
gSchool 8.664475
gShopping 15.373754
dWorkShop 0.000000
dWorkPriv 0.000000
dWorkScho -104.659589
dWorkLeis 0.000000
dSchoShop 0.000000
sigma 0.345559

Final LL: -4082.0258

WARNING: Estimation failed. No covariance matrix to compute.

Current process will resume in 3 seconds unless interrupted by the user...

LDV1 MDV1 HDV1
Times available 1076.000000 1076.000000 1076.000000
Times chosen 195.000000 357.000000 524.000000
% chosen when avail. 18.122677 33.178439 48.698885
Avg. consump. when avail. 0.223132 1.814312 7.583922
Avg. consump. when chosen 1.231231 5.468347 15.573092

Calculating log-likelihood at equal shares (LL(0)) for applicable models...
Calculating log-likelihood at observed shares from estimation data (LL(c)) for applicable models...
Calculating LL of each model component...

Your model was estimated using the BGW algorithm. Please acknowledge this by citing Bunch et al. (1993) - DOI
10.1145/151271.151279
>
> apollo_modelOutput(model)
Model run by SSM using Apollo 0.3.1 on R 4.3.2 for Windows.
Please acknowledge the use of Apollo by citing Hess & Palma (2019)
DOI 10.1016/j.jocm.2019.100170
www.ApolloChoiceModelling.com

Model name : eMDC_without_budget
Model description : Extended MDC with complementarity and substitution, with unobserved budget and socio-demographics
Model run at : 2024-04-05 17:40:34.572876
Estimation method : bgw
Model diagnosis : Singular convergence
Number of individuals : 400
Number of rows in database : 1076
Number of modelled outcomes : 0

Number of cores used : 1
Model without mixing

LL(start) : -7621.96
LL at equal shares, LL(0) : NA
LL at observed shares, LL(C) : NA
LL(final) : -4082.03
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 : 8302.05
BIC : NA

Estimated parameters : 69
Time taken (hh:mm:ss) : 00:02:7.79
pre-estimation : 00:00:2.6
estimation : 00:02:5.11
post-estimation : 00:00:0.08
Iterations : 78 (Singular convergence)

Unconstrained optimisation.

Estimates:
Estimate s.e. t.rat.(0) Rob.s.e. Rob.t.rat.(0)
bmdv -0.139165 NA NA NA NA
bhdv 0.142881 NA NA NA NA
b3pl_mdv 0.576389 NA NA NA NA
b3pl_hdv 0.837180 NA NA NA NA
bo_mdv -0.628290 NA NA NA NA
bo_hdv -0.121446 NA NA NA NA
btc_mdv -0.550138 NA NA NA NA
btc_hdv -0.086945 NA NA NA NA
btct_mdv -0.490018 NA NA NA NA
btct_hdv -0.079976 NA NA NA NA
bpm_mdv -0.533921 NA NA NA NA
bpm_hdv 0.015002 NA NA NA NA
bdfh_mdv -0.008148 NA NA NA NA
bdfh_hdv -0.017649 NA NA NA NA
bdfr_mdv -0.004460 NA NA NA NA
bdfr_hdv 0.003419 NA NA NA NA
bEMP_mdv 0.001666 NA NA NA NA
bEMP_hdv -0.001131 NA NA NA NA
btrip_mdv 0.004582 NA NA NA NA
btrip_hdv -0.003012 NA NA NA NA
BTL_MDV -0.095453 NA NA NA NA
BTL_HDV 0.072689 NA NA NA NA
bmining_mdv 1.392095 NA NA NA NA
bfood_mdv 2.225836 NA NA NA NA
btextile_mdv 2.201313 NA NA NA NA
bwood_mdv 2.035433 NA NA NA NA
bhardcoke_mdv -2.716303 NA NA NA NA
bchemical_mdv 2.233558 NA NA NA NA
bplastic_mdv 2.176931 NA NA NA NA
bmineral_mdv 1.999359 NA NA NA NA
bmetal_mdv 1.868434 NA NA NA NA
bmachinary_mdv 2.024350 NA NA NA NA
bwholesale_mdv 1.918299 NA NA NA NA
bcourior_mdv 0.062726 NA NA NA NA
bmin_mdv -0.475373 NA NA NA NA
bmanu_mdv -0.668289 NA NA NA NA
bwhole_mdv -0.349843 NA NA NA NA
bother1_mdv 1.470633 NA NA NA NA
bldv_mdv -0.415651 NA NA NA NA
bmdv_mdv -0.254053 NA NA NA NA
bhdv_mdv -1.101753 NA NA NA NA
byear_mdv -0.001575 NA NA NA NA
bfa_mdv -0.002331 NA NA NA NA
bmining_hdv 0.156949 NA NA NA NA
bfood_hdv -0.491887 NA NA NA NA
btextile_hdv -0.659866 NA NA NA NA
bwood_hdv -0.417587 NA NA NA NA
bhardcoke_hdv 0.020215 NA NA NA NA
bchemical_hdv -0.357922 NA NA NA NA
bplastic_hdv -0.448739 NA NA NA NA
bmineral_hdv -0.167451 NA NA NA NA
bmetal_hdv -0.036915 NA NA NA NA
bmachinary_hdv -0.132421 NA NA NA NA
bwholesale_hdv -0.211187 NA NA NA NA
bcourior_hdv 0.027180 NA NA NA NA
bmin_hdv 1.088266 NA NA NA NA
bmanu_hdv 1.256016 NA NA NA NA
bwhole_hdv 1.068685 NA NA NA NA
bother1_hdv 0.825553 NA NA NA NA
bldv_hdv -1.546798 NA NA NA NA
bmdv_hdv -1.497486 NA NA NA NA
bhdv_hdv -0.542491 NA NA NA NA
byear_hdv 0.003243 NA NA NA NA
bfa_hdv 0.003218 NA NA NA NA
gWork 4.061498 NA NA NA NA
gSchool 8.664475 NA NA NA NA
gShopping 15.373754 NA NA NA NA
dWorkShop 0.000000 NA NA NA NA
dWorkPriv 0.000000 NA NA NA NA
dWorkScho -104.659589 NA NA NA NA
dWorkLeis 0.000000 NA NA NA NA
dSchoShop 0.000000 NA NA NA NA
sigma 0.345559 NA NA NA NA

LDV1 MDV1 HDV1
Times available 1076.000000 1076.000000 1076.000000
Times chosen 195.000000 357.000000 524.000000
% chosen when avail. 18.122677 33.178439 48.698885
Avg. consump. when avail. 0.223132 1.814312 7.583922
Avg. consump. when chosen 1.231231 5.468347 15.573092

the code is written below.
# ################################################################# #
#### LOAD LIBRARY AND DEFINE CORE SETTINGS ####
# ################################################################# #

### Clear memory and initialise
#cat("\014")
rm(list = ls())
library(apollo)
apollo_initialise()

### Set core controls
apollo_control = list(
modelName ="eMDC_without_budget",
modelDescr ="Extended MDC with complementarity and substitution, with unobserved budget and socio-demographics",
indivID ="indivID",
outputDirectory="output"
)

# ################################################################# #
#### LOAD DATA AND APPLY ANY TRANSFORMATIONS ####
# ################################################################# #

#
Last edited by NiluCapgi on 22 Apr 2024, 14:24, edited 1 time in total.
stephanehess
Site Admin
Posts: 1002
Joined: 24 Apr 2020, 16:29

Re: error in getiing Standarad error of e mdcev model

Post by stephanehess »

Hi

your parameter dWorkScho is tending towards -inf (-104.659589), so that is causing the issue here. You'll have to investigate what is causing this

Stephane
--------------------------------
Stephane Hess
www.stephanehess.me.uk
NiluCapgi
Posts: 2
Joined: 04 Apr 2024, 13:20

Re: error in getiing Standarad error of e mdcev model

Post by NiluCapgi »

Thank you, and I got the results. one more thing: to ask the parameters dworkschool giving me the substitution effect. how can I add more variables to this?
stephanehess
Site Admin
Posts: 1002
Joined: 24 Apr 2020, 16:29

Re: error in getiing Standarad error of e mdcev model

Post by stephanehess »

Hi

it's not clear what you mean exactly. Do you want to interact this with covariates?

Stephane
--------------------------------
Stephane Hess
www.stephanehess.me.uk
Post Reply