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 MDCEV estimation - covariance matrix cannot be computed

Ask questions about errors you encouunter. Please make sure to include full details about your model specifications, and ideally your model file.
Post Reply
user_8888
Posts: 4
Joined: 15 Sep 2022, 13:33

Error MDCEV estimation - covariance matrix cannot be computed

Post by user_8888 »

Dear all,

We have an estimation problem with an MDCEV model
(Error: cannot compute the covariance matrix)

The data is from an experiment where people has to "configure" a residential location or a flat/ house choosng certain attributes (e.g. having a garden, flat size, location etc.). We have two observations per person. 1) choice of a flat attributes freely, 2) adjusting their choice because of a budget restriction (they have e.g. 20% less budget than the price of the configure flat)

We choose MDCEV as we assume that we have categorical variables for the choice (= attributes, e.g. garden, flat size, location) and numeric one (= cost for the attribute level, e.g., garden = 200 €). The budget is calculated as the total cost for the flat as configured (individually dffrent).

I would like your oppinion on the cause of the error (cannot compute SE and covariance matrix):

1) Is it because of potentia misconception of the model and it is no suitable for analysing this type of data?
2) Is it because of the experimental design (e.g., respondents have individual value for the cost for garden, but they do not choose these values - they are always calculated based on an assumption of the cost for the attribute, e.g. garden = X% of the qm priese)
3) Is the model fine for the data type, but there is misspecification in the code?


Thanks in advance for a reply!
stephanehess
Site Admin
Posts: 974
Joined: 24 Apr 2020, 16:29

Re: Error MDCEV estimation - covariance matrix cannot be computed

Post by stephanehess »

Hi

as mentioned in the forum instructions, it's not possible for us to help without seeing the code and output - there could be many reasons for a failure to compute the covariance matrix. Please show the code & output and we will do our best to help

Stephane
--------------------------------
Stephane Hess
www.stephanehess.me.uk
user_8888
Posts: 4
Joined: 15 Sep 2022, 13:33

Re: Error MDCEV estimation - covariance matrix cannot be computed

Post by user_8888 »

Hi,

sorry that I didn´t provide the code to the issue - here is the model specification:

# ################################################################# #
#### DEFINE MODEL PARAMETERS ####
# ################################################################# #

### Vector of parameters, including any that are kept fixed in estimation
apollo_beta = c(alpha_base = 0,
gamma_klein = 1,
gamma_gross =1,
gamma_garten = 1,
gamma_balkon = 1,
gamma_saniert = 1,
gamma_gute_WL = 1,
gamma_mittlere_WL = 1,
gamma_kernbereich = 1,
gamma_stadtrand = 1,
gamma_Eunter10km = 1,
gamma_E10_25km = 1,
delta_klein = 0,
delta_gross =0,
delta_garten = 0,
delta_balkon = 0,
delta_saniert = 0,
delta_gute_WL = 0,
delta_mittlere_WL = 0,
delta_kernbereich = 0,
delta_stadtrand = 0,
delta_Eunter10km = 0,
delta_E10_25km = 0,
sig = 1)

### Vector with names (in quotes) of parameters to be kept fixed at their starting value in apollo_beta, use apollo_beta_fixed = c() if none
apollo_fixed = c("delta_klein", "sig")

# ################################################################# #
#### GROUP AND VALIDATE INPUTS ####
# ################################################################# #

apollo_inputs = apollo_validateInputs()

# ################################################################# #
#### DEFINE MODEL AND LIKELIHOOD FUNCTION ####
# ################################################################# #

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()

### Define individual alternatives
alternatives = c("small",
"big",
"garden",
"balkony",
"renovated",
"good_location",
"middle_location",
"city",
"suburban",
"center_under10km",
"center_unter25km")

### Define availabilities
avail = list(small= 1,
big = 1,
garden = 1,
balkony = 1,
renovated= 1,
good_location= 1,
middle_location= 1,
city= 1,
suburban = 1,
center_under10km= 1,
center_unter25km = 1)

### Define continuous consumption for individual alternatives
continuousChoice = list(small = D1_1_small_cost,
big = D1_1_big_cost,
garden = D1_2_garden_cost,
balkony = D1_2_balkony_cost,
saniert = D1_3_saniert_cost,
good_location = D1_4_good_location_cost,
middle_location = D1_4_middle_location_cost,
city= D1_5_city_cost,
suburban = D1_5_suburban_cost,
center_under10km= D1_6_center_under10km_cost,
center_unter25km = D1_6_center_unter25km _cost)

### Define utilities for individual alternatives
V = list()
V[["small"]] = delta_small
V[["big"]] = delta_big
V[["garden"]] = delta_garden
V[["balkony"]] = delta_balkony
V[["renovated"]] = delta_renovated
V[["good_location" ]] = delta_good_location
V[["middle_location" ]] = delta_middle_location
V[["city"]] = delta_city
V[["suburban"]] = delta_suburban
V[["Center_under10km" ]] = delta_Center_under10km
V[["Center_unter25km" ]] = delta_Center_unter25km

### Define alpha parameters
alpha = list(small = 1 /(1 + exp(-alpha_base)),
big = 1 /(1 + exp(-alpha_base)),
garden = 1 /(1 + exp(-alpha_base)),
balkony = 1 /(1 + exp(-alpha_base)),
renovated = 1 /(1 + exp(-alpha_base)),
good_location = 1 /(1 + exp(-alpha_base)),
middle_location = 1 /(1 + exp(-alpha_base)),
city = 1 /(1 + exp(-alpha_base)),
suburban = 1 /(1 + exp(-alpha_base)),
Center_under10km = 1 /(1 + exp(-alpha_base)),
Center_unter25km = 1 /(1 + exp(-alpha_base)))

### Define gamma parameters
gamma = list(small = gamma_small,
big = gamma_big,
garden = gamma_garden,
balkony = gamma_balkony,
renovated = gamma_renovated,
good_location = gamma_good_location,
middle_location = gamma_middle_location,
city = gamma_city,
suburban = gamma_suburban,
Center_under10km = gamma_Center_under10km,
Center_unter25km = gamma_Center_unter25km)

### Define costs for individual alternatives
cost = list(small = 1,
big = 1,
garden = 1,
balkony = 1,
renovated = 1,
good_location = 1,
middle_location = 1,
city = 1,
suburban = 1,
Center_under10km = 1,
Center_unter25km = 1)

### Define settings for MDCEV model
mdcev_settings <- list(alternatives = alternatives,
avail = avail,
continuousChoice = continuousChoice,
utilities = V,
alpha = alpha,
gamma = gamma,
sigma = sig,
cost = cost,
budget = budget)

### Compute probabilities using MDCEV model
P[["model"]] = apollo_mdcev(mdcev_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)


ERROR MESSAGE:

R version 4.2.1 (2022-06-23 ucrt) -- "Funny-Looking Kid"
Copyright (C) 2022 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64 (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

[Workspace loaded from G:/VF_Server_neu/Projekte/PJ_laufend/MOBITAT_BMBF_2050/3-Arbeitsunterlagen/1_Empirie/Dokumente/1_1_Pre-Test Dokumente/Datenanalyse/.RData]

> ### Clear memory
> rm(list = ls())
> ### Load Apollo library
> library(apollo)
Apollo 0.2.8
http://www.ApolloChoiceModelling.com
See url for a detailed manual, examples and a user forum.
Sign up to the user forum to receive updates on new releases.
> ### Initialise code
> apollo_initialise()
Apollo ignition sequence completed
> ### Set core controls
> apollo_control = list(
+ modelName = "MDCEV_no_outside_good",
+ modelDescr = "MDCEV model on time use data, alpha-gamma profile, no outside good and constants only in utilities",
+ indivID = "RID",
+ outputDirectory = "output_MDCEV_no_outside_good_test"
+ )
> database <-read.csv("data.csv", sep=",")
> database$budget <- database$D1_1_klein_cost + database$D1_1_gross_cost +
+ database$D1_2_garten_cost + database$D1_2_balkon_cost +
+ database$D1_3_saniert_cost +
+ database$D1_4_gute_WL_cost + database$D1_4_mittlere_WL_cost +
+ database$D1_5_kernbereich_cost + database$D1_5_stadtrand_cost +
+ database$D1_6_unter10km_cost + database$D1_6_10_25km_cost
> database$ID <- c(1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,6,6,6,6,7,7,7,7,8,8,8,8,9,9,9,9,10,10,10,10,
+ 11,11,11,11,12,12,12,12,13,13,13,13,14,14,14,14,15,15,15,15,16,16,16,16,17,17,17,17,
+ 18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,22,22,22,22,23,23,23,23,24,24,24,24,
+ 25,25,25,25,26,26,26,26)
> ### Vector of parameters, including any that are kept fixed in estimation
> apollo_beta = c(alpha_base = 0,
+ gamma_klein = 1,
+ gamma_gross =1,
+ gamma_garten = 1,
+ gamma_balkon = 1,
+ gamma_saniert = 1,
+ gamma_gute_WL = 1,
+ gamma_mittlere_WL = 1,
+ gamma_kernbereich = 1,
+ gamma_stadtrand = 1,
+ gamma_Eunter10km = 1,
+ gamma_E10_25km = 1,
+ delta_klein = 0,
+ delta_gross =0,
+ delta_garten = 0,
+ delta_balkon = 0,
+ delta_saniert = 0,
+ delta_gute_WL = 0,
+ delta_mittlere_WL = 0,
+ delta_kernbereich = 0,
+ delta_stadtrand = 0,
+ delta_Eunter10km = 0,
+ delta_E10_25km = 0,
+ sig = 1)
> ### Vector with names (in quotes) of parameters to be kept fixed at their starting value in apollo_beta, use apollo_beta_fixed = c() if none
> apollo_fixed = c("delta_klein", "sig")
> apollo_inputs = apollo_validateInputs()
Several observations per individual detected based on the value of RID. Setting panelData in
apollo_control set to TRUE.
All checks on apollo_control completed.
All checks on database completed.
> 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()
+
+ ### Define individual alternatives
+ alternatives = c("klein",
+ "gross",
+ "garten",
+ "balkon",
+ "saniert",
+ "gute_WL",
+ "mittlere_WL",
+ "kernbereich",
+ "stadtrand",
+ "Eunter10km",
+ "E10_25km")
+
+ ### Define availabilities
+ avail = list(klein = 1,
+ gross = 1,
+ garten = 1,
+ balkon = 1,
+ saniert = 1,
+ gute_WL = 1,
+ mittlere_WL = 1,
+ kernbereich = 1,
+ stadtrand = 1,
+ Eunter10km = 1,
+ E10_25km = 1)
+
+ ### Define continuous consumption for individual alternatives
+ continuousChoice = list(klein = D1_1_klein_cost,
+ gross = D1_1_gross_cost,
+ garten = D1_2_garten_cost,
+ balkon = D1_2_balkon_cost,
+ saniert = D1_3_saniert_cost,
+ gute_WL = D1_4_gute_WL_cost,
+ mittlere_WL = D1_4_mittlere_WL_cost,
+ kernbereich = D1_5_kernbereich_cost,
+ stadtrand = D1_5_stadtrand_cost,
+ Eunter10km = D1_6_unter10km_cost,
+ E10_25km = D1_6_10_25km_cost)
+
+ ### Define utilities for individual alternatives
+ V = list()
+ V[["klein"]] = delta_klein
+ V[["gross"]] = delta_gross
+ V[["garten"]] = delta_garten
+ V[["balkon"]] = delta_balkon
+ V[["saniert"]] = delta_saniert
+ V[["gute_WL" ]] = delta_gute_WL
+ V[["mittlere_WL" ]] = delta_mittlere_WL
+ V[["kernbereich"]] = delta_kernbereich
+ V[["stadtrand"]] = delta_stadtrand
+ V[["Eunter10km" ]] = delta_Eunter10km
+ V[["E10_25km" ]] = delta_E10_25km
+
+ ### Define alpha parameters
+ alpha = list(klein = 1 /(1 + exp(-alpha_base)),
+ gross = 1 /(1 + exp(-alpha_base)),
+ garten = 1 /(1 + exp(-alpha_base)),
+ balkon = 1 /(1 + exp(-alpha_base)),
+ saniert = 1 /(1 + exp(-alpha_base)),
+ gute_WL = 1 /(1 + exp(-alpha_base)),
+ mittlere_WL = 1 /(1 + exp(-alpha_base)),
+ kernbereich = 1 /(1 + exp(-alpha_base)),
+ stadtrand = 1 /(1 + exp(-alpha_base)),
+ Eunter10km = 1 /(1 + exp(-alpha_base)),
+ E10_25km = 1 /(1 + exp(-alpha_base)))
+
+ ### Define gamma parameters
+ gamma = list(klein = gamma_klein,
+ gross = gamma_gross,
+ garten = gamma_garten,
+ balkon = gamma_balkon,
+ saniert = gamma_saniert,
+ gute_WL = gamma_gute_WL,
+ mittlere_WL = gamma_mittlere_WL,
+ kernbereich = gamma_kernbereich,
+ stadtrand = gamma_stadtrand,
+ Eunter10km = gamma_Eunter10km,
+ E10_25km = gamma_E10_25km)
+
+ ### Define costs for individual alternatives
+ cost = list(klein = 1,
+ gross = 1,
+ garten = 1,
+ balkon = 1,
+ saniert = 1,
+ gute_WL = 1,
+ mittlere_WL = 1,
+ kernbereich = 1,
+ stadtrand = 1,
+ Eunter10km = 1,
+ E10_25km = 1)
+
+ ### Define settings for MDCEV model
+ mdcev_settings <- list(alternatives = alternatives,
+ avail = avail,
+ continuousChoice = continuousChoice,
+ utilities = V,
+ alpha = alpha,
+ gamma = gamma,
+ sigma = sig,
+ cost = cost,
+ budget = budget)
+
+ ### Compute probabilities using MDCEV model
+ P[["model"]] = apollo_mdcev(mdcev_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)
+ }
> model = apollo_estimate(apollo_beta, apollo_fixed, apollo_probabilities, apollo_inputs)
Preparing user-defined functions.

Testing likelihood function...

Overview of choices for model component :
klein gross garten balkon saniert gute_WL mittlere_WL kernbereich stadtrand
Times available 104.00 104.00 104.00 104.00 104.00 104.00 104.00 104.00 104.00
Observations in which chosen 39.00 65.00 61.00 61.00 38.00 34.00 52.00 24.00 54.00
Average consumption when available 122.28 379.47 41.02 51.28 17.98 26.78 19.23 19.45 33.73
Average consumption when chosen 326.08 607.15 69.94 87.43 49.22 81.91 38.45 84.26 64.97
Eunter10km E10_25km
Times available 104.00 104.00
Observations in which chosen 42.00 45.00
Average consumption when available 20.77 18.01
Average consumption when chosen 51.43 41.62

Pre-processing likelihood function...

Testing influence of parameters......................
Starting main estimation
Initial function value: -3631.373
Initial gradient value:
alpha_base gamma_klein gamma_gross gamma_garten gamma_balkon gamma_saniert
310.008546 18.641564 31.148933 25.117023 25.807710 14.729855
gamma_gute_WL gamma_mittlere_WL gamma_kernbereich gamma_stadtrand gamma_Eunter10km gamma_E10_25km
14.248413 20.303388 10.412536 22.432719 16.961248 17.679705
delta_gross delta_garten delta_balkon delta_saniert delta_gute_WL delta_mittlere_WL
36.214052 32.213779 33.060211 -13.174457 -19.939298 2.850260
delta_kernbereich delta_stadtrand delta_Eunter10km delta_E10_25km
-43.741483 13.557549 -11.583511 -7.424772
initial value 3631.373499
iter 2 value 3627.094184
iter 3 value 3551.261709
iter 4 value 3461.811309
iter 5 value 3351.238086
iter 6 value 3292.816982
iter 7 value 3242.163007
iter 8 value 3239.842782
iter 9 value 3229.324466
iter 10 value 3216.825670
iter 11 value 3215.309417
iter 12 value 3208.013001
iter 13 value 3198.831127
iter 14 value 3196.772138
iter 15 value 3187.446528
iter 16 value 3161.650790
iter 17 value 3136.155297
iter 18 value 3093.181253
iter 19 value 3058.688622
iter 20 value 3023.537664
iter 21 value 3012.032459
iter 22 value 3009.546846
iter 23 value 3008.874290
iter 24 value 3008.296977
iter 25 value 3006.946341
iter 26 value 3003.920188
iter 27 value 2997.240663
iter 28 value 2988.630282
iter 29 value 2986.988496
iter 30 value 2984.763083
iter 31 value 2983.999459
iter 32 value 2983.085445
iter 33 value 2980.336736
iter 34 value 2977.785249
iter 35 value 2975.144253
iter 36 value 2973.547920
iter 37 value 2972.988443
iter 38 value 2972.268978
iter 39 value 2970.582076
iter 40 value 2968.312460
iter 41 value 2966.540424
iter 42 value 2965.031050
iter 43 value 2964.337520
iter 44 value 2964.160551
iter 45 value 2964.007760
iter 46 value 2963.918289
iter 47 value 2963.910946
iter 48 value 2963.900066
iter 49 value 2963.885023
iter 50 value 2963.879290
iter 51 value 2963.874619
iter 52 value 2963.780411
iter 53 value 2963.732700
iter 54 value 2963.719142
iter 55 value 2963.643602
iter 56 value 2962.979554
iter 57 value 2962.919040
iter 58 value 2962.725666
iter 59 value 2961.312042
iter 60 value 2961.107937
iter 61 value 2961.080704
iter 62 value 2960.883020
iter 63 value 2960.609131
iter 64 value 2960.234370
iter 65 value 2959.982840
iter 66 value 2959.916180
iter 67 value 2959.873742
iter 68 value 2959.751176
iter 69 value 2959.500478
iter 70 value 2958.975730
iter 71 value 2958.191764
iter 72 value 2957.472874
iter 73 value 2957.159260
iter 74 value 2957.035459
iter 75 value 2956.896229
iter 76 value 2956.518793
iter 77 value 2955.870841
iter 78 value 2955.164347
iter 79 value 2954.735799
iter 80 value 2954.639459
iter 81 value 2954.628541
iter 82 value 2954.615307
iter 83 value 2954.502378
iter 84 value 2954.362899
iter 85 value 2954.243047
iter 86 value 2954.199720
iter 87 value 2954.178322
iter 88 value 2954.147269
iter 89 value 2954.080547
iter 90 value 2953.917498
iter 91 value 2953.535234
iter 92 value 2953.493905
iter 93 value 2953.490905
iter 94 value 2953.475275
iter 95 value 2953.455016
iter 96 value 2953.447755
iter 97 value 2953.446388
iter 98 value 2953.438563
iter 99 value 2953.436141
iter 100 value 2953.430831
iter 101 value 2953.333683
iter 102 value 2953.305802
iter 103 value 2953.291916
iter 104 value 2952.987480
iter 105 value 2952.769049
iter 106 value 2952.753829
iter 107 value 2952.750697
iter 108 value 2952.721391
iter 109 value 2952.676446
iter 110 value 2952.587762
iter 111 value 2952.507329
iter 112 value 2952.467014
iter 113 value 2952.449369
iter 114 value 2952.426844
iter 115 value 2952.369062
iter 116 value 2952.239355
iter 117 value 2951.986895
iter 118 value 2951.670287
iter 119 value 2951.455198
iter 120 value 2951.355931
iter 121 value 2951.342987
iter 122 value 2951.332884
iter 123 value 2951.295412
iter 124 value 2951.238706
iter 125 value 2951.146616
iter 126 value 2951.078404
iter 127 value 2951.054038
iter 128 value 2951.044767
iter 129 value 2951.029047
iter 130 value 2950.992351
iter 131 value 2950.916938
iter 132 value 2950.797328
iter 133 value 2950.671483
iter 134 value 2950.596413
iter 135 value 2950.566731
iter 136 value 2950.524510
iter 137 value 2950.523761
iter 138 value 2950.523013
iter 139 value 2950.510434
iter 140 value 2950.485135
iter 141 value 2950.473100
iter 142 value 2950.470987
iter 143 value 2950.439438
iter 144 value 2950.416164
iter 144 value 2950.416145
iter 145 value 2950.358473
iter 146 value 2950.289706
iter 147 value 2950.282382
iter 148 value 2950.275850
iter 149 value 2950.269936
iter 150 value 2950.269843
iter 151 value 2950.264992
iter 152 value 2950.254507
iter 153 value 2950.253705
iter 154 value 2950.244464
iter 155 value 2950.242593
iter 156 value 2950.242069
iter 157 value 2950.230987
iter 158 value 2950.219173
iter 159 value 2950.199972
iter 160 value 2950.176245
iter 161 value 2950.131246
iter 162 value 2950.077537
iter 163 value 2950.041180
iter 164 value 2950.029777
iter 165 value 2950.025154
iter 166 value 2950.017781
iter 167 value 2950.000373
iter 168 value 2949.963177
iter 169 value 2949.899926
iter 170 value 2949.830751
iter 171 value 2949.792780
iter 172 value 2949.779811
iter 173 value 2949.767820
iter 174 value 2949.741559
iter 175 value 2949.691901
iter 176 value 2949.617779
iter 177 value 2949.552528
iter 178 value 2949.527711
iter 179 value 2949.523838
iter 180 value 2949.520370
iter 181 value 2949.511129
iter 182 value 2949.493025
iter 183 value 2949.462309
iter 184 value 2949.430085
iter 185 value 2949.410768
iter 186 value 2949.402697
iter 187 value 2949.395709
iter 188 value 2949.379144
iter 189 value 2949.339457
iter 190 value 2949.331149
iter 191 value 2949.330364
iter 192 value 2949.330120
iter 193 value 2949.327008
iter 194 value 2949.323148
iter 195 value 2949.322803
iter 196 value 2949.321626
iter 197 value 2949.312449
iter 198 value 2949.311291
iter 199 value 2949.308530
iter 200 value 2949.287143
final value 2949.287143
stopped after 200 iterations
Estimated parameters:
Estimate
alpha_base -15.00335
gamma_klein 475.25876
gamma_gross 502.75974
gamma_garten 33.18200
gamma_balkon 41.81124
gamma_saniert 35.66577
gamma_gute_WL 60.75920
gamma_mittlere_WL 25.50649
gamma_kernbereich 97.03016
gamma_stadtrand 39.68339
gamma_Eunter10km 37.55400
gamma_E10_25km 30.57226
delta_klein 0.00000
delta_gross 0.90955
delta_garten 1.07317
delta_balkon 1.06885
delta_saniert 0.17484
delta_gute_WL 0.02550
delta_mittlere_WL 0.57683
delta_kernbereich -0.49111
delta_stadtrand 0.71882
delta_Eunter10km 0.25007
delta_E10_25km 0.37298
sig 1.00000

Final LL: -2949.2871

#####################################################################################################################
Estimation failed. No covariance matrix to compute.

... current process will resume in 5 seconds unless interrupted by the user
#####################################################################################################################
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...
Warning messages:
1: In log((inputs$continuousChoice[[j]]/inputs$gamma[[j]]) + 1) :
NaNs produced
2: In log(inputs$continuousChoice[[j]] + inputs$gamma[[j]]) :
NaNs produced


OUTPUT (selection:

These outputs have had the scaling used in estimation applied to them.
Estimates:
Estimate s.e. t.rat.(0) Rob.s.e. Rob.t.rat.(0)
alpha_base -15.00335 NA NA NA NA
gamma_small 475.25876 NA NA NA NA
gamma_big 502.75974 NA NA NA NA
gamma_garden 33.18200 NA NA NA NA


Thanks in advance
stephanehess
Site Admin
Posts: 974
Joined: 24 Apr 2020, 16:29

Re: Error MDCEV estimation - covariance matrix cannot be computed

Post by stephanehess »

Hi

if you look at your output, Apollo tells you that the model hasn't converged - you have reached the maximum number of iterations. Please try with a higher limit

Stephane
--------------------------------
Stephane Hess
www.stephanehess.me.uk
user_8888
Posts: 4
Joined: 15 Sep 2022, 13:33

Re: Error MDCEV estimation - covariance matrix cannot be computed

Post by user_8888 »

Dear Stephane,

I´ve used now 1.000 iterations. Unfortunately, I still get the warnings:

1: In log((inputs$continuousChoice[[j]]/inputs$gamma[[j]]) + ... : NaNs produced
2: In log(inputs$continuousChoice[[j]] + inputs$gamma[[j]]) : NaNs produced
3: In log((inputs$continuousChoice[[j]]/inputs$gamma[[j]]) + ... : NaNs produced
4: In log(inputs$continuousChoice[[j]] + inputs$gamma[[j]]) : NaNs produced
5: ....

I am wondering if this can be due to the study design? The "cost" (i.e., the continuous variables) have individual values (e.g. 300€ for a garden), but they are calculated as percentage of the qm-size of the chosen flat. Could this be the problem? (we have indeed individual continuous values, but they follow certain pattern, i.e., people can choose whether they want a garden or not BUT not really how much does it cost?)

Thanks in advance for the reply. Somehow I cannot move forward!
stephanehess
Site Admin
Posts: 974
Joined: 24 Apr 2020, 16:29

Re: Error MDCEV estimation - covariance matrix cannot be computed

Post by stephanehess »

Hi

that's a warning that happens commonly when using logistic transform. It means that in some iterations, the estimation process used values that led to NA, but it recovered from that. The key question is whether your model converged in the end?

Stephane
--------------------------------
Stephane Hess
www.stephanehess.me.uk
user_8888
Posts: 4
Joined: 15 Sep 2022, 13:33

Re: Error MDCEV estimation - covariance matrix cannot be computed

Post by user_8888 »

Dear Stephane,

it works now! Thanks!

I´ve increased again the iteration number and it does not produce NAs anamore.

Many thanks for the support.
ramkumar
Posts: 5
Joined: 02 Jun 2023, 16:53

Re: Error MDCEV estimation - covariance matrix cannot be computed

Post by ramkumar »

stephanehess wrote: 15 Sep 2022, 19:03 Hi

if you look at your output, Apollo tells you that the model hasn't converged - you have reached the maximum number of iterations. Please try with a higher limit

Stephane
Dr. Hess,

What is "a higher limit" mean? Do you mean we should increase the number of draws?

Ram
stephanehess
Site Admin
Posts: 974
Joined: 24 Apr 2020, 16:29

Re: Error MDCEV estimation - covariance matrix cannot be computed

Post by stephanehess »

Ram

it relates to the number of iterations for the estimation algorithm, nothing to do with draws. This is explained in the manual, and also at http://apollochoicemodelling.com/faq.html

Best wishes

Stephane
--------------------------------
Stephane Hess
www.stephanehess.me.uk
ramkumar
Posts: 5
Joined: 02 Jun 2023, 16:53

Re: Error MDCEV estimation - covariance matrix cannot be computed

Post by ramkumar »

Thank you. I understood it now.
Ram
Post Reply