MDCEV_with_outside_good example fails
Posted: 04 Apr 2025, 08:23
Dear Professor,
I am working through your MDCEV examples to prepare for my latest research as well as your advanced modeling course.
However, the second example fails: the one with the outside good and sociodemographic variables?
I can get it working when assuming alpha_k = 0, so maybe it is an identification issue related to the outside good?
This is the code: https://www.apollochoicemodelling.com/f ... ide_good.r.
I ran it without modification in Apollo 0.3.5.
See the relevant output below.
Best regards,
Chris ten Dam
xxxxxxxxxxxxxxxxxxxxxx
WARNING: Singular Hessian, cannot calculate s.e.
Hessian written to
output/MDCEV_withOutsideGoodandSDs_example_originalFile_hessian.csv
WARNING: Some eigenvalues of the Hessian are positive, indicating convergence to
a saddle point!
Computing score matrix...
Your model was estimated using the BGW algorithm. Please acknowledge
this by citing Bunch et al. (1993) - doi.org/10.1145/151271.151279
Please acknowledge the use of Apollo by citing Hess & Palma (2019) -
doi.org/10.1016/j.jocm.2019.100170
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
3: In log((inputs$continuousChoice[[j]]/inputs$gamma[[j]]) + 1) :
NaNs produced
4: In log(inputs$continuousChoice[[j]] + inputs$gamma[[j]]) :
NaNs produced
5: In log((inputs$continuousChoice[[j]]/inputs$gamma[[j]]) + 1) :
NaNs produced
6: In log(inputs$continuousChoice[[j]] + inputs$gamma[[j]]) :
NaNs produced
7: In log((inputs$continuousChoice[[j]]/inputs$gamma[[j]]) + 1) :
NaNs produced
8: In log(inputs$continuousChoice[[j]] + inputs$gamma[[j]]) :
NaNs produced
...
Unconstrained optimisation.
Estimates:
Estimate s.e. t.rat.(0) Rob.s.e.
alpha_base -911.5129 NA NA NA
gamma_work 4.8990 NA NA NA
gamma_school 3.0985 NA NA NA
gamma_shopping 0.4264 NA NA NA
gamma_private 0.6200 NA NA NA
gamma_leisure 2.0958 NA NA NA
delta_work -3.7172 NA NA NA
delta_school -7.4183 NA NA NA
delta_shopping -3.8044 NA NA NA
delta_private -4.2786 NA NA NA
delta_leisure -3.4001 NA NA NA
delta_work_FT 1.3248 NA NA NA
delta_work_wknd -2.8609 NA NA NA
delta_school_young 2.3442 NA NA NA
delta_leisure_wknd 0.2949 NA NA NA
sig 1.0000 NA NA NA
Rob.t.rat.(0)
alpha_base NA
gamma_work NA
gamma_school NA
gamma_shopping NA
gamma_private NA
gamma_leisure NA
delta_work NA
delta_school NA
delta_shopping NA
delta_private NA
delta_leisure NA
delta_work_FT NA
delta_work_wknd NA
delta_school_young NA
delta_leisure_wknd NA
sig NA
I am working through your MDCEV examples to prepare for my latest research as well as your advanced modeling course.
However, the second example fails: the one with the outside good and sociodemographic variables?
I can get it working when assuming alpha_k = 0, so maybe it is an identification issue related to the outside good?
This is the code: https://www.apollochoicemodelling.com/f ... ide_good.r.
I ran it without modification in Apollo 0.3.5.
See the relevant output below.
Best regards,
Chris ten Dam
xxxxxxxxxxxxxxxxxxxxxx
WARNING: Singular Hessian, cannot calculate s.e.
Hessian written to
output/MDCEV_withOutsideGoodandSDs_example_originalFile_hessian.csv
WARNING: Some eigenvalues of the Hessian are positive, indicating convergence to
a saddle point!
Computing score matrix...
Your model was estimated using the BGW algorithm. Please acknowledge
this by citing Bunch et al. (1993) - doi.org/10.1145/151271.151279
Please acknowledge the use of Apollo by citing Hess & Palma (2019) -
doi.org/10.1016/j.jocm.2019.100170
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
3: In log((inputs$continuousChoice[[j]]/inputs$gamma[[j]]) + 1) :
NaNs produced
4: In log(inputs$continuousChoice[[j]] + inputs$gamma[[j]]) :
NaNs produced
5: In log((inputs$continuousChoice[[j]]/inputs$gamma[[j]]) + 1) :
NaNs produced
6: In log(inputs$continuousChoice[[j]] + inputs$gamma[[j]]) :
NaNs produced
7: In log((inputs$continuousChoice[[j]]/inputs$gamma[[j]]) + 1) :
NaNs produced
8: In log(inputs$continuousChoice[[j]] + inputs$gamma[[j]]) :
NaNs produced
...
Unconstrained optimisation.
Estimates:
Estimate s.e. t.rat.(0) Rob.s.e.
alpha_base -911.5129 NA NA NA
gamma_work 4.8990 NA NA NA
gamma_school 3.0985 NA NA NA
gamma_shopping 0.4264 NA NA NA
gamma_private 0.6200 NA NA NA
gamma_leisure 2.0958 NA NA NA
delta_work -3.7172 NA NA NA
delta_school -7.4183 NA NA NA
delta_shopping -3.8044 NA NA NA
delta_private -4.2786 NA NA NA
delta_leisure -3.4001 NA NA NA
delta_work_FT 1.3248 NA NA NA
delta_work_wknd -2.8609 NA NA NA
delta_school_young 2.3442 NA NA NA
delta_leisure_wknd 0.2949 NA NA NA
sig 1.0000 NA NA NA
Rob.t.rat.(0)
alpha_base NA
gamma_work NA
gamma_school NA
gamma_shopping NA
gamma_private NA
gamma_leisure NA
delta_work NA
delta_school NA
delta_shopping NA
delta_private NA
delta_leisure NA
delta_work_FT NA
delta_work_wknd NA
delta_school_young NA
delta_leisure_wknd NA
sig NA