NaNs
Posted: 17 Sep 2020, 16:48
Hi forum,
I am trying to estimate an NLM and MNL Model, which seems to be working well. However, there is still the issue of the NaNs.
Here the complete output:
Model run using Apollo for R, version 0.1.0
www.ApolloChoiceModelling.com
Model name : MNL
Model description : MNL Model with Data
Model run at : 2020-09-17 17:41:22
Estimation method : bfgs
Model diagnosis : successful convergence
Number of individuals : 500
Number of observations : 2500
Number of cores used : 1
Model without mixing
LL(start) : -6309.866
LL(0) : -6309.866
LL(final) : -3451.108
Rho-square (0) : 0.4531
Adj.Rho-square (0) : 0.4513
AIC : 6924.22
BIC : 6988.28
Estimated parameters : 11
Time taken (hh:mm:ss) : 00:00:21.27
Iterations : 25
Min abs eigenvalue of hessian : 0
Some eigenvalues of hessian are positive, indicating potential problems!
Estimates:
Estimate Std.err. t.ratio(0) Rob.std.err. Rob.t.ratio(0)
b_tt_Price1 0.9851 NaN NaN 84.7746 0.01
b_tt_Price2 0.3528 NaN NaN 85.0660 0.00
b_tt_Price3 1.4685 NaN NaN 84.0435 0.02
b_tt_Price4 -0.5446 NaN NaN 84.2205 -0.01
b_tt_Brand 2.6037 NaN NaN 175.5951 0.01
b_tt_No_Name_Brand_1 1.5808 NaN NaN 192.7041 0.01
b_tt_No_Name_Brand_2 -1.9227 NaN NaN 175.4344 -0.01
b_tt_No_Bio -1.6127 NaN NaN 92.7732 -0.02
b_tt_Yes_Bio 3.8745 NaN NaN NaN NaN
b_tt_Outside_Option1 -1.0949 3576.351 0 63.4085 -0.02
b_tt_Outside_Option2 -1.1669 3576.351 0 60.9444 -0.02
Overview of choices for model component "MNL"
B11 B12 B13 B14 B21 B22 B23 B24 NB111 NB112 NB113 NB114 NB121 NB122 NB123 NB124 NB211 NB212
Times available 1319.00 1261.00 1279.00 1282.00 1283.00 1263.00 1275.00 1268.00 1343.00 1292.00 1296.00 1304.00 1328.00 1301 1309.00 1312.00 1329.00 1289
Times chosen 604.00 354.00 265.00 35.00 110.00 69.00 41.00 11.00 14.00 1.00 535.00 103.00 1.00 0 112.00 16.00 2.00 0
Percentage chosen overall 24.16 14.16 10.60 1.40 4.40 2.76 1.64 0.44 0.56 0.04 21.40 4.12 0.04 0 4.48 0.64 0.08 0
Percentage chosen when available 45.79 28.07 20.72 2.73 8.57 5.46 3.22 0.87 1.04 0.08 41.28 7.90 0.08 0 8.56 1.22 0.15 0
NB213 NB214 NB221 NB222 NB223 NB224 OO1 OO2
Times available 1269.00 1288.00 1299 1278 1264.00 1285.00 2500.00 2500.00
Times chosen 62.00 16.00 0 0 8.00 2.00 72.00 67.00
Percentage chosen overall 2.48 0.64 0 0 0.32 0.08 2.88 2.68
Percentage chosen when available 4.89 1.24 0 0 0.63 0.16 2.88 2.68
WARNING: some alternatives are never chosen in your data!
My assumption is that it comes from my data. Here an example of my the first individual´s choice:
ID Brand No_Name_Brand_1 No_Name_Brand_2 No_Bio Yes_Bio Price1 Price2 Price3 Price4 female Outside_Option1 Outside_Option2 AV_Barilla11 AV_Barilla12 AV_Barilla13 AV_Barilla14 AV_Barilla21 AV_Barilla22 AV_Barilla23 AV_Barilla24 AV_NoNameBrand111 AV_NoNameBrand112 AV_NoNameBrand113 AV_NoNameBrand114 AV_NoNameBrand121 AV_NoNameBrand122 AV_NoNameBrand123 AV_NoNameBrand124 AV_NoNameBrand211 AV_NoNameBrand212 AV_NoNameBrand213 AV_NoNameBrand214 AV_NoNameBrand221 AV_NoNameBrand222 AV_NoNameBrand223 AV_NoNameBrand224 AV_Outside1 AV_Outside2 choice
1 0 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 11
and here the code:
# ################################################################# #
#### 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 ="MNL",
modelDescr ="MNL Model with Data",
indivID ="ID"
)
# ################################################################# #
#### LOAD DATA AND APPLY ANY TRANSFORMATIONS ####
# ################################################################# #
database = read.csv("Data_Model.csv",
fileEncoding="UTF-8-BOM",
sep = ";",
header = TRUE)
# ################################################################# #
#### DEFINE MODEL PARAMETERS ####
# ################################################################# #
### Vector of parameters, including any that are kept fixed in estimation
apollo_beta=c(b_tt_Price1 = 0,
b_tt_Price2 = 0,
b_tt_Price3 = 0,
b_tt_Price4 = 0,
b_tt_Brand = 0,
b_tt_No_Name_Brand_1 =0,
b_tt_No_Name_Brand_2 =0,
b_tt_No_Bio = 0,
b_tt_Yes_Bio =0,
b_tt_Outside_Option1 =0,
b_tt_Outside_Option2 =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()
# ################################################################# #
#### GROUP AND VALIDATE INPUTS ####
# ################################################################# #
apollo_inputs = apollo_validateInputs()
# ################################################################# #
#### DEFINE MODEL AND LIKELIHOOD FUNCTION ####
# ################################################################# #
apollo_probabilities=function(apollo_beta, apollo_inputs, functionality="estimate_settings$bootstrapSE=TRUE"){
### 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[['B11']] = b_tt_Price1*AV_Barilla11 + b_tt_Yes_Bio*AV_Barilla11 + b_tt_Brand*AV_Barilla11
V[['B12']] = b_tt_Price2 *AV_Barilla12+ b_tt_Yes_Bio *AV_Barilla12+ b_tt_Brand*AV_Barilla12
V[['B13']] = b_tt_Price3 *AV_Barilla13 + b_tt_Yes_Bio*AV_Barilla13 + b_tt_Brand*AV_Barilla13
V[['B14']] = b_tt_Price4 *AV_Barilla14+ b_tt_Yes_Bio*AV_Barilla14 + b_tt_Brand*AV_Barilla14
V[['B21']] = b_tt_Price1*AV_Barilla21 + b_tt_No_Bio*AV_Barilla21 + b_tt_Brand*AV_Barilla21
V[['B22']] = b_tt_Price2*AV_Barilla22 + b_tt_No_Bio*AV_Barilla22 + b_tt_Brand*AV_Barilla22
V[['B23']] = b_tt_Price3 *AV_Barilla23+ b_tt_No_Bio*AV_Barilla23 + b_tt_Brand*AV_Barilla23
V[['B24']] = b_tt_Price4*AV_Barilla24 + b_tt_No_Bio*AV_Barilla24 + b_tt_Brand*AV_Barilla24
V[['NB111']] = b_tt_Price1*AV_NoNameBrand111 + b_tt_Yes_Bio*AV_NoNameBrand111 + b_tt_No_Name_Brand_1*AV_NoNameBrand111
V[['NB112']] = b_tt_Price2*AV_NoNameBrand112 + b_tt_Yes_Bio*AV_NoNameBrand112 + b_tt_No_Name_Brand_1*AV_NoNameBrand112
V[['NB113']] = b_tt_Price3*AV_NoNameBrand113 + b_tt_Yes_Bio*AV_NoNameBrand113 + b_tt_No_Name_Brand_1*AV_NoNameBrand113
V[['NB114']] = b_tt_Price4*AV_NoNameBrand114 + b_tt_Yes_Bio*AV_NoNameBrand114 + b_tt_No_Name_Brand_1*AV_NoNameBrand114
V[['NB121']] = b_tt_Price1 *AV_NoNameBrand121+ b_tt_No_Bio*AV_NoNameBrand121 + b_tt_No_Name_Brand_1*AV_NoNameBrand121
V[['NB122']] = b_tt_Price2 *AV_NoNameBrand122+ b_tt_No_Bio*AV_NoNameBrand122 + b_tt_No_Name_Brand_1*AV_NoNameBrand122
V[['NB123']] = b_tt_Price3*AV_NoNameBrand123 + b_tt_No_Bio*AV_NoNameBrand123 + b_tt_No_Name_Brand_1*AV_NoNameBrand123
V[['NB124']] = b_tt_Price4*AV_NoNameBrand124 + b_tt_No_Bio*AV_NoNameBrand124 + b_tt_No_Name_Brand_1*AV_NoNameBrand124
V[['NB211']] = b_tt_Price1 *AV_NoNameBrand211+ b_tt_Yes_Bio*AV_NoNameBrand211 + b_tt_No_Name_Brand_2*AV_NoNameBrand211
V[['NB212']] = b_tt_Price2 *AV_NoNameBrand212+ b_tt_Yes_Bio*AV_NoNameBrand212 + b_tt_No_Name_Brand_2*AV_NoNameBrand212
V[['NB213']] = b_tt_Price3 *AV_NoNameBrand213 + b_tt_Yes_Bio*AV_NoNameBrand213 + b_tt_No_Name_Brand_2*AV_NoNameBrand213
V[['NB214']] = b_tt_Price4*AV_NoNameBrand214 + b_tt_Yes_Bio*AV_NoNameBrand214 + b_tt_No_Name_Brand_2*AV_NoNameBrand214
V[['NB221']] = b_tt_Price1*AV_NoNameBrand221 + b_tt_No_Bio *AV_NoNameBrand221+ b_tt_No_Name_Brand_2*AV_NoNameBrand221
V[['NB222']] = b_tt_Price2*AV_NoNameBrand222 + b_tt_No_Bio *AV_NoNameBrand222+ b_tt_No_Name_Brand_2*AV_NoNameBrand222
V[['NB223']] = b_tt_Price3*AV_NoNameBrand223 + b_tt_No_Bio*AV_NoNameBrand223 + b_tt_No_Name_Brand_2*AV_NoNameBrand223
V[['NB224']] = b_tt_Price4*AV_NoNameBrand224 + b_tt_No_Bio*AV_NoNameBrand224 + b_tt_No_Name_Brand_2*AV_NoNameBrand224
V[['OO1']] = b_tt_Outside_Option1*AV_Outside1
V[['OO2']] = b_tt_Outside_Option2*AV_Outside2
### Define settings for MNL model component
mnl_settings = list(
alternatives = c(B11=1, B12=2, B13=3, B14=4, B21=5, B22=6,B23=7, B24=8,
NB111=9, NB112=10, NB113=11,NB114=12, NB121=13, NB122=14,NB123=15,NB124=16,
NB211=17, NB212=18, NB213=19,NB214=20, NB221=21, NB222=22,NB223=23,NB224=24,
OO1=25, OO2=26),
avail = list(B11=AV_Barilla11, B12=AV_Barilla12, B13=AV_Barilla13, B14=AV_Barilla14,
B21=AV_Barilla21, B22=AV_Barilla22, B23=AV_Barilla23, B24=AV_Barilla24,
NB111=AV_NoNameBrand111, NB112=AV_NoNameBrand112, NB113=AV_NoNameBrand113, NB114=AV_NoNameBrand114,
NB121=AV_NoNameBrand121, NB122=AV_NoNameBrand122, NB123=AV_NoNameBrand123, NB124=AV_NoNameBrand124,
NB211=AV_NoNameBrand211, NB212=AV_NoNameBrand212, NB213=AV_NoNameBrand213, NB214=AV_NoNameBrand214,
NB221=AV_NoNameBrand221, NB222=AV_NoNameBrand222, NB223=AV_NoNameBrand223, NB224=AV_NoNameBrand224,
OO1=AV_Outside1, OO2=AV_Outside2),
choiceVar = choice,
V = 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 ESTIMATION ####
# ################################################################# #
model = apollo_estimate(apollo_beta, apollo_fixed, apollo_probabilities, apollo_inputs)
It would be great, if you could help me.
Thanks upfront & regards,
Tibor
I am trying to estimate an NLM and MNL Model, which seems to be working well. However, there is still the issue of the NaNs.
Here the complete output:
Model run using Apollo for R, version 0.1.0
www.ApolloChoiceModelling.com
Model name : MNL
Model description : MNL Model with Data
Model run at : 2020-09-17 17:41:22
Estimation method : bfgs
Model diagnosis : successful convergence
Number of individuals : 500
Number of observations : 2500
Number of cores used : 1
Model without mixing
LL(start) : -6309.866
LL(0) : -6309.866
LL(final) : -3451.108
Rho-square (0) : 0.4531
Adj.Rho-square (0) : 0.4513
AIC : 6924.22
BIC : 6988.28
Estimated parameters : 11
Time taken (hh:mm:ss) : 00:00:21.27
Iterations : 25
Min abs eigenvalue of hessian : 0
Some eigenvalues of hessian are positive, indicating potential problems!
Estimates:
Estimate Std.err. t.ratio(0) Rob.std.err. Rob.t.ratio(0)
b_tt_Price1 0.9851 NaN NaN 84.7746 0.01
b_tt_Price2 0.3528 NaN NaN 85.0660 0.00
b_tt_Price3 1.4685 NaN NaN 84.0435 0.02
b_tt_Price4 -0.5446 NaN NaN 84.2205 -0.01
b_tt_Brand 2.6037 NaN NaN 175.5951 0.01
b_tt_No_Name_Brand_1 1.5808 NaN NaN 192.7041 0.01
b_tt_No_Name_Brand_2 -1.9227 NaN NaN 175.4344 -0.01
b_tt_No_Bio -1.6127 NaN NaN 92.7732 -0.02
b_tt_Yes_Bio 3.8745 NaN NaN NaN NaN
b_tt_Outside_Option1 -1.0949 3576.351 0 63.4085 -0.02
b_tt_Outside_Option2 -1.1669 3576.351 0 60.9444 -0.02
Overview of choices for model component "MNL"
B11 B12 B13 B14 B21 B22 B23 B24 NB111 NB112 NB113 NB114 NB121 NB122 NB123 NB124 NB211 NB212
Times available 1319.00 1261.00 1279.00 1282.00 1283.00 1263.00 1275.00 1268.00 1343.00 1292.00 1296.00 1304.00 1328.00 1301 1309.00 1312.00 1329.00 1289
Times chosen 604.00 354.00 265.00 35.00 110.00 69.00 41.00 11.00 14.00 1.00 535.00 103.00 1.00 0 112.00 16.00 2.00 0
Percentage chosen overall 24.16 14.16 10.60 1.40 4.40 2.76 1.64 0.44 0.56 0.04 21.40 4.12 0.04 0 4.48 0.64 0.08 0
Percentage chosen when available 45.79 28.07 20.72 2.73 8.57 5.46 3.22 0.87 1.04 0.08 41.28 7.90 0.08 0 8.56 1.22 0.15 0
NB213 NB214 NB221 NB222 NB223 NB224 OO1 OO2
Times available 1269.00 1288.00 1299 1278 1264.00 1285.00 2500.00 2500.00
Times chosen 62.00 16.00 0 0 8.00 2.00 72.00 67.00
Percentage chosen overall 2.48 0.64 0 0 0.32 0.08 2.88 2.68
Percentage chosen when available 4.89 1.24 0 0 0.63 0.16 2.88 2.68
WARNING: some alternatives are never chosen in your data!
My assumption is that it comes from my data. Here an example of my the first individual´s choice:
ID Brand No_Name_Brand_1 No_Name_Brand_2 No_Bio Yes_Bio Price1 Price2 Price3 Price4 female Outside_Option1 Outside_Option2 AV_Barilla11 AV_Barilla12 AV_Barilla13 AV_Barilla14 AV_Barilla21 AV_Barilla22 AV_Barilla23 AV_Barilla24 AV_NoNameBrand111 AV_NoNameBrand112 AV_NoNameBrand113 AV_NoNameBrand114 AV_NoNameBrand121 AV_NoNameBrand122 AV_NoNameBrand123 AV_NoNameBrand124 AV_NoNameBrand211 AV_NoNameBrand212 AV_NoNameBrand213 AV_NoNameBrand214 AV_NoNameBrand221 AV_NoNameBrand222 AV_NoNameBrand223 AV_NoNameBrand224 AV_Outside1 AV_Outside2 choice
1 0 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 11
and here the code:
# ################################################################# #
#### 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 ="MNL",
modelDescr ="MNL Model with Data",
indivID ="ID"
)
# ################################################################# #
#### LOAD DATA AND APPLY ANY TRANSFORMATIONS ####
# ################################################################# #
database = read.csv("Data_Model.csv",
fileEncoding="UTF-8-BOM",
sep = ";",
header = TRUE)
# ################################################################# #
#### DEFINE MODEL PARAMETERS ####
# ################################################################# #
### Vector of parameters, including any that are kept fixed in estimation
apollo_beta=c(b_tt_Price1 = 0,
b_tt_Price2 = 0,
b_tt_Price3 = 0,
b_tt_Price4 = 0,
b_tt_Brand = 0,
b_tt_No_Name_Brand_1 =0,
b_tt_No_Name_Brand_2 =0,
b_tt_No_Bio = 0,
b_tt_Yes_Bio =0,
b_tt_Outside_Option1 =0,
b_tt_Outside_Option2 =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()
# ################################################################# #
#### GROUP AND VALIDATE INPUTS ####
# ################################################################# #
apollo_inputs = apollo_validateInputs()
# ################################################################# #
#### DEFINE MODEL AND LIKELIHOOD FUNCTION ####
# ################################################################# #
apollo_probabilities=function(apollo_beta, apollo_inputs, functionality="estimate_settings$bootstrapSE=TRUE"){
### 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[['B11']] = b_tt_Price1*AV_Barilla11 + b_tt_Yes_Bio*AV_Barilla11 + b_tt_Brand*AV_Barilla11
V[['B12']] = b_tt_Price2 *AV_Barilla12+ b_tt_Yes_Bio *AV_Barilla12+ b_tt_Brand*AV_Barilla12
V[['B13']] = b_tt_Price3 *AV_Barilla13 + b_tt_Yes_Bio*AV_Barilla13 + b_tt_Brand*AV_Barilla13
V[['B14']] = b_tt_Price4 *AV_Barilla14+ b_tt_Yes_Bio*AV_Barilla14 + b_tt_Brand*AV_Barilla14
V[['B21']] = b_tt_Price1*AV_Barilla21 + b_tt_No_Bio*AV_Barilla21 + b_tt_Brand*AV_Barilla21
V[['B22']] = b_tt_Price2*AV_Barilla22 + b_tt_No_Bio*AV_Barilla22 + b_tt_Brand*AV_Barilla22
V[['B23']] = b_tt_Price3 *AV_Barilla23+ b_tt_No_Bio*AV_Barilla23 + b_tt_Brand*AV_Barilla23
V[['B24']] = b_tt_Price4*AV_Barilla24 + b_tt_No_Bio*AV_Barilla24 + b_tt_Brand*AV_Barilla24
V[['NB111']] = b_tt_Price1*AV_NoNameBrand111 + b_tt_Yes_Bio*AV_NoNameBrand111 + b_tt_No_Name_Brand_1*AV_NoNameBrand111
V[['NB112']] = b_tt_Price2*AV_NoNameBrand112 + b_tt_Yes_Bio*AV_NoNameBrand112 + b_tt_No_Name_Brand_1*AV_NoNameBrand112
V[['NB113']] = b_tt_Price3*AV_NoNameBrand113 + b_tt_Yes_Bio*AV_NoNameBrand113 + b_tt_No_Name_Brand_1*AV_NoNameBrand113
V[['NB114']] = b_tt_Price4*AV_NoNameBrand114 + b_tt_Yes_Bio*AV_NoNameBrand114 + b_tt_No_Name_Brand_1*AV_NoNameBrand114
V[['NB121']] = b_tt_Price1 *AV_NoNameBrand121+ b_tt_No_Bio*AV_NoNameBrand121 + b_tt_No_Name_Brand_1*AV_NoNameBrand121
V[['NB122']] = b_tt_Price2 *AV_NoNameBrand122+ b_tt_No_Bio*AV_NoNameBrand122 + b_tt_No_Name_Brand_1*AV_NoNameBrand122
V[['NB123']] = b_tt_Price3*AV_NoNameBrand123 + b_tt_No_Bio*AV_NoNameBrand123 + b_tt_No_Name_Brand_1*AV_NoNameBrand123
V[['NB124']] = b_tt_Price4*AV_NoNameBrand124 + b_tt_No_Bio*AV_NoNameBrand124 + b_tt_No_Name_Brand_1*AV_NoNameBrand124
V[['NB211']] = b_tt_Price1 *AV_NoNameBrand211+ b_tt_Yes_Bio*AV_NoNameBrand211 + b_tt_No_Name_Brand_2*AV_NoNameBrand211
V[['NB212']] = b_tt_Price2 *AV_NoNameBrand212+ b_tt_Yes_Bio*AV_NoNameBrand212 + b_tt_No_Name_Brand_2*AV_NoNameBrand212
V[['NB213']] = b_tt_Price3 *AV_NoNameBrand213 + b_tt_Yes_Bio*AV_NoNameBrand213 + b_tt_No_Name_Brand_2*AV_NoNameBrand213
V[['NB214']] = b_tt_Price4*AV_NoNameBrand214 + b_tt_Yes_Bio*AV_NoNameBrand214 + b_tt_No_Name_Brand_2*AV_NoNameBrand214
V[['NB221']] = b_tt_Price1*AV_NoNameBrand221 + b_tt_No_Bio *AV_NoNameBrand221+ b_tt_No_Name_Brand_2*AV_NoNameBrand221
V[['NB222']] = b_tt_Price2*AV_NoNameBrand222 + b_tt_No_Bio *AV_NoNameBrand222+ b_tt_No_Name_Brand_2*AV_NoNameBrand222
V[['NB223']] = b_tt_Price3*AV_NoNameBrand223 + b_tt_No_Bio*AV_NoNameBrand223 + b_tt_No_Name_Brand_2*AV_NoNameBrand223
V[['NB224']] = b_tt_Price4*AV_NoNameBrand224 + b_tt_No_Bio*AV_NoNameBrand224 + b_tt_No_Name_Brand_2*AV_NoNameBrand224
V[['OO1']] = b_tt_Outside_Option1*AV_Outside1
V[['OO2']] = b_tt_Outside_Option2*AV_Outside2
### Define settings for MNL model component
mnl_settings = list(
alternatives = c(B11=1, B12=2, B13=3, B14=4, B21=5, B22=6,B23=7, B24=8,
NB111=9, NB112=10, NB113=11,NB114=12, NB121=13, NB122=14,NB123=15,NB124=16,
NB211=17, NB212=18, NB213=19,NB214=20, NB221=21, NB222=22,NB223=23,NB224=24,
OO1=25, OO2=26),
avail = list(B11=AV_Barilla11, B12=AV_Barilla12, B13=AV_Barilla13, B14=AV_Barilla14,
B21=AV_Barilla21, B22=AV_Barilla22, B23=AV_Barilla23, B24=AV_Barilla24,
NB111=AV_NoNameBrand111, NB112=AV_NoNameBrand112, NB113=AV_NoNameBrand113, NB114=AV_NoNameBrand114,
NB121=AV_NoNameBrand121, NB122=AV_NoNameBrand122, NB123=AV_NoNameBrand123, NB124=AV_NoNameBrand124,
NB211=AV_NoNameBrand211, NB212=AV_NoNameBrand212, NB213=AV_NoNameBrand213, NB214=AV_NoNameBrand214,
NB221=AV_NoNameBrand221, NB222=AV_NoNameBrand222, NB223=AV_NoNameBrand223, NB224=AV_NoNameBrand224,
OO1=AV_Outside1, OO2=AV_Outside2),
choiceVar = choice,
V = 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 ESTIMATION ####
# ################################################################# #
model = apollo_estimate(apollo_beta, apollo_fixed, apollo_probabilities, apollo_inputs)
It would be great, if you could help me.
Thanks upfront & regards,
Tibor