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.

Search found 14 matches

by victornielsen
25 Apr 2023, 13:17
Forum: Errors during model validation and/or estimation.
Topic: Getting error: Error in maxOptim(fn=fn, grad=grad, hess=hess, start=start, method="BFGS",:NA in the initial gradient
Replies: 9
Views: 1937

Re: Getting error: Error in maxOptim(fn=fn, grad=grad, hess=hess, start=start, method="BFGS",:NA in the initial gradient

No problem.

There are 4 models. Each has a dependent variable that may exist in the other 4 models. To solve this issue we incorporate a mixed logit model to account for their errors. So they are not independent and independent within the same model.
by victornielsen
02 Feb 2023, 15:11
Forum: Errors during model validation and/or estimation.
Topic: Getting error: Error in maxOptim(fn=fn, grad=grad, hess=hess, start=start, method="BFGS",:NA in the initial gradient
Replies: 9
Views: 1937

Re: Getting error: Error in maxOptim(fn=fn, grad=grad, hess=hess, start=start, method="BFGS",:NA in the initial gradient

The 4 models each has a dependent variables. Each of the 4 model uses the other models' dependent variables as independent variables. This is why the mixed logit is done. Since not all of these were significant, in some of these models, one or more variables are omitted. Could the error be that I al...
by victornielsen
19 Jan 2023, 15:18
Forum: Errors during model validation and/or estimation.
Topic: Getting error: Error in maxOptim(fn=fn, grad=grad, hess=hess, start=start, method="BFGS",:NA in the initial gradient
Replies: 9
Views: 1937

Re: Getting error: Error in maxOptim(fn=fn, grad=grad, hess=hess, start=start, method="BFGS",:NA in the initial gradient

To rephrase my last message. It worked in the sense that it is not producing an error, but all my t-ratios and p-values are NaN now.
Could you tell me if it's a problem with the data or a problem with the code?
by victornielsen
16 Jan 2023, 16:39
Forum: Errors during model validation and/or estimation.
Topic: Getting error: Error in maxOptim(fn=fn, grad=grad, hess=hess, start=start, method="BFGS",:NA in the initial gradient
Replies: 9
Views: 1937

Getting error: Error in maxOptim(fn=fn, grad=grad, hess=hess, start=start, method="BFGS",:NA in the initial gradient

I get the error: Error in maxOptim(fn = fn, grad = grad, hess = hess, start = start, method = "BFGS", : NA in the initial gradient In addition: There were 26 warnings (use warnings() to see them) When running my model. I could not find any google answers to solve it. Any help would be grea...
by victornielsen
05 Jan 2023, 15:04
Forum: Model specification
Topic: Error when compiling utility function into a variable
Replies: 1
Views: 3242

Error when compiling utility function into a variable

I have this code below that works: library(apollo) library(haven) library(plyr) library(dplyr) library(labelled) library(tidyverse) randstad <- c( #b_randstad_is = 0, b_randstad_not = 0, b_randstad_to = 0, b_randstad_from = 0 ) wdist <- c( b_weekdist_dec = 0, b_weekdist_inc = 0, b_weekdist_same = 0,...
by victornielsen
14 Dec 2022, 17:21
Forum: Model specification
Topic: More efficient way of doing a step-wise approach?
Replies: 1
Views: 840

More efficient way of doing a step-wise approach?

I have a model with a lot of dummy variables. There are about 6 control variables - each with on average 5 dummies. the 6 control variables leaves 63 combinations of models. My process right now would look like commenting off each variable individually and running the model. Is there any way to auto...
by victornielsen
09 Aug 2022, 14:29
Forum: Errors during model validation and/or estimation.
Topic: Error when using mixed logit with only one observation per individual
Replies: 6
Views: 2870

Error when using mixed logit with only one observation per individual

Hello I am trying to build a mixed ordered logit model with a random error term. This is my model: #### nautos #### # ################################################################# # #### LOAD LIBRARY AND DEFINE CORE SETTINGS #### # ################################################################...