Page 1 of 1

Apollo not properly loading (I believe)

Posted: 22 Nov 2023, 22:54
by ha.ortiz10
Hi
I use r 4.3.2. on RStudio
I installed apollo 0.3.1, and 0.2.9.
After running library(apollo), it is loaded but with the next message:

> library(apollo)


. ,,
, ,,
,,,,,, , ,,
, ,, , ,,,,.
,, , ,, ,,,,,, ,,, // //
, ,,,. ,,,,,. ,, //// // //
,, ,,,,,. ,, // // ////// ///// // // /////
,,, ,, , // // / // // // // // // //
,, , //////// / // // // // // // //
,, ,, // // / /// // // // // // //
, // // ///// /// // // ///
//
//

Apollo 0.3.1
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.

Please cite Apollo in all written material you produce:
Hess S, Palma D (2019). "Apollo: a flexible, powerful and customisable
freeware package for choice model estimation and application." Journal
of Choice Modelling, 32. doi:10.1016/j.jocm.2019.100170
Warning message:
In .recacheSubclasses(def@className, def, env) :
undefined subclass "ndiMatrix" of class "replValueSp"; definition not updated


Also (I do not know if it is related) I tried to run the example "MDCEV model on time use data, alpha-gamma profile with outside good and socio-demographics" (I ran the example exactly as appears in the apollo examples page) and while estimating, I get:

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...
Computing covariance matrix using numerical methods (numDeriv).
0%....25%....50%....75%....100%
WARNING: Singular Hessian, cannot calculate s.e.
Hessian written to output/MDCEV_with_outside_good_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 10.1145/151271.151279
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
> apollo_modelOutput(model)
Model run by haort 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 : MDCEV_with_outside_good
Model description : MDCEV model on time use data, alpha-gamma profile with outside good and socio-demographics
Model run at : 2023-11-22 17:50:59.58616
Estimation method : bgw
Model diagnosis : Relative function convergence
Optimisation diagnosis : Saddle point found
hessian properties : Some eigenvalues are positive and others negative
maximum eigenvalue : 0
reciprocal of condition number : not calculated (Hessian is not negative definite)
Number of individuals : 447
Number of rows in database : 2826
Number of modelled outcomes : 2826

Number of cores used : 1
Model without mixing

LL(start) : -21594.92
LL at equal shares, LL(0) : NA
LL at observed shares, LL(C) : NA
LL(final) : -15007.36
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 : 30044.72
BIC : 30133.92

Estimated parameters : 15
Time taken (hh:mm:ss) : 00:00:33.44
pre-estimation : 00:00:1.19
estimation : 00:00:14.75
post-estimation : 00:00:17.5
Iterations : 36

Unconstrained optimisation.

Estimates:
Estimate s.e. t.rat.(0) Rob.s.e. Rob.t.rat.(0)
alpha_base -911.5129 NA NA NA NA
gamma_work 4.8990 NA NA NA NA
gamma_school 3.0985 NA NA NA NA
gamma_shopping 0.4264 NA NA NA NA
gamma_private 0.6200 NA NA NA NA
gamma_leisure 2.0958 NA NA NA NA
delta_work -3.7172 NA NA NA NA
delta_school -7.4183 NA NA NA NA
delta_shopping -3.8044 NA NA NA NA
delta_private -4.2786 NA NA NA NA
delta_leisure -3.4001 NA NA NA NA
delta_work_FT 1.3248 NA NA NA NA
delta_work_wknd -2.8609 NA NA NA NA
delta_school_young 2.3442 NA NA NA NA
delta_leisure_wknd 0.2949 NA NA NA NA
sig 1.0000 NA NA NA NA

Re: Apollo not properly loading (I believe)

Posted: 04 Dec 2023, 10:56
by stephanehess
Hi

thanks for alerting us to this. With the new optimiser (BGW), the model correctly identifies an issue with the estimation of alpha_base, as this tends to -inf. If you now fix this to a large negative value by settingt the value in apollo_beta to e.g. the solution it goes to, and including the parameter name in apollo_fixed, everything should work

Thanks

Stephane & David