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.

Estimation of MNL and MMNL in WTP space issues

Ask questions about how to estimate models and how to change your settings for estimation.
Post Reply
gcatt
Posts: 3
Joined: 31 Jan 2024, 15:36

Estimation of MNL and MMNL in WTP space issues

Post by gcatt »

Hello, I am new to DCE estimation using Apollo.
I am trying to estimate data from a labelled DCE using both a MNL and a Mixed MNL in WTP space, but I am ecountering some issues. The DCE cards included 4 alternatives (differing for the labelling attribute – the country of origin (COO), taking 4 levels – and the price – including three levels), and 1 opt-out alternative.

I will start with the MNL in WTP space issue. I want to estimate the WTP for the different COOs, hence the WTP of the ASCs. The issue is that when I specify utilities scaling the ASCs by the price to get WTP values, I get the following WARNING: Iteration limit exceeded. No covariance matrix will be computed. You may wish to use the current estimates as starting values for a new estimation with a higher limit for iterations.
Here is the code for the MNL:

Code: Select all

rm(list = ls())
apollo_initialise()
database <- read_excel("Dati_final.xlsx")
database <- subset(database, database$pasta==1)
apollo_initialise()
### Set core controls
apollo_control = list(
  modelName  ="MNL",
  modelDescr ="MNL model COO in WTP space",
  indivID    ="Individual"
)

apollo_beta=c(asc_italy  = 0,
              asc_eu  = 0,
              asc_extraeu = 0,
              asc_nolabel = 0,
              asc_nobuy = 0,
              b_price = 0,
              cet_italy = 0,
              cet_eu = 0,
              cet_extraeu = 0,
              cet_nolabel = 0,
              cet_nobuy = 0,
              look_italy = 0,
              look_eu = 0,
              look_extraeu = 0,
              look_nolabel = 0,
              look_nobuy = 0,
              knowledge_italy = 0,
              knowledge_eu = 0,
              knowledge_extraeu = 0,
              knowledge_nolabel = 0,
              knowledge_nobuy = 0)


apollo_fixed = c("asc_nobuy", "cet_nobuy", "look_nobuy", "knowledge_nobuy")

apollo_inputs = apollo_validateInputs()

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()
  
  ### List of utilities: these must use the same names as in mnl_settings, order is irrelevant
  V = list()
  V[['italy']] = b_price*(asc_italy + cet_italy * CET_high + look_italy * origin_look_always +
                                        knowledge_italy * knowledge + price_italy)
  V[["eu"]]  = b_price*(asc_eu + cet_eu * CET_high + look_eu * origin_look_always +
                                   knowledge_eu * knowledge + price_eu)
  V[["extraeu"]]  = b_price*(asc_extraeu + cet_extraeu * CET_high + look_extraeu * origin_look_always +
                                             knowledge_extraeu * knowledge + price_extraeu)
  V[["nolabel"]] = b_price*(asc_nolabel + cet_nolabel * CET_high + look_nolabel * origin_look_always +
                                            knowledge_nolabel * knowledge + price_nolabel)
  V[["nobuy"]] = b_price*(asc_nobuy + cet_nobuy * CET_high + look_nobuy * origin_look_always +
                                        knowledge_nobuy * knowledge + price_nobuy)
  
  ### Define settings for MNL model component
  mnl_settings = list(
    alternatives = c(nolabel=1, italy=2, eu=3, extraeu=4, nobuy=5),
    choiceVar    = answer,
    utilities    = V
  )
  
  ### Compute probabilities using MNL model
  P[["model"]] = apollo_mnl(mnl_settings, functionality)
  
  ### Take product across observation for same individual
  P = apollo_panelProd(P, apollo_inputs, functionality)
  
  ### Prepare and return outputs of function
  P = apollo_prepareProb(P, apollo_inputs, functionality)
  return(P)
}

model_mnl_wtp_pasta = apollo_estimate(apollo_beta, apollo_fixed, apollo_probabilities, apollo_inputs)

apollo_modelOutput(model_mnl_wtp_pasta)

rm(list = ls())
apollo_initialise()
database <- read_excel("Dati_final.xlsx")
database <- subset(database, database$pasta==1)
apollo_initialise()
### Set core controls
apollo_control = list(
  modelName  ="MNL",
  modelDescr ="MNL model COO in WTP space",
  indivID    ="Individual"
)

apollo_beta=c(asc_italy  = 0,
              asc_eu  = 0,
              asc_extraeu = 0,
              asc_nolabel = 0,
              asc_nobuy = 0,
              b_price = 0,
              cet_italy = 0,
              cet_eu = 0,
              cet_extraeu = 0,
              cet_nolabel = 0,
              cet_nobuy = 0,
              look_italy = 0,
              look_eu = 0,
              look_extraeu = 0,
              look_nolabel = 0,
              look_nobuy = 0,
              knowledge_italy = 0,
              knowledge_eu = 0,
              knowledge_extraeu = 0,
              knowledge_nolabel = 0,
              knowledge_nobuy = 0)


apollo_fixed = c("asc_nobuy", "cet_nobuy", "look_nobuy", "knowledge_nobuy")

apollo_inputs = apollo_validateInputs()

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()
  
  ### List of utilities: these must use the same names as in mnl_settings, order is irrelevant
  V = list()
  V[['italy']] = asc_italy + b_price*(cet_italy * CET_high + look_italy * origin_look_always +
                                        knowledge_italy * knowledge + price_italy)
  V[["eu"]]  = asc_eu + b_price*(cet_eu * CET_high + look_eu * origin_look_always +
                                   knowledge_eu * knowledge + price_eu)
  V[["extraeu"]]  = asc_extraeu + b_price*(cet_extraeu * CET_high + look_extraeu * origin_look_always +
                                             knowledge_extraeu * knowledge + price_extraeu)
  V[["nolabel"]] = asc_nolabel + b_price*(cet_nolabel * CET_high + look_nolabel * origin_look_always +
                                            knowledge_nolabel * knowledge + price_nolabel)
  V[["nobuy"]] = asc_nobuy + b_price*(cet_nobuy * CET_high + look_nobuy * origin_look_always +
                                        knowledge_nobuy * knowledge + price_nobuy)
  
  ### Define settings for MNL model component
  mnl_settings = list(
    alternatives = c(nolabel=1, italy=2, eu=3, extraeu=4, nobuy=5),
    choiceVar    = answer,
    utilities    = V
  )
  
  ### Compute probabilities using MNL model
  P[["model"]] = apollo_mnl(mnl_settings, functionality)
  
  ### Take product across observation for same individual
  P = apollo_panelProd(P, apollo_inputs, functionality)
  
  ### Prepare and return outputs of function
  P = apollo_prepareProb(P, apollo_inputs, functionality)
  return(P)
}

model_mnl_wtp_pasta = apollo_estimate(apollo_beta, apollo_fixed, apollo_probabilities, apollo_inputs)

apollo_modelOutput(model_mnl_wtp_pasta)
# The following are the estimated parameters
Estimated parameters:
                     Estimate
asc_italy           3.696e+04
asc_eu               3462.774
asc_extraeu        -3.319e+04
asc_nolabel        -2.640e+04
asc_nobuy               0.000
b_price             4.281e-05
cet_italy           2.184e+04
cet_eu              1.081e+04
cet_extraeu         -8550.641
cet_nolabel          5200.902
cet_nobuy               0.000
look_italy         -2.212e+04
look_eu             -7736.336
look_extraeu        1.240e+04
look_nolabel       -1.501e+04
look_nobuy              0.000
knowledge_italy     3.790e+04
knowledge_eu        4.253e+04
knowledge_extraeu   5.930e+04
knowledge_nolabel   6.054e+04
knowledge_nobuy         0.000

Regarding the MMNL I would like to allow random preferences for all the alternatives (hence allowing the ASCs to randomly vary across the population) and to allow random preferences for the price (however constraining it to a negative distribution). I think I might have misspecified the utilities, since the results are not as expected (when I tried with a different estimation program, asc_italy_mu and asc_eu_mu were positive, asc_extraeu_mu and asc_nobuy_mu were negative).

Code: Select all

################################################################################
> ################################## RPL Pooled ##################################
> ################################################################################
> ### Clear memory
> rm(list = ls())
> database <- read_excel("Dati_final.xlsx")
                                                                                       
> apollo_initialise()
Apollo ignition sequence completed
> ### Set core controls
> apollo_control = list(
+   modelName       = "RPL_pooled_WTP_space",
+   modelDescr      = "RPL model pooled in WTP space",
+   indivID         = "Individual",
+   mixing          = TRUE, #true for models including random parameters
+   nCores          = 3, 
+   outputDirectory = "output"
+ )
> # ################################################################# #
> #### LOAD DATA AND APPLY ANY TRANSFORMATIONS                     ####
> # ################################################################# #
> database <- read_excel("Dati_final.xlsx")
                                                                                       
> ### Vector of parameters, including any that are kept fixed in estimation
> apollo_beta = c(asc_italy_mu = 0,
+                 asc_italy_sig = 0, 
+                 asc_eu_mu = 0,
+                 asc_eu_sig = 0,
+                 asc_extraeu_mu = 0,
+                 asc_extraeu_sig = 0,
+                 asc_nolabel_mu = 0,
+                 asc_nolabel_sig = 0,
+                 asc_nobuy_mu = 0,
+                 asc_nobuy_sig = 0,
+                 b_price_mu = 0,
+                 b_price_sig = 0)
> ### 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("asc_nolabel_mu", "asc_nolabel_sig")
> ### Set parameters for generating draws
> apollo_draws = list(
+   interDrawsType = "sobol",
+   interNDraws    = 1000,
+   interNormDraws = c("draws_asc_italy","draws_asc_eu", "draws_asc_extraeu",
+                      "draws_asc_nolabel", "draws_asc_nobuy", "draws_b_price")
+ )
> ### Create random parameters
> apollo_randCoeff = function(apollo_beta, apollo_inputs){
+   randcoeff = list()
+   
+   randcoeff[["asc_italy"]] = asc_italy_mu + asc_italy_sig * draws_asc_italy
+   randcoeff[["asc_eu"]] = asc_eu_mu + asc_eu_sig * draws_asc_eu
+   randcoeff[["asc_extraeu"]] = asc_extraeu_mu + asc_extraeu_sig * draws_asc_extraeu
+   randcoeff[["asc_nolabel"]] = asc_nolabel_mu + asc_nolabel_sig * draws_asc_nolabel
+   randcoeff[["asc_nobuy"]] = asc_nobuy_mu + asc_nobuy_sig * draws_asc_nobuy
+   randcoeff[["b_price"]] = b_price_mu + b_price_sig * draws_b_price
+   
+   return(randcoeff)
+ }
> apollo_inputs = apollo_validateInputs()
apollo_draws and apollo_randCoeff were found, so apollo_control$mixing was set
  to TRUE
Several observations per individual detected based on the value of Individual.
  Setting panelData in apollo_control set to TRUE.
All checks on apollo_control completed.
All checks on database completed.
Generating inter-individual draws ...... Done
> apollo_probabilities=function(apollo_beta, apollo_inputs, functionality="estimate"){
+   
+   ### Function initialisation: do not change the following three commands
+   ### 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()
+   
+   ### List of utilities: these must use the same names as in mnl_settings, order is irrelevant
+   V = list()
+   V[["italy"]] = b_price * ( asc_italy + price_italy )
+   V[["eu"]] = b_price * ( asc_eu + price_eu )
+   V[["extraeu"]] = b_price * ( asc_extraeu + price_extraeu )
+   V[["nolabel"]] = b_price * ( asc_nolabel + price_nolabel )
+   V[["nobuy"]] = b_price * ( asc_nobuy + price_nobuy )
+   
+   ### Define settings for MNL model component
+   mnl_settings = list(
+     alternatives  = c(nolabel=1, italy=2, eu=3, extraeu=4, nobuy=5), 
+     choiceVar     = answer,
+     utilities     = V
+   )
+   
+   ### Compute probabilities using MNL model
+   P[["model"]] = apollo_mnl(mnl_settings, 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 = apollo_estimate(apollo_beta, apollo_fixed,
+                         apollo_probabilities, apollo_inputs)
Preparing user-defined functions.

Testing likelihood function...
Setting "avail" is missing, so full availability is assumed.

Overview of choices for MNL model component :
                                 nolabel  italy     eu extraeu  nobuy
Times available                   864.00 864.00 864.00  864.00 864.00
Times chosen                       42.00 512.00 145.00   27.00 138.00
Percentage chosen overall           4.86  59.26  16.78    3.12  15.97
Percentage chosen when available    4.86  59.26  16.78    3.12  15.97


Pre-processing likelihood function...
Creating cluster...
Preparing workers for multithreading...

Testing influence of parameters
Starting main estimation

BGW using analytic model derivatives supplied by caller...


Iterates will be written to: 
 output/RPL_pooled_WTP_space_iterations.csv    it    nf     F            RELDF    PRELDF    RELDX    MODEL stppar
     0     1 1.390554356e+03
     1     2 1.342786415e+03 3.435e-02 1.198e-03 1.00e+00   G   -5.60e-04
     2     3 1.312630929e+03 2.246e-02 2.976e-02 8.37e-01   G   3.15e-02
     3     4 1.006640954e+03 2.331e-01 3.221e-02 1.00e+00   G   1.06e-04
     4     5 9.368733968e+02 6.931e-02 4.176e-02 3.55e-01   G   0.00e+00
     5     6 8.726781237e+02 6.852e-02 4.183e-02 2.53e-01   G   0.00e+00
     6     7 8.432197868e+02 3.376e-02 9.594e-02 5.53e-01   S   0.00e+00
     7     8 7.732461899e+02 8.298e-02 6.083e-02 2.84e-01   S   0.00e+00
     8     9 7.355182646e+02 4.879e-02 3.943e-02 2.14e-01   S   0.00e+00
     9    11 7.173275081e+02 2.473e-02 1.743e-02 5.33e-02   S   1.09e-01
    10    13 6.998903603e+02 2.431e-02 1.328e-02 3.26e-01  S-G  0.00e+00
    11    14 6.908877066e+02 1.286e-02 9.946e-03 6.60e-02   G   0.00e+00
    12    15 6.827644060e+02 1.176e-02 6.844e-03 3.72e-02   G   0.00e+00
    13    16 6.769681613e+02 8.489e-03 5.156e-03 3.11e-02   G   0.00e+00
    14    17 6.695499781e+02 1.096e-02 1.044e-02 1.01e-01   S   0.00e+00
    15    18 6.689020071e+02 9.678e-04 2.972e-03 2.45e-02   S   0.00e+00
    16    19 6.672236127e+02 2.509e-03 1.702e-03 1.52e-02   S   0.00e+00
    17    20 6.661568301e+02 1.599e-03 2.266e-03 6.31e-02   G   0.00e+00
    18    21 6.654997320e+02 9.864e-04 9.121e-04 1.77e-02   S   0.00e+00
    19    22 6.652625255e+02 3.564e-04 3.280e-04 1.10e-02   S   0.00e+00
    20    23 6.650346093e+02 3.426e-04 2.063e-04 6.80e-03   S   0.00e+00
    21    25 6.649653261e+02 1.042e-04 4.520e-04 1.34e-02  G-S  0.00e+00
    22    26 6.648268274e+02 2.083e-04 3.053e-04 1.12e-02   S   0.00e+00
    23    27 6.648218495e+02 7.487e-06 9.895e-05 4.11e-03   S   0.00e+00
    24    28 6.647741132e+02 7.180e-05 7.302e-05 2.23e-03   S   0.00e+00
    25    30 6.647695561e+02 6.855e-06 1.192e-05 1.14e-03   S   2.05e-01
    26    31 6.647657737e+02 5.690e-06 4.384e-06 6.60e-04   S   0.00e+00
    27    32 6.647645355e+02 1.863e-06 2.304e-06 8.67e-04   S   0.00e+00
    28    33 6.647643813e+02 2.319e-07 8.480e-07 2.87e-04   S   0.00e+00
    29    34 6.647641596e+02 3.336e-07 4.840e-07 1.57e-04   S   0.00e+00
    30    35 6.647641130e+02 7.009e-08 1.026e-07 7.61e-05   S   0.00e+00
    31    36 6.647641047e+02 1.236e-08 1.268e-08 3.35e-05   S   0.00e+00
    32    37 6.647641046e+02 1.673e-10 1.715e-10 4.73e-06   S   0.00e+00
    33    38 6.647641046e+02 1.631e-11 1.668e-11 1.33e-06   S   0.00e+00

***** Relative function convergence *****
Additional convergence test using scaled estimation. Parameters will be scaled
  by their current estimates and additional iterations will be performed.

BGW using analytic model derivatives supplied by caller...


Iterates will be appended to: 
 output/RPL_pooled_WTP_space_iterations.csv    it    nf     F            RELDF    PRELDF    RELDX    MODEL stppar
     0     1 6.647641046e+02

***** Relative function convergence *****

Estimated parameters with approximate standard errors from BHHH matrix:
                   Estimate     BHHH se BHH t-ratio (0)
asc_italy_mu       -0.58641     0.03916        -14.9743
asc_italy_sig      -0.24828     0.04138         -5.9998
asc_eu_mu          -0.22368     0.03231         -6.9240
asc_eu_sig         -0.14508     0.04683         -3.0981
asc_extraeu_mu      0.07850     0.07254          1.0821
asc_extraeu_sig     0.11142     0.11185          0.9961
asc_nolabel_mu      0.00000          NA              NA
asc_nolabel_sig     0.00000          NA              NA
asc_nobuy_mu        2.48685     0.19652         12.6544
asc_nobuy_sig       0.97919     0.17659          5.5449
b_price_mu        -10.03383     1.25862         -7.9721
b_price_sig         4.86259     1.23623          3.9334

Final LL: -664.7641

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...
Calculating other model fit measures
Computing covariance matrix using analytical gradient.
 0%....25%....50%....75%.100%
Negative definite Hessian with maximum eigenvalue: -0.533522
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
> # ----------------------------------------------------------------- #
> #---- FORMATTED OUTPUT (TO SCREEN)                               ----
> # ----------------------------------------------------------------- #
> apollo_modelOutput(model)
Model run by giudi using Apollo 0.3.1 on R 4.2.3 for Darwin.
Please acknowledge the use of Apollo by citing Hess & Palma (2019)
  DOI 10.1016/j.jocm.2019.100170
  www.ApolloChoiceModelling.com

Model name                                  : RPL_pooled_WTP_space
Model description                           : RPL model pooled in WTP space
Model run at                                : 2024-01-31 17:03:01
Estimation method                           : bgw
Model diagnosis                             : Relative function convergence
Optimisation diagnosis                      : Maximum found
     hessian properties                     : Negative definite
     maximum eigenvalue                     : -0.533522
     reciprocal of condition number         : 0.000150828
Number of individuals                       : 96
Number of rows in database                  : 864
Number of modelled outcomes                 : 864

Number of cores used                        :  3 
Number of inter-individual draws            : 1000 (sobol)

LL(start)                                   : -1390.55
LL at equal shares, LL(0)                   : -1390.55
LL at observed shares, LL(C)                : -1000.42
LL(final)                                   : -664.76
Rho-squared vs equal shares                  :  0.5219 
Adj.Rho-squared vs equal shares              :  0.5148 
Rho-squared vs observed shares               :  0.3355 
Adj.Rho-squared vs observed shares           :  0.3295 
AIC                                         :  1349.53 
BIC                                         :  1397.14 

Estimated parameters                        : 10
Time taken (hh:mm:ss)                       :  00:00:47.05 
     pre-estimation                         :  00:00:9.82 
     estimation                             :  00:00:15.1 
          initial estimation                :  00:00:14.06 
          estimation after rescaling        :  00:00:1.04 
     post-estimation                        :  00:00:22.13 
Iterations                                  :  34  
     initial estimation                     :  33 
     estimation after rescaling             :  1 

Unconstrained optimisation.

Estimates:
                   Estimate        s.e.   t.rat.(0)    Rob.s.e. Rob.t.rat.(0)
asc_italy_mu       -0.58641     0.04942     -11.866     0.06929        -8.463
asc_italy_sig      -0.24828     0.03087      -8.043     0.03397        -7.309
asc_eu_mu          -0.22368     0.03295      -6.789     0.04105        -5.449
asc_eu_sig         -0.14508     0.02845      -5.099     0.02185        -6.641
asc_extraeu_mu      0.07850     0.06137       1.279     0.06565         1.196
asc_extraeu_sig     0.11142     0.06575       1.695     0.05520         2.018
asc_nolabel_mu      0.00000          NA          NA          NA            NA
asc_nolabel_sig     0.00000          NA          NA          NA            NA
asc_nobuy_mu        2.48685     0.09584      25.948     0.05875        42.332
asc_nobuy_sig       0.97919     0.08122      12.056     0.04464        21.937
b_price_mu        -10.03383     1.18306      -8.481     1.69716        -5.912
b_price_sig         4.86259     0.82722       5.878     0.93897         5.179
Thank you for any clarification you will be able to give me.

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

Re: Estimation of MNL and MMNL in WTP space issues

Post by stephanehess »

Hi

did you first try a model in preference space?

Stephane
--------------------------------
Stephane Hess
www.stephanehess.me.uk
gcatt
Posts: 3
Joined: 31 Jan 2024, 15:36

Re: Estimation of MNL and MMNL in WTP space issues

Post by gcatt »

Yes, you can find the code below.

MNL:

Code: Select all

> rm(list = ls())
> apollo_initialise()
Apollo ignition sequence completed
> database <- read_excel("Dati_final.xlsx")
                                                                                       
> database <- subset(database, database$pasta==1)
> apollo_initialise()
Apollo ignition sequence completed
> ### Set core controls
> apollo_control = list(
+   modelName  ="MNL",
+   modelDescr ="MNL model COO in WTP space",
+   indivID    ="Individual"
+ )
> ### Set core controls
> apollo_control = list(
+   modelName  ="MNL",
+   modelDescr ="MNL model COO in preference space",
+   indivID    ="Individual"
+ )
> apollo_beta=c(asc_italy  = 0,
+               asc_eu  = 0,
+               asc_extraeu = 0,
+               asc_nolabel = 0,
+               asc_nobuy = 0,
+               b_price = 0,
+               cet_italy = 0,
+               cet_eu = 0,
+               cet_extraeu = 0,
+               cet_nolabel = 0,
+               cet_nobuy = 0,
+               look_italy = 0,
+               look_eu = 0,
+               look_extraeu = 0,
+               look_nolabel = 0,
+               look_nobuy = 0,
+               knowledge_italy = 0,
+               knowledge_eu = 0,
+               knowledge_extraeu = 0,
+               knowledge_nolabel = 0,
+               knowledge_nobuy = 0)
> apollo_fixed = c("asc_nobuy", "cet_nobuy", "look_nobuy", "knowledge_nobuy")
> apollo_inputs = apollo_validateInputs()
Several observations per individual detected based on the value of Individual.
  Setting panelData in apollo_control set to TRUE.
All checks on apollo_control completed.
All checks on database completed.
> 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()
+   
+   ### List of utilities: these must use the same names as in mnl_settings, order is irrelevant
+   V = list()
+   V[['italy']] = asc_italy + cet_italy * CET_high + look_italy * origin_look_always +
+                             knowledge_italy * knowledge + b_price * price_italy
+   V[["eu"]]  = asc_eu + cet_eu * CET_high + look_eu * origin_look_always +
+                           knowledge_eu * knowledge + b_price * price_eu
+   V[["extraeu"]]  = asc_extraeu + cet_extraeu * CET_high + look_extraeu * origin_look_always +
+                                knowledge_extraeu * knowledge + b_price * price_extraeu
+   V[["nolabel"]] = asc_nolabel + cet_nolabel * CET_high + look_nolabel * origin_look_always +
+                               knowledge_nolabel * knowledge + b_price * price_nolabel
+   V[["nobuy"]] = asc_nobuy + cet_nobuy * CET_high + look_nobuy * origin_look_always +
+                             knowledge_nobuy * knowledge + b_price * price_nobuy
+   
+   ### Define settings for MNL model component
+   mnl_settings = list(
+     alternatives = c(nolabel=1, italy=2, eu=3, extraeu=4, nobuy=5),
+     choiceVar    = answer,
+     utilities    = V
+   )
+   
+   ### Compute probabilities using MNL model
+   P[["model"]] = apollo_mnl(mnl_settings, functionality)
+   
+   ### Take product across observation for same individual
+   P = apollo_panelProd(P, apollo_inputs, functionality)
+   
+   ### Prepare and return outputs of function
+   P = apollo_prepareProb(P, apollo_inputs, functionality)
+   return(P)
+ }
> model_mnl_wtp_pasta = apollo_estimate(apollo_beta, apollo_fixed, apollo_probabilities, apollo_inputs)
Preparing user-defined functions.

Testing likelihood function...
Setting "avail" is missing, so full availability is assumed.

Overview of choices for MNL model component :
                                 nolabel  italy     eu extraeu nobuy
Times available                   441.00 441.00 441.00  441.00 441.0
Times chosen                       17.00 277.00  70.00   21.00  56.0
Percentage chosen overall           3.85  62.81  15.87    4.76  12.7
Percentage chosen when available    3.85  62.81  15.87    4.76  12.7


Pre-processing likelihood function...

Testing influence of parameters
Starting main estimation

BGW using analytic model derivatives supplied by caller...


Iterates will be written to: 
 /Users/giudi/Desktop/Cattolica/Paper country of origin/Stime apollo/MNL_iterations.csv    it    nf     F            RELDF    PRELDF    RELDX    MODEL stppar
     0     1 7.097621194e+02
     1     4 5.546794194e+02 2.185e-01 1.961e-01 1.00e+00   G   3.11e-01
     2     5 4.787749065e+02 1.368e-01 1.217e-01 4.62e-01   G   1.46e-01
     3     6 4.631408974e+02 3.265e-02 3.657e-02 2.90e-01   S   7.75e-02
     4     9 4.191378345e+02 9.501e-02 1.010e-01 7.27e-01   S   5.84e-04
     5    10 4.101912246e+02 2.135e-02 1.848e-02 1.28e-01   S   0.00e+00
     6    11 4.090849526e+02 2.697e-03 2.833e-03 4.39e-02   S   0.00e+00
     7    12 4.089739018e+02 2.715e-04 2.409e-04 2.22e-03   S   0.00e+00
     8    13 4.089560796e+02 4.358e-05 4.096e-05 1.03e-03   S   0.00e+00
     9    14 4.089554417e+02 1.560e-06 1.683e-06 3.22e-04   S   0.00e+00
    10    15 4.089554156e+02 6.379e-08 1.551e-07 2.21e-04   G   0.00e+00
    11    16 4.089553960e+02 4.794e-08 4.655e-08 2.58e-05   S   0.00e+00
    12    17 4.089553957e+02 6.121e-10 6.025e-10 2.26e-05   S   0.00e+00
    13    18 4.089553957e+02 6.604e-11 6.570e-11 4.40e-06   S   0.00e+00

***** Relative function convergence *****
Additional convergence test using scaled estimation. Parameters will be scaled
  by their current estimates and additional iterations will be performed.

BGW using analytic model derivatives supplied by caller...


Iterates will be appended to: 
 /Users/giudi/Desktop/Cattolica/Paper country of origin/Stime apollo/MNL_iterations.csv    it    nf     F            RELDF    PRELDF    RELDX    MODEL stppar
     0     1 4.089553957e+02
     1     2 4.089553957e+02 1.528e-12 2.483e-12 1.98e-05   G   0.00e+00

***** Relative function convergence *****

Estimated parameters with approximate standard errors from BHHH matrix:
                     Estimate     BHHH se BHH t-ratio (0)
asc_italy             15.2967      1.6047          9.5325
asc_eu                13.4029      1.5476          8.6603
asc_extraeu           11.2019      1.5563          7.1976
asc_nolabel           12.4030      1.5943          7.7797
asc_nobuy              0.0000          NA              NA
b_price               -8.1468      0.9420         -8.6486
cet_italy              1.0805      0.3335          3.2394
cet_eu                 0.5212      0.3940          1.3230
cet_extraeu           -0.4723      0.7351         -0.6425
cet_nolabel            0.2410      0.6742          0.3575
cet_nobuy              0.0000          NA              NA
look_italy            -1.1003      0.3335         -3.2991
look_eu               -0.3773      0.3899         -0.9677
look_extraeu           0.6342      0.6344          0.9996
look_nolabel          -0.6800      0.6071         -1.1201
look_nobuy             0.0000          NA              NA
knowledge_italy        1.6084      1.0489          1.5334
knowledge_eu           1.8148      1.1260          1.6117
knowledge_extraeu      2.5459      1.3910          1.8303
knowledge_nolabel      2.6147      1.2807          2.0417
knowledge_nobuy        0.0000          NA              NA

Final LL: -408.9554

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...
Calculating other model fit measures
Computing covariance matrix using analytical gradient.
 0%....25%....50%....75%....100%
Negative definite Hessian with maximum eigenvalue: -0.099436
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
> apollo_modelOutput(model_mnl_wtp_pasta)
Model run by giudi using Apollo 0.3.1 on R 4.2.3 for Darwin.
Please acknowledge the use of Apollo by citing Hess & Palma (2019)
  DOI 10.1016/j.jocm.2019.100170
  www.ApolloChoiceModelling.com

Model name                                  : MNL
Model description                           : MNL model COO in preference space
Model run at                                : 2024-02-01 12:44:55
Estimation method                           : bgw
Model diagnosis                             : Relative function convergence
Optimisation diagnosis                      : Maximum found
     hessian properties                     : Negative definite
     maximum eigenvalue                     : -0.099436
     reciprocal of condition number         : 0.000491487
Number of individuals                       : 49
Number of rows in database                  : 441
Number of modelled outcomes                 : 441

Number of cores used                        :  1 
Model without mixing

LL(start)                                   : -709.76
LL at equal shares, LL(0)                   : -709.76
LL at observed shares, LL(C)                : -492.5
LL(final)                                   : -408.96
Rho-squared vs equal shares                  :  0.4238 
Adj.Rho-squared vs equal shares              :  0.3999 
Rho-squared vs observed shares               :  0.1696 
Adj.Rho-squared vs observed shares           :  0.1432 
AIC                                         :  851.91 
BIC                                         :  921.42 

Estimated parameters                        : 17
Time taken (hh:mm:ss)                       :  00:00:0.46 
     pre-estimation                         :  00:00:0.23 
     estimation                             :  00:00:0.06 
          initial estimation                :  00:00:0.06 
          estimation after rescaling        :  00:00:0.01 
     post-estimation                        :  00:00:0.17 
Iterations                                  :  14  
     initial estimation                     :  13 
     estimation after rescaling             :  1 

Unconstrained optimisation.

Estimates:
                     Estimate        s.e.   t.rat.(0)    Rob.s.e. Rob.t.rat.(0)
asc_italy             15.2967      1.6004      9.5581      2.6330        5.8096
asc_eu                13.4029      1.5332      8.7415      2.5269        5.3041
asc_extraeu           11.2019      1.4864      7.5365      2.1146        5.2973
asc_nolabel           12.4030      1.5843      7.8286      2.0219        6.1344
asc_nobuy              0.0000          NA          NA          NA            NA
b_price               -8.1468      0.9211     -8.8450      1.4905       -5.4659
cet_italy              1.0805      0.3442      3.1389      0.8833        1.2233
cet_eu                 0.5212      0.4055      1.2854      0.9191        0.5671
cet_extraeu           -0.4723      0.6262     -0.7542      1.1445       -0.4127
cet_nolabel            0.2410      0.6124      0.3936      1.0381        0.2322
cet_nobuy              0.0000          NA          NA          NA            NA
look_italy            -1.1003      0.3378     -3.2570      0.7787       -1.4130
look_eu               -0.3773      0.3969     -0.9508      0.8196       -0.4604
look_extraeu           0.6342      0.6113      1.0375      0.9988        0.6350
look_nolabel          -0.6800      0.5892     -1.1542      1.0065       -0.6756
look_nobuy             0.0000          NA          NA          NA            NA
knowledge_italy        1.6084      1.0463      1.5372      1.0905        1.4749
knowledge_eu           1.8148      1.0938      1.6592      1.2564        1.4444
knowledge_extraeu      2.5459      1.2458      2.0435      1.4046        1.8125
knowledge_nolabel      2.6147      1.1956      2.1869      1.4571        1.7945
knowledge_nobuy        0.0000          NA          NA          NA            NA
MMNL:

Code: Select all

################################################################################
> ################################## RPL Pooled ##################################
> ################################################################################
> ### Clear memory
> rm(list = ls())
> database <- read_excel("Dati_final.xlsx")
                                                                                       
> apollo_initialise()
Apollo ignition sequence completed
> ################################################################################
> ################################## RPL Pooled ##################################
> ################################################################################
> ### Clear memory
> rm(list = ls())
> database <- read_excel("Dati_final.xlsx")
                                                                                       
> apollo_initialise()
Apollo ignition sequence completed
> ### Set core controls
> apollo_control = list(
+   modelName       = "RPL_pooled_WTP_space",
+   modelDescr      = "RPL model pooled in WTP space",
+   indivID         = "Individual",
+   mixing          = TRUE, #true for models including random parameters
+   nCores          = 3, 
+   outputDirectory = "output"
+ )
> # ################################################################# #
> #### LOAD DATA AND APPLY ANY TRANSFORMATIONS                     ####
> # ################################################################# #
> database <- read_excel("Dati_final.xlsx")
                                                                                       
> ### Vector of parameters, including any that are kept fixed in estimation
> apollo_beta = c(asc_italy_mu = 0,
+                 asc_italy_sig = 0, 
+                 asc_eu_mu = 0,
+                 asc_eu_sig = 0,
+                 asc_extraeu_mu = 0,
+                 asc_extraeu_sig = 0,
+                 asc_nolabel_mu = 0,
+                 asc_nolabel_sig = 0,
+                 asc_nobuy_mu = 0,
+                 asc_nobuy_sig = 0,
+                 b_price_mu = 0,
+                 b_price_sig = 0)
> ### 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("asc_nolabel_mu", "asc_nolabel_sig")
> ### Set parameters for generating draws
> apollo_draws = list(
+   interDrawsType = "sobol",
+   interNDraws    = 1000,
+   interNormDraws = c("draws_asc_italy","draws_asc_eu", "draws_asc_extraeu",
+                      "draws_asc_nolabel", "draws_asc_nobuy", "draws_b_price")
+ )
> ### Create random parameters
> apollo_randCoeff = function(apollo_beta, apollo_inputs){
+   randcoeff = list()
+   
+   randcoeff[["asc_italy"]] = asc_italy_mu + asc_italy_sig * draws_asc_italy
+   randcoeff[["asc_eu"]] = asc_eu_mu + asc_eu_sig * draws_asc_eu
+   randcoeff[["asc_extraeu"]] = asc_extraeu_mu + asc_extraeu_sig * draws_asc_extraeu
+   randcoeff[["asc_nolabel"]] = asc_nolabel_mu + asc_nolabel_sig * draws_asc_nolabel
+   randcoeff[["asc_nobuy"]] = asc_nobuy_mu + asc_nobuy_sig * draws_asc_nobuy
+   randcoeff[["b_price"]] = b_price_mu + b_price_sig * draws_b_price
+   
+   return(randcoeff)
+ }
> apollo_inputs = apollo_validateInputs()
apollo_draws and apollo_randCoeff were found, so apollo_control$mixing was set
  to TRUE
Several observations per individual detected based on the value of Individual.
  Setting panelData in apollo_control set to TRUE.
All checks on apollo_control completed.
All checks on database completed.
Generating inter-individual draws ...... Done
> apollo_probabilities=function(apollo_beta, apollo_inputs, functionality="estimate"){
+   
+   ### Function initialisation: do not change the following three commands
+   ### 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()
+   
+   ### List of utilities: these must use the same names as in mnl_settings, order is irrelevant
+   V = list()
+   V[["italy"]] = asc_italy + b_price * price_italy 
+   V[["eu"]] = asc_eu + b_price * price_eu 
+   V[["extraeu"]] = asc_extraeu + b_price * price_extraeu 
+   V[["nolabel"]] = asc_nolabel + b_price * price_nolabel 
+   V[["nobuy"]] = asc_nobuy + b_price * price_nobuy 
+   
+   ### Define settings for MNL model component
+   mnl_settings = list(
+     alternatives  = c(nolabel=1, italy=2, eu=3, extraeu=4, nobuy=5), 
+     choiceVar     = answer,
+     utilities     = V
+   )
+   
+   ### Compute probabilities using MNL model
+   P[["model"]] = apollo_mnl(mnl_settings, 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 = apollo_estimate(apollo_beta, apollo_fixed,
+                         apollo_probabilities, apollo_inputs)
Preparing user-defined functions.

Testing likelihood function...
Setting "avail" is missing, so full availability is assumed.

Overview of choices for MNL model component :
                                 nolabel  italy     eu extraeu  nobuy
Times available                   864.00 864.00 864.00  864.00 864.00
Times chosen                       42.00 512.00 145.00   27.00 138.00
Percentage chosen overall           4.86  59.26  16.78    3.12  15.97
Percentage chosen when available    4.86  59.26  16.78    3.12  15.97


Pre-processing likelihood function...
Creating cluster...
Preparing workers for multithreading...

Testing influence of parameters
Starting main estimation

BGW using analytic model derivatives supplied by caller...


Iterates will be written to: 
 output/RPL_pooled_WTP_space_iterations.csv    it    nf     F            RELDF    PRELDF    RELDX    MODEL stppar
     0     1 1.390554356e+03
     1     2 1.234620403e+03 1.121e-01 7.970e-03 1.00e+00   G   1.02e+01
     2     3 1.129257617e+03 8.534e-02 3.714e-02 6.38e-01   G   0.00e+00
     3     4 1.040635526e+03 7.848e-02 3.827e-02 3.92e-01   G   0.00e+00
     4     6 8.992968033e+02 1.358e-01 6.749e-01 8.36e-01   S   8.39e-01
     5     8 8.665465694e+02 3.642e-02 4.081e-02 1.10e-01   S   5.05e-01
     6     9 8.194409659e+02 5.436e-02 8.125e-02 4.71e-01   S   3.81e-02
     7    10 7.590695087e+02 7.367e-02 2.077e-01 3.53e-01   S   1.46e-01
     8    11 7.185366615e+02 5.340e-02 3.994e-02 1.33e-01   S   0.00e+00
     9    12 6.972036035e+02 2.969e-02 2.130e-02 1.17e-01   S   0.00e+00
    10    13 6.870794594e+02 1.452e-02 1.757e-02 1.39e-01   S   0.00e+00
    11    14 6.857209935e+02 1.977e-03 6.393e-03 4.85e-02   S   0.00e+00
    12    15 6.832459889e+02 3.609e-03 3.645e-03 4.23e-02   S   0.00e+00
    13    16 6.823679486e+02 1.285e-03 9.245e-04 2.09e-02   S   0.00e+00
    14    19 6.821771850e+02 2.796e-04 4.864e-04 1.53e-02  S-G  1.75e-01
    15    20 6.821190033e+02 8.529e-05 5.581e-04 1.66e-02   G   1.63e-01
    16    21 6.820989045e+02 2.947e-05 3.789e-04 1.68e-02   G   0.00e+00
    17    22 6.818596020e+02 3.508e-04 5.499e-04 8.44e-03   G   9.40e-01
    18    23 6.817877250e+02 1.054e-04 8.761e-05 5.53e-03   S   0.00e+00
    19    25 6.817578426e+02 4.383e-05 4.046e-05 5.57e-03  G-S  0.00e+00
    20    26 6.817356483e+02 3.255e-05 2.425e-05 5.43e-03   S   0.00e+00
    21    27 6.817188532e+02 2.464e-05 1.736e-05 4.58e-03   S   0.00e+00
    22    28 6.817054670e+02 1.964e-05 1.503e-05 4.59e-03   S   0.00e+00
    23    29 6.816976024e+02 1.154e-05 8.185e-06 2.31e-03   S   0.00e+00
    24    30 6.816922357e+02 7.873e-06 5.666e-06 1.55e-03   S   0.00e+00
    25    31 6.816895979e+02 3.869e-06 3.080e-06 1.22e-03   S   0.00e+00
    26    33 6.816887173e+02 1.292e-06 1.306e-06 7.30e-04  G-S  0.00e+00
    27    34 6.816884853e+02 3.403e-07 3.000e-07 2.70e-04   S   0.00e+00
    28    35 6.816884302e+02 8.086e-08 7.265e-08 2.03e-04   S   0.00e+00
    29    37 6.816884160e+02 2.089e-08 2.069e-08 1.52e-04  G-S  0.00e+00
    30    38 6.816884106e+02 7.815e-09 5.063e-09 4.40e-05   S   0.00e+00
    31    39 6.816884057e+02 7.180e-09 5.803e-09 9.59e-05   S   0.00e+00
    32    40 6.816884042e+02 2.298e-09 1.681e-09 5.53e-05   S   0.00e+00
    33    41 6.816884033e+02 1.248e-09 9.838e-10 4.60e-05   S   0.00e+00
    34    42 6.816884031e+02 3.745e-10 2.929e-10 1.43e-05   S   0.00e+00
    35    43 6.816884030e+02 8.575e-11 7.196e-11 5.23e-06   S   0.00e+00

***** Relative function convergence *****
Additional convergence test using scaled estimation. Parameters will be scaled
  by their current estimates and additional iterations will be performed.

BGW using analytic model derivatives supplied by caller...


Iterates will be appended to: 
 output/RPL_pooled_WTP_space_iterations.csv    it    nf     F            RELDF    PRELDF    RELDX    MODEL stppar
     0     1 6.816884030e+02
     1     2 6.816884030e+02 4.659e-12 4.461e-12 6.71e-06   G   0.00e+00

***** Relative function convergence *****

Estimated parameters with approximate standard errors from BHHH matrix:
                   Estimate     BHHH se BHH t-ratio (0)
asc_italy_mu         3.7735      0.3228          11.691
asc_italy_sig       -1.8825      0.4207          -4.475
asc_eu_mu            1.5124      0.2776           5.449
asc_eu_sig          -0.7925      0.4511          -1.757
asc_extraeu_mu      -0.9204      0.5998          -1.535
asc_extraeu_sig      1.1052      0.7048           1.568
asc_nolabel_mu       0.0000          NA              NA
asc_nolabel_sig      0.0000          NA              NA
asc_nobuy_mu       -16.2726      1.1722         -13.882
asc_nobuy_sig       -7.6094      1.5124          -5.031
b_price_mu          -6.3923      0.3968         -16.111
b_price_sig         -1.3853      0.4206          -3.293

Final LL: -681.6884

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...
Calculating other model fit measures
Computing covariance matrix using analytical gradient.
 0%....25%....50%....75%.100%
Negative definite Hessian with maximum eigenvalue: -0.140509
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
stephanehess
Site Admin
Posts: 998
Joined: 24 Apr 2020, 16:29

Re: Estimation of MNL and MMNL in WTP space issues

Post by stephanehess »

Hi

I also need to know the LL you get with MNL and in WTP space, please, i.e. where it runs out of iterations

Stephane
--------------------------------
Stephane Hess
www.stephanehess.me.uk
gcatt
Posts: 3
Joined: 31 Jan 2024, 15:36

Re: Estimation of MNL and MMNL in WTP space issues

Post by gcatt »

Below you can find the code with the output I get in the R console:

Code: Select all

################################################################################
> ######################## MNL Pasta with ASC in WTP space #######################
> ################################################################################
> rm(list = ls())
> apollo_initialise()
Apollo ignition sequence completed
> database <- read_excel("Dati_final.xlsx")
                                                                                       
> database <- subset(database, database$pasta==1)
> apollo_initialise()
Apollo ignition sequence completed
> ### Set core controls
> apollo_control = list(
+   modelName  ="MNL",
+   modelDescr ="MNL model COO in WTP space",
+   indivID    ="Individual"
+ )
> apollo_beta=c(asc_italy  = 0,
+               asc_eu  = 0,
+               asc_extraeu = 0,
+               asc_nolabel = 0,
+               asc_nobuy = 0,
+               b_price = 0,
+               cet_italy = 0,
+               cet_eu = 0,
+               cet_extraeu = 0,
+               cet_nolabel = 0,
+               cet_nobuy = 0,
+               look_italy = 0,
+               look_eu = 0,
+               look_extraeu = 0,
+               look_nolabel = 0,
+               look_nobuy = 0,
+               knowledge_italy = 0,
+               knowledge_eu = 0,
+               knowledge_extraeu = 0,
+               knowledge_nolabel = 0,
+               knowledge_nobuy = 0)
> apollo_fixed = c("asc_nobuy", "cet_nobuy", "look_nobuy", "knowledge_nobuy")
> apollo_inputs = apollo_validateInputs()
Several observations per individual detected based on the value of Individual.
  Setting panelData in apollo_control set to TRUE.
All checks on apollo_control completed.
All checks on database completed.
> 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()
+   
+   ### List of utilities: these must use the same names as in mnl_settings, order is irrelevant
+   V = list()
+   V[['italy']] = b_price*(asc_italy + cet_italy * CET_high + look_italy * origin_look_always +
+                                         knowledge_italy * knowledge + price_italy)
+   V[["eu"]]  = b_price*(asc_eu + cet_eu * CET_high + look_eu * origin_look_always +
+                                    knowledge_eu * knowledge + price_eu)
+   V[["extraeu"]]  = b_price*(asc_extraeu + cet_extraeu * CET_high + look_extraeu * origin_look_always +
+                                              knowledge_extraeu * knowledge + price_extraeu)
+   V[["nolabel"]] = b_price*(asc_nolabel + cet_nolabel * CET_high + look_nolabel * origin_look_always +
+                                             knowledge_nolabel * knowledge + price_nolabel)
+   V[["nobuy"]] = b_price*(asc_nobuy + cet_nobuy * CET_high + look_nobuy * origin_look_always +
+                                         knowledge_nobuy * knowledge + price_nobuy)
+   
+   ### Define settings for MNL model component
+   mnl_settings = list(
+     alternatives = c(nolabel=1, italy=2, eu=3, extraeu=4, nobuy=5),
+     choiceVar    = answer,
+     utilities    = V
+   )
+   
+   ### Compute probabilities using MNL model
+   P[["model"]] = apollo_mnl(mnl_settings, functionality)
+   
+   ### Take product across observation for same individual
+   P = apollo_panelProd(P, apollo_inputs, functionality)
+   
+   ### Prepare and return outputs of function
+   P = apollo_prepareProb(P, apollo_inputs, functionality)
+   return(P)
+ }
> model_mnl_wtp_pasta = apollo_estimate(apollo_beta, apollo_fixed, apollo_probabilities, apollo_inputs)
Preparing user-defined functions.

Testing likelihood function...
Setting "avail" is missing, so full availability is assumed.

Overview of choices for MNL model component :
                                 nolabel  italy     eu extraeu nobuy
Times available                   441.00 441.00 441.00  441.00 441.0
Times chosen                       17.00 277.00  70.00   21.00  56.0
Percentage chosen overall           3.85  62.81  15.87    4.76  12.7
Percentage chosen when available    3.85  62.81  15.87    4.76  12.7


Pre-processing likelihood function...

Testing influence of parameters
Starting main estimation

BGW using analytic model derivatives supplied by caller...


Iterates will be written to: 
 /Users/giudi/Desktop/Cattolica/Paper country of origin/Stime apollo/MNL_iterations.csv    it    nf     F            RELDF    PRELDF    RELDX    MODEL stppar
     0     1 7.097621194e+02
     1     3 7.065211990e+02 4.566e-03 5.771e-03 1.00e+00   G   4.39e-01
     2     5 6.373780988e+02 9.786e-02 1.999e-01 1.00e+00   G   3.53e-01
     3     7 5.722487337e+02 1.022e-01 1.746e-01 2.38e-01   G   4.06e-03
     4     8 5.094324253e+02 1.098e-01 1.110e-01 4.33e-01   G   2.26e-03
     5     9 4.910000805e+02 3.618e-02 6.098e-02 3.39e-01   G   1.54e-03
     6    10 4.771361316e+02 2.824e-02 4.496e-02 2.98e-01   G   9.10e-04
     7    11 4.761928990e+02 1.977e-03 2.195e-02 2.73e-01   G   5.64e-04
     8    12 4.676098046e+02 1.802e-02 2.138e-02 1.13e-01   G   9.99e-04
     9    14 4.671717827e+02 9.367e-04 9.982e-04 3.72e-02  G-S  0.00e+00
    10    15 4.671220464e+02 1.065e-04 1.081e-04 6.28e-02   S   0.00e+00
    11    18 4.670608499e+02 1.310e-04 1.535e-04 2.08e-02  S-G  1.57e-02
    12    19 4.670515654e+02 1.988e-05 9.009e-05 2.13e-02   S   2.62e-02
    13    20 4.670191820e+02 6.934e-05 1.002e-04 2.05e-02   G   1.29e-02
    14    22 4.669828227e+02 7.785e-05 1.491e-04 5.46e-02   S   7.92e-03
    15    23 4.669408821e+02 8.981e-05 1.399e-04 5.23e-02   G   5.02e-03
    16    24 4.669009818e+02 8.545e-05 1.222e-04 4.83e-02   G   5.02e-03
    17    25 4.668696414e+02 6.712e-05 1.155e-04 5.31e-02   G   4.17e-03
    18    26 4.668334160e+02 7.759e-05 1.101e-04 4.70e-02   G   4.17e-03
    19    27 4.668109237e+02 4.818e-05 9.588e-05 5.33e-02   G   3.40e-03
    20    28 4.667794143e+02 6.750e-05 9.932e-05 4.69e-02   G   3.40e-03
    21    29 4.667626682e+02 3.588e-05 8.303e-05 5.34e-02   G   2.78e-03
    22    30 4.667353398e+02 5.855e-05 8.981e-05 4.69e-02   G   2.78e-03
    23    31 4.667231418e+02 2.613e-05 7.275e-05 5.34e-02   G   2.27e-03
    24    32 4.666993347e+02 5.101e-05 8.181e-05 4.69e-02   G   2.27e-03
    25    33 4.666907992e+02 1.829e-05 6.444e-05 5.35e-02   G   1.86e-03
    26    34 4.666699066e+02 4.477e-05 7.518e-05 4.69e-02   G   1.86e-03
    27    35 4.666643450e+02 1.192e-05 5.766e-05 5.35e-02   G   1.52e-03
    28    36 4.666458484e+02 3.964e-05 6.973e-05 4.69e-02   G   1.52e-03
    29    37 4.666427104e+02 6.725e-06 5.213e-05 5.35e-02   G   1.24e-03
    30    38 4.666261776e+02 3.543e-05 6.526e-05 4.69e-02   G   1.24e-03
    31    39 4.666250179e+02 2.485e-06 4.761e-05 5.35e-02   G   1.02e-03
    32    40 4.666018753e+02 4.960e-05 5.319e-05 2.25e-02   G   2.07e-03
    33    41 4.665986340e+02 6.947e-06 1.039e-05 2.61e-02   G   1.77e-03
    34    42 4.665946659e+02 8.504e-06 1.101e-05 2.43e-02   G   1.77e-03
    35    43 4.665914669e+02 6.856e-06 8.815e-06 2.33e-02   G   1.77e-03
    36    44 4.665891242e+02 5.021e-06 6.522e-06 2.54e-02   S   2.66e-04
    37    45 4.665863895e+02 5.861e-06 4.231e-06 1.97e-02   S   0.00e+00
    38    46 4.665831387e+02 6.967e-06 1.159e-05 2.62e-02   G   1.39e-03
    39    47 4.665804127e+02 5.842e-06 8.876e-06 2.48e-02   G   1.39e-03
    40    48 4.665775076e+02 6.226e-06 8.358e-06 2.30e-02   G   1.39e-03
    41    50 4.665754257e+02 4.462e-06 7.387e-06 2.61e-02  S-G  1.20e-03
    42    51 4.665727296e+02 5.779e-06 8.068e-06 2.44e-02   G   1.20e-03
    43    52 4.665704895e+02 4.801e-06 6.669e-06 2.34e-02   G   1.20e-03
    44    53 4.665685925e+02 4.066e-06 6.740e-06 2.59e-02   G   1.04e-03
    45    54 4.665663633e+02 4.778e-06 6.969e-06 2.45e-02   G   1.04e-03
    46    55 4.665643513e+02 4.313e-06 6.108e-06 2.33e-02   G   1.04e-03
    47    56 4.665628218e+02 3.278e-06 5.941e-06 2.60e-02   G   8.93e-04
    48    57 4.665608329e+02 4.263e-06 6.430e-06 2.45e-02   G   8.93e-04
    49    58 4.665590952e+02 3.725e-06 5.507e-06 2.33e-02   G   8.93e-04
    50    59 4.665578143e+02 2.745e-06 5.381e-06 2.60e-02   G   7.71e-04
    51    60 4.665560774e+02 3.723e-06 5.873e-06 2.45e-02   G   7.71e-04
    52    61 4.665545506e+02 3.273e-06 5.039e-06 2.33e-02   G   7.71e-04
    53    62 4.665535041e+02 2.243e-06 4.865e-06 2.60e-02   G   6.65e-04
    54    63 4.665519703e+02 3.288e-06 5.424e-06 2.45e-02   G   6.65e-04
    55    64 4.665506333e+02 2.866e-06 4.621e-06 2.33e-02   G   6.65e-04
    56    65 4.665497826e+02 1.823e-06 4.431e-06 2.60e-02   G   5.74e-04
    57    66 4.665484286e+02 2.902e-06 5.027e-06 2.45e-02   G   5.74e-04
    58    67 4.665472529e+02 2.520e-06 4.265e-06 2.33e-02   G   5.74e-04
    59    68 4.665465731e+02 1.457e-06 4.053e-06 2.60e-02   G   4.95e-04
    60    69 4.665453726e+02 2.573e-06 4.688e-06 2.45e-02   G   4.95e-04
    61    70 4.665443369e+02 2.220e-06 3.957e-06 2.33e-02   G   4.95e-04
    62    71 4.665438039e+02 1.142e-06 3.728e-06 2.60e-02   G   4.27e-04
    63    72 4.665427364e+02 2.288e-06 4.394e-06 2.45e-02   G   4.27e-04
    64    73 4.665418211e+02 1.962e-06 3.691e-06 2.33e-02   G   4.27e-04
    65    74 4.665414150e+02 8.704e-07 3.448e-06 2.60e-02   G   3.68e-04
    66    75 4.665404620e+02 2.043e-06 4.141e-06 2.45e-02   G   3.68e-04
    67    76 4.665396507e+02 1.739e-06 3.461e-06 2.33e-02   G   3.68e-04
    68    77 4.665393539e+02 6.360e-07 3.206e-06 2.60e-02   G   3.18e-04
    69    78 4.665384998e+02 1.831e-06 3.922e-06 2.45e-02   G   3.18e-04
    70    79 4.665377782e+02 1.547e-06 3.263e-06 2.33e-02   G   3.18e-04
    71    80 4.665375759e+02 4.337e-07 2.997e-06 2.60e-02   G   2.74e-04
    72    81 4.665368070e+02 1.648e-06 3.734e-06 2.45e-02   G   2.74e-04
    73    82 4.665361628e+02 1.381e-06 3.093e-06 2.33e-02   G   2.74e-04
    74    83 4.665360418e+02 2.592e-07 2.817e-06 2.60e-02   G   2.36e-04
    75    84 4.665347047e+02 2.866e-06 3.055e-06 1.16e-02   G   4.78e-04
    76    85 4.665344851e+02 4.706e-07 6.085e-07 1.19e-02   G   4.78e-04
    77    86 4.665342596e+02 4.834e-07 5.990e-07 1.15e-02   G   4.78e-04
    78    87 4.665340611e+02 4.256e-07 5.916e-07 1.29e-02   G   4.22e-04
    79    88 4.665338331e+02 4.886e-07 6.354e-07 1.25e-02   G   4.22e-04
    80    89 4.665336243e+02 4.475e-07 5.799e-07 1.22e-02   G   4.22e-04
    81    90 4.665334214e+02 4.350e-07 5.544e-07 1.19e-02   G   4.22e-04
    82    91 4.665332311e+02 4.079e-07 5.165e-07 1.16e-02   G   4.22e-04
    83    92 4.665330525e+02 3.829e-07 5.418e-07 1.28e-02   G   3.73e-04
    84    93 4.665328542e+02 4.249e-07 5.685e-07 1.25e-02   G   3.73e-04
    85    94 4.665326666e+02 4.023e-07 5.322e-07 1.22e-02   G   3.73e-04
    86    95 4.665324880e+02 3.828e-07 5.008e-07 1.19e-02   G   3.73e-04
    87    96 4.665323181e+02 3.643e-07 4.717e-07 1.16e-02   G   3.73e-04
    88    97 4.665321635e+02 3.313e-07 4.897e-07 1.28e-02   G   3.30e-04
    89    98 4.665319865e+02 3.793e-07 5.222e-07 1.25e-02   G   3.30e-04
    90    99 4.665318202e+02 3.565e-07 4.859e-07 1.22e-02   G   3.30e-04
    91   100 4.665316612e+02 3.408e-07 4.582e-07 1.19e-02   G   3.30e-04
    92   101 4.665315104e+02 3.232e-07 4.301e-07 1.16e-02   G   3.30e-04
    93   102 4.665313761e+02 2.879e-07 4.455e-07 1.28e-02   G   2.93e-04
    94   103 4.665312187e+02 3.374e-07 4.797e-07 1.25e-02   G   2.93e-04
    95   104 4.665310707e+02 3.171e-07 4.459e-07 1.22e-02   G   2.93e-04
    96   105 4.665309294e+02 3.029e-07 4.198e-07 1.19e-02   G   2.93e-04
    97   106 4.665307954e+02 2.872e-07 3.936e-07 1.16e-02   G   2.93e-04
    98   107 4.665306792e+02 2.491e-07 4.061e-07 1.28e-02   G   2.59e-04
    99   108 4.665305389e+02 3.006e-07 4.423e-07 1.25e-02   G   2.59e-04
   100   109 4.665304074e+02 2.820e-07 4.103e-07 1.22e-02   G   2.59e-04
   101   110 4.665302816e+02 2.695e-07 3.859e-07 1.19e-02   G   2.59e-04
   102   111 4.665301625e+02 2.554e-07 3.613e-07 1.16e-02   G   2.59e-04
   103   112 4.665300623e+02 2.148e-07 3.712e-07 1.28e-02   G   2.29e-04
   104   113 4.665299373e+02 2.680e-07 4.092e-07 1.25e-02   G   2.29e-04
   105   114 4.665298202e+02 2.510e-07 3.788e-07 1.22e-02   G   2.29e-04
   106   115 4.665297082e+02 2.400e-07 3.559e-07 1.19e-02   G   2.29e-04
   107   116 4.665296023e+02 2.272e-07 3.327e-07 1.16e-02   G   2.29e-04
   108   117 4.665295162e+02 1.844e-07 3.404e-07 1.28e-02   G   2.03e-04
   109   118 4.665294047e+02 2.391e-07 3.799e-07 1.25e-02   G   2.03e-04
   110   119 4.665293004e+02 2.235e-07 3.509e-07 1.22e-02   G   2.03e-04
   111   120 4.665292007e+02 2.138e-07 3.293e-07 1.19e-02   G   2.03e-04
   112   121 4.665291063e+02 2.022e-07 3.074e-07 1.16e-02   G   2.03e-04
   113   122 4.665290329e+02 1.575e-07 3.131e-07 1.28e-02   G   1.80e-04
   114   123 4.665289332e+02 2.136e-07 3.539e-07 1.25e-02   G   1.80e-04
   115   124 4.665288403e+02 1.992e-07 3.262e-07 1.22e-02   G   1.80e-04
   116   125 4.665287514e+02 1.906e-07 3.058e-07 1.19e-02   G   1.80e-04
   117   126 4.665286674e+02 1.801e-07 2.849e-07 1.16e-02   G   1.80e-04
   118   127 4.665286050e+02 1.337e-07 2.889e-07 1.28e-02   G   1.59e-04
   119   128 4.665285159e+02 1.910e-07 3.309e-07 1.25e-02   G   1.59e-04
   120   129 4.665284330e+02 1.776e-07 3.043e-07 1.22e-02   G   1.59e-04
   121   130 4.665283537e+02 1.701e-07 2.850e-07 1.19e-02   G   1.59e-04
   122   131 4.665282788e+02 1.605e-07 2.651e-07 1.16e-02   G   1.59e-04
   123   132 4.665282262e+02 1.126e-07 2.675e-07 1.28e-02   G   1.41e-04
   124   133 4.665281465e+02 1.709e-07 3.106e-07 1.25e-02   G   1.41e-04
   125   134 4.665280725e+02 1.586e-07 2.850e-07 1.22e-02   G   1.41e-04
   126   135 4.665280016e+02 1.520e-07 2.666e-07 1.19e-02   G   1.41e-04
   127   136 4.665279348e+02 1.432e-07 2.475e-07 1.16e-02   G   1.41e-04
   128   137 4.665278910e+02 9.398e-08 2.485e-07 1.28e-02   G   1.25e-04
   129   138 4.665278195e+02 1.532e-07 2.926e-07 1.25e-02   G   1.25e-04
   130   139 4.665277534e+02 1.417e-07 2.679e-07 1.22e-02   G   1.25e-04
   131   140 4.665276900e+02 1.359e-07 2.503e-07 1.19e-02   G   1.25e-04
   132   141 4.665276303e+02 1.279e-07 2.320e-07 1.16e-02   G   1.25e-04
   133   142 4.665275942e+02 7.747e-08 2.318e-07 1.28e-02   G   1.10e-04
   134   143 4.665275300e+02 1.375e-07 2.767e-07 1.25e-02   G   1.10e-04
   135   144 4.665274709e+02 1.268e-07 2.527e-07 1.22e-02   G   1.10e-04
   136   145 4.665274141e+02 1.217e-07 2.359e-07 1.19e-02   G   1.10e-04
   137   146 4.665273608e+02 1.143e-07 2.182e-07 1.16e-02   G   1.10e-04
   138   147 4.665273315e+02 6.286e-08 2.169e-07 1.28e-02   G   9.76e-05
   139   148 4.665272738e+02 1.236e-07 2.626e-07 1.25e-02   G   9.76e-05
   140   149 4.665272208e+02 1.136e-07 2.393e-07 1.22e-02   G   9.76e-05
   141   150 4.665271699e+02 1.091e-07 2.231e-07 1.19e-02   G   9.76e-05
   142   151 4.665271222e+02 1.023e-07 2.060e-07 1.16e-02   G   9.76e-05
   143   152 4.665270989e+02 4.992e-08 2.038e-07 1.28e-02   G   8.64e-05
   144   153 4.665270470e+02 1.113e-07 2.501e-07 1.25e-02   G   8.64e-05
   145   154 4.665269995e+02 1.019e-07 2.274e-07 1.22e-02   G   8.64e-05
   146   155 4.665269538e+02 9.791e-08 2.118e-07 1.19e-02   G   8.64e-05
   147   156 4.665269110e+02 9.166e-08 1.952e-07 1.16e-02   G   8.64e-05
   148   157 4.665268931e+02 3.847e-08 1.922e-07 1.28e-02   G   7.65e-05
   149   158 4.665268462e+02 1.004e-07 2.390e-07 1.25e-02   G   7.65e-05
   150   159 4.665268035e+02 9.151e-08 2.169e-07 1.22e-02   G   7.65e-05
   151   160 4.665267625e+02 8.805e-08 2.018e-07 1.19e-02   G   7.65e-05
   152   161 4.665267241e+02 8.225e-08 1.857e-07 1.16e-02   G   7.65e-05
   153   162 4.665267109e+02 2.834e-08 1.819e-07 1.28e-02   G   6.77e-05
   154   163 4.665266685e+02 9.080e-08 2.292e-07 1.25e-02   G   6.77e-05
   155   164 4.665266301e+02 8.235e-08 2.076e-07 1.22e-02   G   6.77e-05
   156   165 4.665265931e+02 7.931e-08 1.929e-07 1.19e-02   G   6.77e-05
   157   166 4.665265586e+02 7.392e-08 1.773e-07 1.16e-02   G   6.77e-05
   158   167 4.665265496e+02 1.936e-08 1.728e-07 1.28e-02   G   5.99e-05
   159   168 4.665265112e+02 8.227e-08 2.206e-07 1.25e-02   G   5.99e-05
   160   169 4.665264766e+02 7.423e-08 1.994e-07 1.22e-02   G   5.99e-05
   161   170 4.665264432e+02 7.158e-08 1.851e-07 1.19e-02   G   5.99e-05
   162   171 4.665264121e+02 6.654e-08 1.698e-07 1.16e-02   G   5.99e-05
   163   172 4.665264068e+02 1.142e-08 1.647e-07 1.28e-02   G   5.31e-05
   164   173 4.665263269e+02 1.713e-07 1.832e-07 6.07e-03   G   1.07e-04
   165   174 4.665263138e+02 2.799e-08 3.743e-08 6.14e-03   G   1.07e-04
   166   175 4.665263000e+02 2.960e-08 3.795e-08 6.05e-03   G   1.07e-04
   167   176 4.665262875e+02 2.689e-08 3.463e-08 5.99e-03   G   1.07e-04
   168   177 4.665262748e+02 2.725e-08 3.450e-08 5.91e-03   G   1.07e-04
   169   178 4.665262627e+02 2.589e-08 3.276e-08 5.85e-03   G   1.07e-04
   170   179 4.665262507e+02 2.573e-08 3.225e-08 5.78e-03   G   1.07e-04
   171   180 4.665262393e+02 2.429e-08 3.391e-08 6.39e-03   G   9.56e-05
   172   181 4.665262265e+02 2.751e-08 3.662e-08 6.29e-03   G   9.56e-05
   173   182 4.665262142e+02 2.643e-08 3.509e-08 6.22e-03   G   9.56e-05
   174   183 4.665262020e+02 2.601e-08 3.424e-08 6.14e-03   G   9.56e-05
   175   184 4.665261903e+02 2.521e-08 3.304e-08 6.07e-03   G   9.56e-05
   176   185 4.665261788e+02 2.470e-08 3.216e-08 5.99e-03   G   9.56e-05
   177   186 4.665261676e+02 2.403e-08 3.114e-08 5.92e-03   G   9.56e-05
   178   187 4.665261566e+02 2.351e-08 3.030e-08 5.85e-03   G   9.56e-05
   179   188 4.665261459e+02 2.292e-08 2.940e-08 5.78e-03   G   9.56e-05
   180   189 4.665261358e+02 2.162e-08 3.117e-08 6.39e-03   G   8.57e-05
   181   190 4.665261243e+02 2.460e-08 3.366e-08 6.30e-03   G   8.57e-05
   182   191 4.665261132e+02 2.380e-08 3.243e-08 6.22e-03   G   8.57e-05
   183   192 4.665261024e+02 2.330e-08 3.151e-08 6.14e-03   G   8.57e-05
   184   193 4.665260918e+02 2.267e-08 3.048e-08 6.07e-03   G   8.57e-05
   185   194 4.665260814e+02 2.215e-08 2.960e-08 5.99e-03   G   8.57e-05
   186   195 4.665260714e+02 2.159e-08 2.869e-08 5.92e-03   G   8.57e-05
   187   196 4.665260615e+02 2.109e-08 2.786e-08 5.85e-03   G   8.57e-05
   188   197 4.665260519e+02 2.058e-08 2.705e-08 5.78e-03   G   8.57e-05
   189   198 4.665260430e+02 1.906e-08 2.859e-08 6.39e-03   G   7.68e-05
   190   199 4.665260327e+02 2.212e-08 3.117e-08 6.30e-03   G   7.68e-05
   191   200 4.665260228e+02 2.137e-08 2.998e-08 6.22e-03   G   7.68e-05
   192   201 4.665260130e+02 2.094e-08 2.913e-08 6.14e-03   G   7.68e-05
   193   202 4.665260035e+02 2.036e-08 2.815e-08 6.07e-03   G   7.68e-05
   194   203 4.665259942e+02 1.990e-08 2.733e-08 5.99e-03   G   7.68e-05
   195   204 4.665259852e+02 1.939e-08 2.647e-08 5.92e-03   G   7.68e-05
   196   205 4.665259763e+02 1.894e-08 2.570e-08 5.85e-03   G   7.68e-05
   197   206 4.665259677e+02 1.848e-08 2.493e-08 5.78e-03   G   7.68e-05
   198   207 4.665259599e+02 1.677e-08 2.629e-08 6.39e-03   G   6.88e-05
   199   208 4.665259506e+02 1.988e-08 2.892e-08 6.30e-03   G   6.88e-05
   200   209 4.665259416e+02 1.920e-08 2.778e-08 6.22e-03   G   6.88e-05

***** Iteration limit *****

Estimated parameters:
                     Estimate
asc_italy           3.696e+04
asc_eu               3462.774
asc_extraeu        -3.319e+04
asc_nolabel        -2.640e+04
asc_nobuy               0.000
b_price             4.281e-05
cet_italy           2.184e+04
cet_eu              1.081e+04
cet_extraeu         -8550.641
cet_nolabel          5200.902
cet_nobuy               0.000
look_italy         -2.212e+04
look_eu             -7736.336
look_extraeu        1.240e+04
look_nolabel       -1.501e+04
look_nobuy              0.000
knowledge_italy     3.790e+04
knowledge_eu        4.253e+04
knowledge_extraeu   5.930e+04
knowledge_nolabel   6.054e+04
knowledge_nobuy         0.000

Final LL: -466.5259

WARNING: Iteration limit exceeded. No covariance matrix will be computed. You may wish
  to use the current estimates as starting values for a new estimation with a
  higher limit for iterations. 

  Current process will resume in 3 seconds unless interrupted by the user...

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...
Calculating other model fit measures

Your model was estimated using the BGW algorithm. Please acknowledge this by
  citing Bunch et al. (1993) - DOI 10.1145/151271.151279
> apollo_modelOutput(model_mnl_wtp_pasta)
Model run by giudi using Apollo 0.3.1 on R 4.2.3 for Darwin.
Please acknowledge the use of Apollo by citing Hess & Palma (2019)
  DOI 10.1016/j.jocm.2019.100170
  www.ApolloChoiceModelling.com

Model name                                  : MNL
Model description                           : MNL model COO in WTP space
Model run at                                : 2024-02-05 09:12:55
Estimation method                           : bgw
Model diagnosis                             : Iteration limit
Number of individuals                       : 49
Number of rows in database                  : 441
Number of modelled outcomes                 : 441

Number of cores used                        :  1 
Model without mixing

LL(start)                                   : -709.76
LL at equal shares, LL(0)                   : -709.76
LL at observed shares, LL(C)                : -492.5
LL(final)                                   : -466.53
Rho-squared vs equal shares                  :  0.3427 
Adj.Rho-squared vs equal shares              :  0.3187 
Rho-squared vs observed shares               :  0.0527 
Adj.Rho-squared vs observed shares           :  0.0263 
AIC                                         :  967.05 
BIC                                         :  1036.57 

Estimated parameters                        : 17
Time taken (hh:mm:ss)                       :  00:00:3.78 
     pre-estimation                         :  00:00:0.25 
     estimation                             :  00:00:3.52 
     post-estimation                        :  00:00:0.01 
Iterations                                  :  200 (Iteration limit) 

Unconstrained optimisation.

Estimates:
                     Estimate        s.e.   t.rat.(0)    Rob.s.e. Rob.t.rat.(0)
asc_italy           3.696e+04          NA          NA          NA            NA
asc_eu               3462.774          NA          NA          NA            NA
asc_extraeu        -3.319e+04          NA          NA          NA            NA
asc_nolabel        -2.640e+04          NA          NA          NA            NA
asc_nobuy               0.000          NA          NA          NA            NA
b_price             4.281e-05          NA          NA          NA            NA
cet_italy           2.184e+04          NA          NA          NA            NA
cet_eu              1.081e+04          NA          NA          NA            NA
cet_extraeu         -8550.641          NA          NA          NA            NA
cet_nolabel          5200.902          NA          NA          NA            NA
cet_nobuy               0.000          NA          NA          NA            NA
look_italy         -2.212e+04          NA          NA          NA            NA
look_eu             -7736.336          NA          NA          NA            NA
look_extraeu        1.240e+04          NA          NA          NA            NA
look_nolabel       -1.501e+04          NA          NA          NA            NA
look_nobuy              0.000          NA          NA          NA            NA
knowledge_italy     3.790e+04          NA          NA          NA            NA
knowledge_eu        4.253e+04          NA          NA          NA            NA
knowledge_extraeu   5.930e+04          NA          NA          NA            NA
knowledge_nolabel   6.054e+04          NA          NA          NA            NA
knowledge_nobuy         0.000          NA          NA          NA            NA
Thank you.

G
dpalma
Posts: 190
Joined: 24 Apr 2020, 17:54

Re: Estimation of MNL and MMNL in WTP space issues

Post by dpalma »

Hi,

We looked at your new results with Stephane, and we think you should try running your WTP model again, but this time starting the b_price=-.1 (or any other small negative number).

Best
David
Post Reply