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.

ICVL Model Identification issues

Ask questions about errors you encouunter. Please make sure to include full details about your model specifications, and ideally your model file.
Post Reply
idserrano
Posts: 7
Joined: 13 May 2020, 21:32

ICVL Model Identification issues

Post by idserrano »

Hi for all members.
Thanks for this amazing package Apollo.
I'm trying to run a ICVL model with 3 LV. First, I ran the ICVL only with 1 LV in order to get good initial values for the full model.
The problem is that the estimated paramaters related to "IP7" indicator are to big when I include the 3 LV. The model works fine with 1 LV, but in the full model is the problem. In others words, the problem is when I ran the full model with 3 LV, the mesurement model of "IP7" indicator related to LV "confidence" showed a big parameter estimated.

My questions are:
1- Why does my model works good with 1 LV but not with the full modell with 3 LV? ¿ What is the problem witn the "IP7" indicator?
2- Why appears some "Not applicable" in the good fitness values (i.e "LL(0, whole model)", etc)

Best wishess
Thanks

These are my results model with 1 LV:

LL(start) : -4172.628
LL(0, whole model) : Not applicable
LL(final, whole model) : -3810.304
Rho-square (0) : Not applicable
Adj.Rho-square (0) : Not applicable
AIC : 7700.61
BIC : 7930.41
LL(0,indic_IP5) : Not applicable
LL(final,indic_IP5) : -528.8341
LL(0,indic_IP7) : Not applicable
LL(final,indic_IP7) : -536.8316
LL(0,indic_IP6) : Not applicable
LL(final,indic_IP6) : -450.2192
LL(0,indic_I5) : Not applicable
LL(final,indic_I5) : -221.8988
LL(0,choice) : -3202.34
LL(final,choice) : -2072.278
Estimated parameters : 40
Time taken (hh:mm:ss) : 01:04:46.59
Iterations : 60
Min abs eigenvalue of hessian : 0.466229

Estimates:
Estimate Std.err. t.ratio(0) Rob.std.err. Rob.t.ratio(0)
asc_compra_agua 0.1645 0.7399 0.22 0.8436 0.19
asc_compra_comida -0.2842 0.7198 -0.39 0.8297 -0.34
asc_compra_agua_comida 1.3279 0.7273 1.83 0.8329 1.59
asc_espera 0.0000 NA NA NA NA
b_costo -0.0296 0.0111 -2.67 0.0110 -2.70
b_ingreso_dis 0.0370 0.0119 3.10 0.0119 3.10
b_tiempo_agua -0.0876 0.0298 -2.94 0.0259 -3.38
b_tiempo_comida -0.0054 0.0029 -1.82 0.0025 -2.19
b_confidence -1.3896 0.1490 -9.33 0.1939 -7.16
gamma_edad_confidence 0.0064 0.2183 0.03 0.2275 0.03
gamma_ninos_h_confidence -0.6871 0.1639 -4.19 0.1670 -4.11
gamma_jov_h_confidence 0.0078 0.1599 0.05 0.1690 0.05
gamma_viej_h_confidence 0.1549 0.1948 0.80 0.1871 0.83
gamma_estu_confidence 1.0538 0.3695 2.85 0.4758 2.21
gamma_empl_confidence 0.7801 0.3343 2.33 0.4520 1.73
gamma_indepen_confidence 1.3506 0.3146 4.29 0.4177 3.23
gamma_ama_casa_confidence 0.9936 0.3662 2.71 0.4708 2.11
gamma_educ_basica_confidence -0.0145 0.2351 -0.06 0.2410 -0.06
gamma_ingreso_bajo_confidence 0.4319 0.3605 1.20 0.3662 1.18
gamma_ingreso_medio_confidence 0.0609 0.3385 0.18 0.3445 0.18
gamma_afectado_confidence -0.1943 0.1655 -1.17 0.1813 -1.07
gamma_religioso_confidence 0.0073 0.1629 0.05 0.2131 0.03
zeta_IP5_confidence 0.3304 0.1188 2.78 0.1714 1.93
zeta_IP6_confidence 0.1536 0.1147 1.34 0.1419 1.08
zeta_IP7_confidence 0.5876 0.1348 4.36 0.2047 2.87
zeta_contacto_mano_confidence -0.4517 0.1495 -3.02 0.1840 -2.45
tau_1_IP5_confidence -2.9030 0.3037 -9.56 0.3318 -8.75
tau_2_IP5_confidence -0.4255 0.2104 -2.02 0.2793 -1.52
tau_3_IP5_confidence 0.9526 0.2249 4.24 0.3119 3.05
tau_4_IP5_confidence 2.3686 0.2661 8.90 0.3538 6.69
tau_1_IP6_confidence -2.3552 0.2198 -10.71 0.2217 -10.63
tau_2_IP6_confidence -0.3479 0.1540 -2.26 0.1747 -1.99
tau_3_IP6_confidence 2.0826 0.2028 10.27 0.2079 10.02
tau_4_IP6_confidence 4.4290 0.4697 9.43 0.4634 9.56
tau_1_IP7_confidence -0.8723 0.3074 -2.84 0.4000 -2.18
tau_2_IP7_confidence 0.8302 0.3293 2.52 0.4652 1.78
tau_3_IP7_confidence 2.0589 0.3607 5.71 0.5221 3.94
tau_4_IP7_confidence 3.3844 0.4097 8.26 0.5950 5.69

tau_1_contacto_mano_confidence -1.2391 0.2855 -4.34 0.3517 -3.52
lambda_agua 1.2914 0.1078 11.98 0.1055 12.24
lambda_comida 2.1455 0.1631 13.15 0.1443 14.87

These are the results with 3 LV:

LL(start) : -6799.394
LL(0, whole model) : Not applicable
LL(final, whole model) : -6500.285
Rho-square (0) : Not applicable
Adj.Rho-square (0) : Not applicable
AIC : 13166.57
BIC : 13643.4
LL(0,indic_IP8_sa) : Not applicable
LL(final,indic_IP8_sa) : -500.5531
LL(0,indic_IP9_sa) : Not applicable
LL(final,indic_IP9_sa) : -277.1729
LL(0,indic_I5_sa) : Not applicable
LL(final,indic_I5_sa) : -199.5119
LL(0,indic_I4_sa) : Not applicable
LL(final,indic_I4_sa) : -210.8656
LL(0,indic_I6_sa) : Not applicable
LL(final,indic_I6_sa) : -228.9902
LL(0,indic_IP5_con) : Not applicable
LL(final,indic_IP5_con) : -526.1585
LL(0,indic_IP7_con) : Not applicable
LL(final,indic_IP7_con) : -529.863
LL(0,indic_IP6_con) : Not applicable
LL(final,indic_IP6_con) : -449.7283
LL(0,indic_I5_con) : Not applicable
LL(final,indic_I5_con) : -225.4304
LL(0,indic_IP4_risk) : Not applicable
LL(final,indic_IP4_risk) : -442.3242
LL(0,indic_IP3_risk) : Not applicable
LL(final,indic_IP3_risk) : -454.4973
LL(0,indic_IP1_risk) : Not applicable
LL(final,indic_IP1_risk) : -503.2416
LL(0,choice) : -3202.34
LL(final,choice) : -2073.001
Estimated parameters : 83
Time taken (hh:mm:ss) : 07:09:15.85
Iterations : 174
Min abs eigenvalue of hessian : 2.6e-05

Estimates:
Estimate Std.err. t.ratio(0) Rob.std.err. Rob.t.ratio(0)
asc_compra_agua -0.5826 0.5735 -1.02 0.5783 -1.01
asc_compra_comida -1.0212 0.5475 -1.87 0.5520 -1.85
asc_compra_agua_comida 0.5392 0.5595 0.96 0.5642 0.96
asc_espera 0.0000 NA NA NA NA
b_costo -0.0232 0.0111 -2.10 0.0111 -2.09
b_ingreso_dis 0.0402 0.0120 3.35 0.0122 3.31
b_tiempo_agua -0.0996 0.0333 -2.99 0.0302 -3.30
b_tiempo_comida -0.0054 0.0032 -1.70 0.0028 -1.91
b_safety_culture 0.3005 0.0987 3.04 0.1295 2.32
b_confidence -0.2170 0.0997 -2.18 0.1093 -1.99
b_risk 1.3340 0.1314 10.15 0.1510 8.83
gamma_edad_safety -0.5637 0.2000 -2.82 0.1982 -2.84
gamma_jov_h_safety -0.2346 0.1499 -1.56 0.1530 -1.53
gamma_viej_h_safety -0.5130 0.2049 -2.50 0.2225 -2.31
gamma_indepen_safety -0.7547 0.2064 -3.66 0.2296 -3.29
gamma_ama_casa_safety -0.6072 0.2710 -2.24 0.2516 -2.41
gamma_educ_basica_safety -0.4685 0.1944 -2.41 0.1992 -2.35
gamma_ingreso_bajo_safety -1.1966 0.3316 -3.61 0.3164 -3.78
gamma_ingreso_medio_safety -0.6694 0.3372 -1.98 0.3052 -2.19
gamma_afectado_safety 0.4689 0.1617 2.90 0.1710 2.74
gamma_religioso_safety 0.5132 0.1542 3.33 0.1584 3.24
zeta_entrenamiento_safety 2.1112 0.4336 4.87 0.4755 4.44
zeta_reserva_dinero_safety 0.2785 0.1081 2.58 0.1237 2.25
zeta_IP8_safety 0.9626 0.1396 6.89 0.1473 6.54
zeta_IP9_safety 0.5114 0.1167 4.38 0.1231 4.16
zeta_contacto_mano_safety 1.6161 0.2972 5.44 0.3547 4.56
tau_1_contacto_mano_safety -3.3659 0.6840 -4.92 0.6518 -5.16
tau_1_entrenamiento_safety -3.2927 0.8647 -3.81 0.8965 -3.67
tau_1_reserva_dinero_safety 0.4341 0.1817 2.39 0.1936 2.24
tau_1_IP8_safety -4.1095 0.4307 -9.54 0.4297 -9.56
tau_2_IP8_safety -1.8386 0.3517 -5.23 0.3403 -5.40
tau_3_IP8_safety 0.2234 0.3184 0.70 0.3048 0.73
tau_4_IP8_safety 2.3411 0.3688 6.35 0.3399 6.89
tau_1_IP9_safety -5.1214 0.5269 -9.72 0.5002 -10.24
tau_2_IP9_safety -3.7233 0.3544 -10.51 0.3540 -10.52
tau_3_IP9_safety -1.5331 0.2608 -5.88 0.2579 -5.95
gamma_ninos_h_confidence -0.2748 0.0035 -78.84 0.0016 -176.55
gamma_estu_confidence 0.8068 0.0078 103.54 0.0041 195.64
gamma_empl_confidence 0.7283 0.0088 82.50 0.0040 182.36
gamma_indepen_confidence 0.9272 0.0123 75.28 0.0111 83.19
gamma_ama_casa_confidence 0.8044 0.0183 43.87 0.0121 66.38
gamma_ingreso_bajo_confidence 0.1107 0.0016 68.32 0.0005 236.96
gamma_afectado_confidence -0.3834 0.0029 -130.17 0.0006 -624.30
zeta_IP5_confidence 0.9232 0.1135 8.14 0.1245 7.42
zeta_IP6_confidence 0.3172 0.1011 3.14 0.1082 2.93
zeta_IP7_confidence 9969.8202 21.7215 458.98 12.2103 816.51
zeta_contacto_mano_confidence -0.2382 0.1147 -2.08 0.1212 -1.97
tau_1_IP5_confidence -3.1057 0.2658 -11.69 0.2602 -11.94
tau_2_IP5_confidence -0.3753 0.1233 -3.04 0.1243 -3.02
tau_3_IP5_confidence 1.1846 0.1380 8.59 0.1479 8.01
tau_4_IP5_confidence 2.7789 0.2037 13.64 0.2073 13.41
tau_1_IP6_confidence -2.3773 0.1952 -12.18 0.1949 -12.20
tau_2_IP6_confidence -0.3428 0.1137 -3.02 0.1128 -3.04
tau_3_IP6_confidence 2.1199 0.1691 12.53 0.1639 12.93
tau_4_IP6_confidence 4.4745 0.4554 9.83 0.4458 10.04
tau_1_IP7_confidence -3478.0071 58.5305 -59.42 39.5472 -87.95
tau_2_IP7_confidence 6446.8651 51.1212 126.11 29.2804 220.18
tau_3_IP7_confidence 13247.4024 98.9236 133.92 76.6697 172.79
tau_4_IP7_confidence 20286.2271 189.7009 106.94 67.7460 299.45

tau_1_contacto_mano_confidence -0.9363 0.1290 -7.26 0.1316 -7.12
gamma_ninos_h_risk 0.7842 0.1432 5.48 0.1445 5.43
gamma_viej_h_risk 0.3331 0.1859 1.79 0.1923 1.73
gamma_estu_risk -0.6043 0.2601 -2.32 0.2483 -2.43
gamma_empl_risk -0.3079 0.2711 -1.14 0.2691 -1.14
gamma_indepen_risk -0.4057 0.2631 -1.54 0.2593 -1.56
gamma_ama_casa_risk -0.2316 0.3134 -0.74 0.3129 -0.74
gamma_ingreso_bajo_risk -0.2481 0.1793 -1.38 0.1802 -1.38
zeta_IP4_risk 1.3264 0.2043 6.49 0.2404 5.52
zeta_IP3_risk -0.5729 0.1318 -4.35 0.1571 -3.65
zeta_IP1_risk 0.6501 0.1233 5.27 0.1398 4.65
tau_1_IP4_risk -7.0984 1.1001 -6.45 1.0420 -6.81
tau_2_IP4_risk -3.6345 0.4602 -7.90 0.4747 -7.66
tau_3_IP4_risk -1.4563 0.3841 -3.79 0.3826 -3.81
tau_4_IP4_risk 1.3747 0.3943 3.49 0.4051 3.39
tau_1_IP3_risk -1.9814 0.2257 -8.78 0.2211 -8.96
tau_2_IP3_risk 0.1752 0.1870 0.94 0.1779 0.99
tau_3_IP3_risk 2.4960 0.2454 10.17 0.2386 10.46
tau_4_IP3_risk 5.4730 0.7304 7.49 0.7368 7.43
tau_1_IP1_risk -3.6341 0.3488 -10.42 0.3795 -9.58
tau_2_IP1_risk -1.8311 0.2377 -7.70 0.2530 -7.24
tau_3_IP1_risk -0.3350 0.2079 -1.61 0.2114 -1.58
tau_4_IP1_risk 1.9219 0.2326 8.26 0.2406 7.99
lambda_agua 1.2490 0.1064 11.73 0.1068 11.69
lambda_comida 2.1411 0.1749 12.24 0.1636 13.09

My code for the full model with 3 LV=

rm(list = ls())
#ubicar directorio de trabajo
setwd("~/Apollo/ICVL basico ecuador 2310")
#cargar apollo
library(apollo)
#inicializar apollo
apollo_initialise()
#definir apolo control
apollo_control = list(
modelName ="ICVL basico ecuador todas LV con todos umbrales generico",
modelDescr ="ICVL model basic todas LV con todos umbrales generico",
indivID ="Id",
mixing = TRUE,
nCores = 8
)
#cargar base de datos y crear variables del modelo
database = read.csv("bd_ecuador.csv",header=TRUE)
database = subset(database,database$av3==1)#subcojunto de la bd
apollo_beta=c(asc_compra_agua = -0.5830,
asc_compra_comida = -0.9990,
asc_compra_agua_comida = 0.5179,
asc_espera = 0,
b_costo = -0.0340,
b_ingreso_dis = 0.0246,
b_tiempo_agua = -0.0731,
b_tiempo_comida = -0.0042,
b_safety_culture = 0.2585,
b_confidence = -1.3896,
b_risk = 1.3844,
gamma_edad_safety = -0.5387,
gamma_jov_h_safety = -0.1827,
gamma_viej_h_safety = -0.4585,
gamma_indepen_safety = -0.6228,
gamma_ama_casa_safety = -0.4408,
gamma_educ_basica_safety = -0.2375,
gamma_ingreso_bajo_safety = -1.4393,
gamma_ingreso_medio_safety = -0.8504,
gamma_afectado_safety = 0.5130,
gamma_religioso_safety = 0.5270,
zeta_entrenamiento_safety =2.1238,
zeta_reserva_dinero_safety =0.2049,
zeta_IP8_safety = 0.8700,
zeta_IP9_safety = 0.5442,
zeta_contacto_mano_safety = 1.6768,
tau_1_contacto_mano_safety = -3.2860,
tau_1_entrenamiento_safety = -3.0748,
tau_1_reserva_dinero_safety = 0.5349,
tau_1_IP8_safety = -3.8073,
tau_2_IP8_safety = -1.5964,
tau_3_IP8_safety = 0.3873,
tau_4_IP8_safety =2.4456,
tau_1_IP9_safety = -5.1389,
tau_2_IP9_safety = -3.7322,
tau_3_IP9_safety = -1.5224,
gamma_ninos_h_confidence = -0.6871,
gamma_estu_confidence = 1.0575,
gamma_empl_confidence = 0.7830,
gamma_indepen_confidence = 1.3574,
gamma_ama_casa_confidence = 0.9969,
gamma_ingreso_bajo_confidence = 0.4309,
gamma_afectado_confidence = -0.2002,
zeta_IP5_confidence = 0.3320,
zeta_IP6_confidence = 0.1462,
zeta_IP7_confidence = 0.5866,
zeta_contacto_mano_confidence = -0.4517,
tau_1_IP5_confidence = -2.9037,
tau_2_IP5_confidence = -0.4258,
tau_3_IP5_confidence = 0.9528,
tau_4_IP5_confidence = 2.3693,
tau_1_IP6_confidence = -2.3603,
tau_2_IP6_confidence = -0.3536,
tau_3_IP6_confidence = 2.0755,
tau_4_IP6_confidence = 4.4214,
tau_1_IP7_confidence = -0.8750,
tau_2_IP7_confidence = 0.8273,
tau_3_IP7_confidence = 2.0558,
tau_4_IP7_confidence = 3.3811,
tau_1_contacto_mano_confidence = -1.2444,
gamma_ninos_h_risk = 0.7628,
gamma_viej_h_risk = 0.2499,
gamma_estu_risk = -0.5588,
gamma_empl_risk = -0.3770,
gamma_indepen_risk = -0.6481,
gamma_ama_casa_risk = -0.5206,
gamma_ingreso_bajo_risk = -0.5555,
zeta_IP4_risk = 1.1818,
zeta_IP3_risk = -0.4624,
zeta_IP1_risk = 0.6653,
tau_1_IP4_risk = -7.2946,
tau_2_IP4_risk = -3.8445,
tau_3_IP4_risk = -1.7767,
tau_4_IP4_risk = 0.9145,
tau_1_IP3_risk = -1.7913,
tau_2_IP3_risk = 0.3177,
tau_3_IP3_risk = 2.5858,
tau_4_IP3_risk = 5.5469,
tau_1_IP1_risk = -3.8656,
tau_2_IP1_risk = -2.0561,
tau_3_IP1_risk = -0.5578,
tau_4_IP1_risk = 1.7122,
lambda_agua = 1.2951,
lambda_comida = 2.2003)
#definir parametros fijos para garantizar identificabilidad
apollo_fixed = c("asc_espera")
# DEFINE RANDOM COMPONENTS
### Set parameters for generating draws
apollo_draws = list(
interDrawsType="halton",
interNDraws=500,
interUnifDraws=c(),
interNormDraws=c("eta_safety","eta_confidence","eta_risk"),

intraDrawsType='',
intraNDraws=0,
intraUnifDraws=c(),
intraNormDraws=c()
)
### Create random parameters
apollo_randCoeff=function(apollo_beta, apollo_inputs){
randcoeff = list()
randcoeff[["safety_culture"]] = gamma_edad_safety*edad + gamma_jov_h_safety*jov_h + gamma_viej_h_safety*viej_h + gamma_indepen_safety*indepen + gamma_ama_casa_safety*ama_casa + gamma_educ_basica_safety*educ_basica + gamma_ingreso_medio_safety*ingreso_medio + gamma_ingreso_bajo_safety*ingreso_bajo + gamma_afectado_safety*afectado + gamma_religioso_safety*religioso + eta_safety
randcoeff[["confidence"]] = gamma_ninos_h_confidence*ninos_h + gamma_estu_confidence*estu + gamma_empl_confidence*empl + gamma_indepen_confidence*indepen + gamma_ama_casa_confidence*ama_casa + gamma_ingreso_bajo_confidence*ingreso_bajo + gamma_afectado_confidence*afectado + eta_confidence
randcoeff[["risk"]] = gamma_ninos_h_risk*ninos_h + gamma_viej_h_risk*viej_h + gamma_estu_risk*estu + gamma_empl_risk*empl + gamma_indepen_risk*indepen + gamma_ama_casa_risk*ama_casa + gamma_ingreso_bajo_risk*ingreso_bajo + eta_risk
return(randcoeff)
}

#validar inputs
apollo_inputs = apollo_validateInputs()
#definir apollo probabilities function
apollo_probabilities=function(apollo_beta, apollo_inputs, functionality="estimate"){
apollo_attach(apollo_beta, apollo_inputs)
on.exit(apollo_detach(apollo_beta, apollo_inputs))
P = list()
### Likelihood of indicators
#####safety
ol_settings8 = list(outcomeOrdered=I_P_8,
V=zeta_IP8_safety*safety_culture,
tau=c(tau_1_IP8_safety, tau_2_IP8_safety, tau_3_IP8_safety, tau_4_IP8_safety),
rows=(task==1))
ol_settings9 = list(outcomeOrdered=I_P_9,
V=zeta_IP9_safety*safety_culture,
tau=c(tau_1_IP9_safety, tau_2_IP9_safety, tau_3_IP9_safety),
rows=(task==1), coding = c(2,3,4,5))
ol_settings5 = list(outcomeOrdered=contacto_mano,
V=zeta_contacto_mano_safety*safety_culture,
tau=c(tau_1_contacto_mano_safety),
rows=(task==1), coding = c(0,1))
ol_settings4 = list(outcomeOrdered=entrenamiento,
V=zeta_entrenamiento_safety*safety_culture,
tau=c(tau_1_entrenamiento_safety),
rows=(task==1), coding = c(0,1))
ol_settings6 = list(outcomeOrdered=reserva_dinero,
V=zeta_reserva_dinero_safety*safety_culture,
tau=c(tau_1_reserva_dinero_safety),
rows=(task==1), coding = c(0,1))
####confidence
ol_settingsIP5 = list(outcomeOrdered=I_P_5,
V=zeta_IP5_confidence*confidence,
tau=c(tau_1_IP5_confidence, tau_2_IP5_confidence, tau_3_IP5_confidence, tau_4_IP5_confidence),
rows=(task==1))
ol_settingsIP6 = list(outcomeOrdered=I_P_6,
V=zeta_IP6_confidence*confidence,
tau=c(tau_1_IP6_confidence, tau_2_IP6_confidence, tau_3_IP6_confidence, tau_4_IP6_confidence),
rows=(task==1))
ol_settings7 = list(outcomeOrdered=I_P_7,
V=zeta_IP7_confidence*confidence,
tau=c(tau_1_IP7_confidence, tau_2_IP7_confidence, tau_3_IP7_confidence, tau_4_IP7_confidence),
rows=(task==1))
ol_settingsI_5 = list(outcomeOrdered=contacto_mano,
V=zeta_contacto_mano_confidence*confidence,
tau=c(tau_1_contacto_mano_confidence),
rows=(task==1), coding = c(0,1))
####risk
ol_settingsIP4 = list(outcomeOrdered=I_P_4,
V=zeta_IP4_risk*risk,
tau=c(tau_1_IP4_risk, tau_2_IP4_risk, tau_3_IP4_risk, tau_4_IP4_risk),
rows=(task==1))
ol_settings1 = list(outcomeOrdered=I_P_1,
V=zeta_IP1_risk*risk,
tau=c(tau_1_IP1_risk, tau_2_IP1_risk, tau_3_IP1_risk, tau_4_IP1_risk),
rows=(task==1))
ol_settings3 = list(outcomeOrdered=I_P_3,
V=zeta_IP3_risk*risk,
tau=c(tau_1_IP3_risk, tau_2_IP3_risk, tau_3_IP3_risk, tau_4_IP3_risk),
rows=(task==1))
#safety
P[["indic_IP8_sa"]] = apollo_ol(ol_settings8, functionality)
P[["indic_IP9_sa"]] = apollo_ol(ol_settings9, functionality)
P[["indic_I5_sa"]] = apollo_ol(ol_settings5, functionality)
P[["indic_I4_sa"]] = apollo_ol(ol_settings4, functionality)
P[["indic_I6_sa"]] = apollo_ol(ol_settings6, functionality)
####confidence
P[["indic_IP5_con"]] = apollo_ol(ol_settingsIP5, functionality)
P[["indic_IP7_con"]] = apollo_ol(ol_settings7, functionality)
P[["indic_IP6_con"]] = apollo_ol(ol_settingsIP6, functionality)
P[["indic_I5_con"]] = apollo_ol(ol_settingsI_5, functionality)
#riks
P[["indic_IP4_risk"]] = apollo_ol(ol_settingsIP4, functionality)
P[["indic_IP3_risk"]] = apollo_ol(ol_settings3, functionality)
P[["indic_IP1_"]] = apollo_ol(ol_settings1, functionality)
#aqui vienen las variaciones sistematicas pero como no hay seguimos
#ahora defino la función de utilidad sistemática de cada alternativa
V = list()
V[['compra_agua']] = asc_compra_agua + b_costo * costo_agua + b_ingreso_dis * i_dispon_agua + b_safety_culture * safety_culture + b_confidence * confidence + b_risk * risk + b_tiempo_agua * ((( Carencia ^ lambda_agua) - 1) / lambda_agua) + b_tiempo_comida * ((( Carencia_Tot ^ lambda_comida) - 1) / lambda_comida)
V[['compra_comida']] = asc_compra_comida + b_costo * costo_comida + b_ingreso_dis * i_dispon_comida + b_safety_culture * safety_culture + b_confidence * confidence + b_risk * risk + b_tiempo_agua * ((( Carencia_Tot ^ lambda_agua) - 1) / lambda_agua) + b_tiempo_comida * ((( Carencia ^ lambda_comida) - 1) / lambda_comida)
V[['compra_agua_comida']] = asc_compra_agua_comida + b_costo * costo_agua_comida + b_ingreso_dis * i_dispon_agua_comida + b_safety_culture * safety_culture + b_confidence * confidence + b_risk * risk + b_tiempo_agua * ((( Carencia ^ lambda_agua) - 1) / lambda_agua) + b_tiempo_comida * ((( Carencia ^ lambda_comida) - 1) / lambda_comida)
V[['espera']] = asc_espera + b_tiempo_agua * ((( Carencia_Tot ^ lambda_agua) - 1) / lambda_agua) + b_tiempo_comida * ((( Carencia_Tot ^ lambda_comida) - 1) / lambda_comida)
#configurar el mnl ojo con nombres de las alt q coincidan con V, avail y choice coincida con la bd
mnl_settings = list(
alternatives = c(compra_agua=1, compra_comida=2, compra_agua_comida=3, espera=4),
avail = list(compra_agua=1, compra_comida=1, compra_agua_comida=av3, espera=1),
choiceVar = choice,
V = V
)
### 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)
}
apollo_llCalc(apollo_beta, apollo_probabilities, apollo_inputs)
model = apollo_estimate(apollo_beta, apollo_fixed, apollo_probabilities, apollo_inputs)
apollo_modelOutput(model)
apollo_saveOutput(model)
stephanehess
Site Admin
Posts: 998
Joined: 24 Apr 2020, 16:29

Re: ICVL Model Identification issues

Post by stephanehess »

Hi

it's of course difficult to diagnose the problem without access to the data, but this looks at first hand like an identification issue. The zeta parameter becomes very large for one indicator while the taus become very wide too. I noticed that you used a different specification for the structural model for the confidence LV than in the model with just one LV - did you try the same specification also in the model with just one LV?

In relation to the Not applicable part, as explained in the manual, LL0 is not reported for model components that are not multi-alternative discrete choice. For OL, a model with all parameters at zero would clearly fail

Best wishes

Stephane
--------------------------------
Stephane Hess
www.stephanehess.me.uk
idserrano
Posts: 7
Joined: 13 May 2020, 21:32

Re: ICVL Model Identification issues

Post by idserrano »

Thanks for your answer prof. Hess.

I would like to ask you another question: Can I use different ordinal indicator with different Likert scale in the measurement model? I mean, I want to explain de LV "confidence" with "ol_settingsIP6" which is a variable with a Likert scale 1 to 5; and "ol_settingsI_2" which is a binary variable 0-1. I am using this code to do that:

ol_settingsIP6 = list(outcomeOrdered=I_P_6,
V=zeta_IP6_confidence*confidence,
tau=c(tau_1_IP6_confidence, tau_2_IP6_confidence, tau_3_IP6_confidence, tau_4_IP6_confidence),
rows=(task==1))
ol_settingsI_2 = list(outcomeOrdered=ayuda_agencias,
V=zeta_I2_confidence*confidence,
tau=c(tau_1_ayuda_agencias_confidence),
rows=(task==1), coding = c(0,1))

Is that correct and possible to estimate this specification in Apollo?

Best regards. IS
stephanehess
Site Admin
Posts: 998
Joined: 24 Apr 2020, 16:29

Re: ICVL Model Identification issues

Post by stephanehess »

Sure,

but for the binary one, it would be easier for you to use apollo_mnl than apollo_ol

Best wishes

Stephane
--------------------------------
Stephane Hess
www.stephanehess.me.uk
Post Reply