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.

Example 2 does not run

Ask questions about existing examples and put in requests to software developers and users for other example implementations of models.
Post Reply
firstenor
Posts: 8
Joined: 11 Aug 2021, 20:24

Example 2 does not run

Post by firstenor »

I am running a new installation of 2.5. Example 1 ran OK, but Example 2 crashed. Output shown below.


Preparing bootstrap.
Parameters and LL in each repetition will be written to: Apollo_example_2_bootstrap_params.csv
Vectors showing sampling rate for each observation in each repetition written to:
Apollo_example_2_bootstrap_samples.csv

Estimation cycle 1 (7000 obs)

Error in apollo_estimate(apollo_beta, apollo_fixed, apollo_probabilities, :
Log-likelihood calculation fails at values close to the starting values!
dpalma
Posts: 190
Joined: 24 Apr 2020, 17:54

Re: Example 2 does not run

Post by dpalma »

Hi,

Example 2, as presented in the webpage, does not include bootstrap, so I am guessing you modified the example to include it. Could you share your code? Then I can reproduce the problem and help you fix it.

Cheers
David
firstenor
Posts: 8
Joined: 11 Aug 2021, 20:24

Re: Example 2 does not run

Post by firstenor »

I just started using Apollo. I wouldn't know how to modify the code. I downloaded the example files from http://www.apollochoicemodelling.com/fi ... v0.2.4.zip, opened Apollo_example_2.r in RStudio, and ran it. Example 1 ran without a hitch. Example 2 lines 113 to 118 include a bootstrap setting.

113 # ################################################################# #
114 #### MODEL ESTIMATION ####
115 # ################################################################# #
116
117 model = apollo_estimate(apollo_beta, apollo_fixed, apollo_probabilities, apollo_inputs,
118 estimate_settings = list(bootstrapSE=30))
dpalma
Posts: 190
Joined: 24 Apr 2020, 17:54

Re: Example 2 does not run

Post by dpalma »

Hi,

You are right that there's a problem when running bootstrap from inside apollo_estimate. It is apparently a bug introduced in v0.2.5. Thank you for pointing it out to us.

You can do any of two thing to avoid the problem. The first alternative is simply to not do bootstrapping. To do this, you just have to change the call to apollo_estimate to the following:

Code: Select all

model = apollo_estimate(apollo_beta, apollo_fixed, apollo_probabilities, apollo_inputs)
If you still want to do bootstrap, then you can first estimate the model, and then do the bootstrapping, as follows:

Code: Select all

model = apollo_estimate(apollo_beta, apollo_fixed, apollo_probabilities, apollo_inputs)
boot = apollo_bootstrap(apollo_beta, apollo_fixed, apollo_probabilities, apollo_inputs)
sqrt(diag(boot$varcov)) # bootstrap s.e. of parameters
We'll fix this in the next version.

Cheers
David
firstenor
Posts: 8
Joined: 11 Aug 2021, 20:24

Re: Example 2 does not run

Post by firstenor »

This is great software support. I'm looking forward to using Apollo for advanced choice modeling.
Post Reply