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.

Getting NAs in hybrid model estimation

Ask questions about errors you encouunter. Please make sure to include full details about your model specifications, and ideally your model file.
Post Reply
zx9203
Posts: 24
Joined: 13 Jun 2020, 09:52

Getting NAs in hybrid model estimation

Post by zx9203 »

Hi Stephane and David,

I'm estimating a hybrid model. The latent variable, FNS, has 9 statements and each of them is of 7-point Likert Scale. Following your sample, I wrote the code like:

Code: Select all

# ################################################################# #
#### LOAD LIBRARY AND DEFINE CORE SETTINGS                       ####
# ################################################################# #

### Clear memory
rm(list = ls())

### Load Apollo library
library(apollo)

### Initialise code
apollo_initialise()

### Set core controls
apollo_control = list(
  modelName       = "rice_Hybrid_with_OL",
  modelDescr      = "Hybrid choice model on rice choice data, using ordered measurement model for indicators",
  indivID         = "id",
  nCores          = 10
)

# ################################################################# #
#### LOAD DATA AND APPLY ANY TRANSFORMATIONS                     ####
# ################################################################# #

### Loading data from package
### if data is to be loaded from a file (e.g. called data.csv), 
### the code would be: database = read.csv("data.csv",header=TRUE)
database = read.csv("D:/2023/3、院长基金/0722 main data/ricedata_main.csv",header=TRUE)

# ################################################################# #
#### ANALYSIS OF CHOICES                                         ####
# ################################################################# #

### Illustration of how to use apollo_choiceAnalysis with user-defined alternatives.
### This is useful in cases where the alternatives in the data differ 
### across tasks. The same approach can then also be used with unlabelled data

choiceAnalysis_settings <- list(
  alternatives = c(option_1=1, option_2=2, option_3=3, option_4=4),
  avail        = 1,
  choiceVar    = database$choice,
  explanators  = database[,c("edu","age","marry","income","gender")]
)

apollo_choiceAnalysis(choiceAnalysis_settings, apollo_control, database)

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

### Vector of parameters, including any that are kept fixed in estimation
apollo_beta = c(asc_non_purchase   = -1.52, 
                b_white            = -0.05, 
                b_brown            = -0.17,
                b_organic          = 0.57, 
                b_brand            = 0.13,
                b_lowGI            = 0.99, 
                b_lowgluten        = 0.98, 
                b_enhanced         = 1.38, 
                b_price            = -0.06,  
                lambda             = 1, 
                gamma_ricehabit    = 0,
                gamma_younger      = 0, 
                gamma_bachelor     = 0,
                gamma_kid          = 0,
                gamma_highincome   = 0,
                gamma_gender       = 0,
                zeta_FNS1          = 0,
                zeta_FNS2          = 0,
                zeta_FNS3          = 0,
                zeta_FNS4          = 0,
                zeta_FNS5          = 0,
                zeta_FNS6          = 0,
                zeta_FNS7          = 0,
                zeta_FNS8          = 0,
                zeta_FNS9          = 0,
                tau_FNS1_1         = -3, 
                tau_FNS1_2         = -2, 
                tau_FNS1_3         = -1,
                tau_FNS1_4         = 1,
                tau_FNS1_5         = 2,
                tau_FNS1_6         = 3,
                tau_FNS2_1         = -3, 
                tau_FNS2_2         = -2, 
                tau_FNS2_3         = -1,
                tau_FNS2_4         = 1,
                tau_FNS2_5         = 2,
                tau_FNS2_6         = 3,
                tau_FNS3_1         = -3, 
                tau_FNS3_2         = -2, 
                tau_FNS3_3         = -1,
                tau_FNS3_4         = 1,
                tau_FNS3_5         = 2,
                tau_FNS3_6         = 3,
                tau_FNS4_1         = -3, 
                tau_FNS4_2         = -2, 
                tau_FNS4_3         = -1,
                tau_FNS4_4         = 1,
                tau_FNS4_5         = 2,
                tau_FNS4_6         = 3,
                tau_FNS5_1         = -3, 
                tau_FNS5_2         = -2, 
                tau_FNS5_3         = -1,
                tau_FNS5_4         = 1,
                tau_FNS5_5         = 2,
                tau_FNS5_6         = 3,
                tau_FNS6_1         = -3, 
                tau_FNS6_2         = -2, 
                tau_FNS6_3         = -1,
                tau_FNS6_4         = 1,
                tau_FNS6_5         = 2,
                tau_FNS6_6         = 3,
                tau_FNS7_1         = -3, 
                tau_FNS7_2         = -2, 
                tau_FNS7_3         = -1,
                tau_FNS7_4         = 1,
                tau_FNS7_5         = 2,
                tau_FNS7_6         = 3,
                tau_FNS8_1         = -3, 
                tau_FNS8_2         = -2, 
                tau_FNS8_3         = -1,
                tau_FNS8_4         = 1,
                tau_FNS8_5         = 2,
                tau_FNS8_6         = 3,
                tau_FNS9_1         = -3, 
                tau_FNS9_2         = -2, 
                tau_FNS9_3         = -1,
                tau_FNS9_4         = 1,
                tau_FNS9_5         = 2,
                tau_FNS9_6         = 3
                )
### 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()

# ################################################################# #
#### DEFINE RANDOM COMPONENTS                                    ####
# ################################################################# #

### Set parameters for generating draws
apollo_draws = list(
  interDrawsType="halton", 
  interNDraws=100,          
  interUnifDraws=c(),      
  interNormDraws=c("eta"), 
  
  intraDrawsType="",
  intraNDraws=0,          
  intraUnifDraws=c(),     
  intraNormDraws=c()      
)

### Create random parameters
apollo_randCoeff=function(apollo_beta, apollo_inputs){
  randcoeff = list()
  
  randcoeff[["LV"]] = gamma_ricehabit * (ricehabit>3) + gamma_younger * (age<2) + gamma_bachelor * edu + gamma_kid * (marry==2|marry==4) + gamma_highincome * (income>1) + gamma_gender * gender + eta
  
  return(randcoeff)
}

# ################################################################# #
#### 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()
  
  ### Likelihood of indicators
  ol_settings1 = list(outcomeOrdered = FNS1, 
                      V              = zeta_FNS1*LV, 
                      tau            = list(tau_FNS1_1, tau_FNS1_2, tau_FNS1_3, tau_FNS1_4, tau_FNS1_5, tau_FNS1_6),
                      rows           = (task==1|task==2),
                      componentName  = "indic_FNS1")
  ol_settings2 = list(outcomeOrdered = FNS1, 
                      V              = zeta_FNS2*LV, 
                      tau            = list(tau_FNS2_1, tau_FNS2_2, tau_FNS2_3, tau_FNS2_4, tau_FNS2_5, tau_FNS2_6),
                      rows           = (task==1|task==2),
                      componentName  = "indic_FNS2")
  ol_settings3 = list(outcomeOrdered = FNS3, 
                      V              = zeta_FNS3*LV, 
                      tau            = list(tau_FNS3_1, tau_FNS3_2, tau_FNS3_3, tau_FNS3_4, tau_FNS3_5, tau_FNS3_6),
                      rows           = (task==1|task==2),
                      componentName  = "indic_FNS3")
  ol_settings4 = list(outcomeOrdered = FNS4, 
                      V              = zeta_FNS4*LV, 
                      tau            = list(tau_FNS4_1, tau_FNS4_2, tau_FNS4_3, tau_FNS4_4, tau_FNS4_5, tau_FNS4_6),
                      rows           = (task==1|task==2),
                      componentName  = "indic_FNS4")
  ol_settings5 = list(outcomeOrdered = FNS5, 
                      V              = zeta_FNS5*LV, 
                      tau            = list(tau_FNS5_1, tau_FNS5_2, tau_FNS5_3, tau_FNS5_4, tau_FNS5_5, tau_FNS5_6),
                      rows           = (task==1|task==2),
                      componentName  = "indic_FNS5") 
  ol_settings6 = list(outcomeOrdered = FNS6, 
                      V              = zeta_FNS6*LV, 
                      tau            = list(tau_FNS6_1, tau_FNS6_2, tau_FNS6_3, tau_FNS6_4, tau_FNS6_5, tau_FNS6_6),
                      rows           = (task==1|task==2),
                      componentName  = "indic_FNS6")
  ol_settings7 = list(outcomeOrdered = FNS7, 
                      V              = zeta_FNS7*LV, 
                      tau            = list(tau_FNS7_1, tau_FNS7_2, tau_FNS7_3, tau_FNS7_4, tau_FNS7_5, tau_FNS7_6),
                      rows           = (task==1|task==2),
                      componentName  = "indic_FNS7")
  ol_settings8 = list(outcomeOrdered = FNS8, 
                      V              = zeta_FNS8*LV, 
                      tau            = list(tau_FNS8_1, tau_FNS8_2, tau_FNS8_3, tau_FNS8_4, tau_FNS8_5, tau_FNS8_6),
                      rows           = (task==1|task==2),
                      componentName  = "indic_FNS8")
  ol_settings9 = list(outcomeOrdered = FNS9, 
                      V              = zeta_FNS9*LV, 
                      tau            = list(tau_FNS9_1, tau_FNS9_2, tau_FNS9_3, tau_FNS9_4, tau_FNS9_5, tau_FNS9_6),
                      rows           = (task==1|task==2),
                      componentName  = "indic_FNS9")
  P[["indic_FNS1"]] = apollo_ol(ol_settings1, functionality)
  P[["indic_FNS2"]] = apollo_ol(ol_settings2, functionality)
  P[["indic_FNS3"]] = apollo_ol(ol_settings3, functionality)
  P[["indic_FNS4"]] = apollo_ol(ol_settings4, functionality)
  P[["indic_FNS5"]] = apollo_ol(ol_settings5, functionality)
  P[["indic_FNS6"]] = apollo_ol(ol_settings6, functionality)
  P[["indic_FNS7"]] = apollo_ol(ol_settings7, functionality)
  P[["indic_FNS8"]] = apollo_ol(ol_settings8, functionality)
  P[["indic_FNS9"]] = apollo_ol(ol_settings9, functionality)
  
  ### Likelihood of choices
  ### List of utilities: these must use the same names as in mnl_settings, order is irrelevant
  V = list()
  V[['option_1']]  = b_white * (white_1==0) + b_brown * (white_1==2) + b_organic * organic_1 + b_brand * brand_1 + b_lowGI * (health_1==1) + b_lowgluten * (health_1==2) + b_enhanced * (health_1==3) + b_price * price_1 + lambda * LV
  V[['option_2']]  = b_white * (white_2==0) + b_brown * (white_2==2) + b_organic * organic_2 + b_brand * brand_2 + b_lowGI * (health_2==1) + b_lowgluten * (health_2==2) + b_enhanced * (health_2==3) + b_price * price_2 + lambda * LV  
  V[['option_3']]  = b_white * (white_3==0) + b_brown * (white_3==2) + b_organic * organic_3 + b_brand * brand_3 + b_lowGI * (health_3==1) + b_lowgluten * (health_3==2) + b_enhanced * (health_3==3) + b_price * price_3 + lambda * LV  
  V[['option_4']]  = asc_non_purchase
  
  ### Define settings for MNL model component
  mnl_settings = list(
    alternatives  = c('option_1'=1, 'option_2'=2, 'option_3'=3, 'option_4'=4),
    avail         = 1,
    choiceVar     = choice,
    utilities     = V,
    componentName = "choice"
  ) 
  
  ### Compute probabilities for MNL model component
  P[["choice"]] = apollo_mnl(mnl_settings, functionality)
  
  ### Likelihood of the whole model
  P = apollo_combineModels(P, apollo_inputs, functionality)
  
  ### Take product across observation for same individual
  P = apollo_panelProd(P, apollo_inputs, functionality)
  
  ### Average across inter-individual draws
  P = apollo_avgInterDraws(P, apollo_inputs, functionality)
  
  ### Prepare and return outputs of function
  P = apollo_prepareProb(P, apollo_inputs, functionality)
  return(P)
}

# ################################################################# #
#### MODEL ESTIMATION                                            ####
# ################################################################# #

### Optional: calculate LL before model estimation
# apollo_llCalc(apollo_beta, apollo_probabilities, apollo_inputs)

### Estimate model
model = apollo_estimate(apollo_beta, apollo_fixed, apollo_probabilities, apollo_inputs)

# ################################################################# #
#### MODEL OUTPUTS                                               ####
# ################################################################# #

# ----------------------------------------------------------------- #
#---- FORMATTED OUTPUT (TO SCREEN)                               ----
# ----------------------------------------------------------------- #

apollo_modelOutput(model)

# ----------------------------------------------------------------- #
#---- FORMATTED OUTPUT (TO FILE, using model name)               ----
# ----------------------------------------------------------------- #

apollo_saveOutput(model)
However, I'm encountered with NA in the results:

Model name : rice_Hybrid_with_OL
Model description : Hybrid choice model on rice choice data, using ordered measurement model for indicators
Model run at : 2023-09-12 09:36:03.126313
Estimation method : bgw
Model diagnosis : Function evaluation limit
Number of individuals : 1666
Number of rows in database : 19992
Number of modelled outcomes : 34986
indic_FNS1 : 1666
indic_FNS2 : 1666
indic_FNS3 : 1666
indic_FNS4 : 1666
indic_FNS5 : 1666
indic_FNS6 : 1666
indic_FNS7 : 1666
indic_FNS8 : 1666
indic_FNS9 : 1666
choice : 19992

Number of cores used : 10
Number of inter-individual draws : 100 (halton)

LL(start) : -52758.58
LL (whole model) at equal shares, LL(0) : -56891.77
LL (whole model) at observed shares, LL(C) : -49306.69
LL(final, whole model) : -43988.96
Rho-squared vs equal shares : 0.2268
Adj.Rho-squared vs equal shares : 0.2254
Rho-squared vs observed shares : 0.1078
Adj.Rho-squared vs observed shares : 0.1074
AIC : 88135.93
BIC : 88563.96

LL(0,indic_FNS1) : -3241.89
LL(final,indic_FNS1) : -2539.81
LL(0,indic_FNS2) : -3241.89
LL(final,indic_FNS2) : -2539.78
LL(0,indic_FNS3) : -3241.89
LL(final,indic_FNS3) : -2980.73
LL(0,indic_FNS4) : -3241.89
LL(final,indic_FNS4) : -2695.38
LL(0,indic_FNS5) : -3241.89
LL(final,indic_FNS5) : -2849.14
LL(0,indic_FNS6) : -3241.89
LL(final,indic_FNS6) : -2454.93
LL(0,indic_FNS7) : -3241.89
LL(final,indic_FNS7) : -2867.42
LL(0,indic_FNS8) : -3241.89
LL(final,indic_FNS8) : -2977.32
LL(0,indic_FNS9) : -3241.89
LL(final,indic_FNS9) : -3009.63
LL(0,choice) : -27714.8
LL(final,choice) : -22300.22

Estimated parameters : 79
Time taken (hh:mm:ss) : 05:02:0.79
pre-estimation : 00:03:10.06
estimation : 04:58:48.38
post-estimation : 00:00:2.35
Iterations : 175 (Function evaluation limit)

Unconstrained optimisation.

Estimates:
Estimate s.e. t.rat.(0) Rob.s.e. Rob.t.rat.(0)
asc_non_purchase -1.29513 NA NA NA NA
b_white -0.05163 NA NA NA NA
b_brown -0.16526 NA NA NA NA
b_organic 0.57331 NA NA NA NA
b_brand 0.13023 NA NA NA NA
b_lowGI 0.99513 NA NA NA NA
b_lowgluten 0.98145 NA NA NA NA
b_enhanced 1.38365 NA NA NA NA
b_price -0.06220 NA NA NA NA
lambda 0.28663 NA NA NA NA
gamma_ricehabit 0.06744 NA NA NA NA
gamma_younger 0.40673 NA NA NA NA
gamma_bachelor 0.09274 NA NA NA NA
gamma_kid 0.57793 NA NA NA NA
gamma_highincome 0.30278 NA NA NA NA
gamma_gender -0.28951 NA NA NA NA
zeta_FNS1 -133.70525 NA NA NA NA
zeta_FNS2 -133.12048 NA NA NA NA
zeta_FNS3 -0.94227 NA NA NA NA
zeta_FNS4 -1.17331 NA NA NA NA
zeta_FNS5 -0.90060 NA NA NA NA
zeta_FNS6 -1.00139 NA NA NA NA
zeta_FNS7 -0.92775 NA NA NA NA
zeta_FNS8 -0.40808 NA NA NA NA
zeta_FNS9 -0.67639 NA NA NA NA
tau_FNS1_1 -297.26447 NA NA NA NA
tau_FNS1_2 -163.25145 NA NA NA NA
tau_FNS1_3 -23.15217 NA NA NA NA
tau_FNS1_4 59.93685 NA NA NA NA
tau_FNS1_5 121.48347 NA NA NA NA
tau_FNS1_6 180.66530 NA NA NA NA
tau_FNS2_1 -295.78742 NA NA NA NA
tau_FNS2_2 -162.63290 NA NA NA NA
tau_FNS2_3 -23.11581 NA NA NA NA
tau_FNS2_4 59.62596 NA NA NA NA
tau_FNS2_5 120.91888 NA NA NA NA
tau_FNS2_6 180.16704 NA NA NA NA
tau_FNS3_1 -4.31739 NA NA NA NA
tau_FNS3_2 -2.34942 NA NA NA NA
tau_FNS3_3 -1.21491 NA NA NA NA
tau_FNS3_4 -0.24568 NA NA NA NA
tau_FNS3_5 1.08742 NA NA NA NA
tau_FNS3_6 2.59517 NA NA NA NA
tau_FNS4_1 -3.56004 NA NA NA NA
tau_FNS4_2 -1.41770 NA NA NA NA
tau_FNS4_3 0.07390 NA NA NA NA
tau_FNS4_4 1.38879 NA NA NA NA
tau_FNS4_5 2.49014 NA NA NA NA
tau_FNS4_6 3.95172 NA NA NA NA
tau_FNS5_1 -3.19945 NA NA NA NA
tau_FNS5_2 -1.43405 NA NA NA NA
tau_FNS5_3 -0.11151 NA NA NA NA
tau_FNS5_4 0.97820 NA NA NA NA
tau_FNS5_5 1.99035 NA NA NA NA
tau_FNS5_6 3.52290 NA NA NA NA
tau_FNS6_1 -3.22342 NA NA NA NA
tau_FNS6_2 -1.05937 NA NA NA NA
tau_FNS6_3 0.78942 NA NA NA NA
tau_FNS6_4 2.22204 NA NA NA NA
tau_FNS6_5 3.19731 NA NA NA NA
tau_FNS6_6 4.89953 NA NA NA NA
tau_FNS7_1 -3.01151 NA NA NA NA
tau_FNS7_2 -1.30008 NA NA NA NA
tau_FNS7_3 -0.14376 NA NA NA NA
tau_FNS7_4 0.97139 NA NA NA NA
tau_FNS7_5 1.93643 NA NA NA NA
tau_FNS7_6 3.52921 NA NA NA NA
tau_FNS8_1 -2.73999 NA NA NA NA
tau_FNS8_2 -1.21944 NA NA NA NA
tau_FNS8_3 -0.20553 NA NA NA NA
tau_FNS8_4 0.78810 NA NA NA NA
tau_FNS8_5 1.85675 NA NA NA NA
tau_FNS8_6 3.15427 NA NA NA NA
tau_FNS9_1 -3.27427 NA NA NA NA
tau_FNS9_2 -1.49047 NA NA NA NA
tau_FNS9_3 -0.30296 NA NA NA NA
tau_FNS9_4 0.39214 NA NA NA NA
tau_FNS9_5 1.27725 NA NA NA NA
tau_FNS9_6 2.67444 NA NA NA NA

Could you please suggest me what to do?

Best,
Xian
stephanehess
Site Admin
Posts: 998
Joined: 24 Apr 2020, 16:29

Re: Getting NAs in hybrid model estimation

Post by stephanehess »

Hi

looks like FNS1 and FNS2 are causing the problems for you. Can you look at the distribution of answers for those, and also tabulate those answers against the choice tasks?

Also, why are you using

Code: Select all

rows           = (task==1|task==2)
do people answer the question twice?

Stephane
--------------------------------
Stephane Hess
www.stephanehess.me.uk
zx9203
Posts: 24
Joined: 13 Jun 2020, 09:52

Re: Getting NAs in hybrid model estimation

Post by zx9203 »

Dear Stephane,

Thank you so much for your reply!

FNS1, FNS2, ..., FNS9 are the answers to the 9 questions in a psychometric scale. Each respondent was asked to answer 12 choice tasks plus the psychometric survey. Therefore, each respondent has the same set of answers for each row of choice task. Also, I randomly assigned them to one of the two blocks. Task 1 only appeared in block 1 and those who took this block has missing values of FNS1~FNS9 for row of task 2. Task 2 only appeared in block 2.

Below are the distributions for FNS1 and FNS2:


Freq. Percent Cum.

1 12 0.72 0.72
2 34 2.04 2.76
3 91 5.46 8.22
4 266 15.97 24.19
5 636 38.18 62.36
6 472 28.33 90.70
7 155 9.30 100.00

Total 1,666 100.00





Freq. Percent Cum.

1 75 4.50 4.50
2 317 19.03 23.53
3 359 21.55 45.08
4 433 25.99 71.07
5 289 17.35 88.42
6 141 8.46 96.88
7 52 3.12 100.00

Total 1,666 100.00


Do you think the problem lies in the identification? Maybe I need to increase the number of Halton draws?

Best,
Xian
stephanehess
Site Admin
Posts: 998
Joined: 24 Apr 2020, 16:29

Re: Getting NAs in hybrid model estimation

Post by stephanehess »

Thanks. How do you handle the missing values in that case?
--------------------------------
Stephane Hess
www.stephanehess.me.uk
zx9203
Posts: 24
Joined: 13 Jun 2020, 09:52

Re: Getting NAs in hybrid model estimation

Post by zx9203 »

Dear Stephane,

Thank you for your reply!

Each respondent has only 12 rows of data. That is, with the same id number, there is either task==1 or task==2.

May I send you my data?

Best,
Xian
stephanehess
Site Admin
Posts: 998
Joined: 24 Apr 2020, 16:29

Re: Getting NAs in hybrid model estimation

Post by stephanehess »

okay. yes, please send me the data and model file
--------------------------------
Stephane Hess
www.stephanehess.me.uk
zx9203
Posts: 24
Joined: 13 Jun 2020, 09:52

Re: Getting NAs in hybrid model estimation

Post by zx9203 »

Dear Stephane,

I've sent the data and model file to your Leeds email address.

Thank you for your help!

Best,
Xian
zx9203
Posts: 24
Joined: 13 Jun 2020, 09:52

Re: Getting NAs in hybrid model estimation

Post by zx9203 »

Hi all,

With the help of David and Stephane, I have fixed the problem.

The bug came from the typo in

ol_settings2 = list(outcomeOrdered = FNS2, # used to say FNS1

V = zeta_FNS2*LV,

tau = list(tau_FNS2_1, tau_FNS2_2,


Also, I enlarged the number of draws to 500.

At the beginning, the program warned me:

Your model took more than 10 minutes to estimate, so it was saved to file D:/2023/3、院长基金/0722 main
data/rice_Hybrid_with_OL_model.rds before calculating its covariance matrix. If calculation of the covariance
matrix fails or is stopped before finishing, you can load the model up to this point using apollo_loadModel. You
may also want to inspect the approximate BHHH standard errors shown above to determine whether you wish to
continue this process.

But this didn't matter. All you need is more patience :D
Post Reply