if (FALSE) {
testing_data <- censoredAIDS::MexicanHH_foodConsumption
# Organizing the data for comfort
s1 <- testing_data$s1
s2 <- testing_data$s2
s3 <- testing_data$s3
s4 <- testing_data$s4
s5 <- testing_data$s5
s6 <- testing_data$s6
lnp1 <- testing_data$lnp1
lnp2 <- testing_data$lnp2
lnp3 <- testing_data$lnp3
lnp4 <- testing_data$lnp4
lnp5 <- testing_data$lnp5
lnp6 <- testing_data$lnp6
age <- testing_data$age
size <- testing_data$size
sex <- testing_data$sex
educ <- testing_data$educ
# Alpha
b0 <- rep(0, 5)
# Beta
b0 <- c(b0, rep(0.003, 5))
# Gamma
b0 <- c(b0,0.01,0,0.01,0,0, 0.01,0,0,0,0.01,0,0,0,0,0.01)
# Demos
b0 <- c(b0,rep(0.002, 20))
# Sigma
b0 <- c(b0,1,0,1,0,0,1,0,0,0,1,0,0,0,0,1)
li1 <- censoredaidsLoglike(
Params = b0,
Shares = matrix(c(s1, s2, s3, s4, s5, s6), ncol = 6),
Prices = matrix(c(lnp1, lnp2, lnp3, lnp4, lnp5, lnp6), ncol = 6),
Budget = matrix(testing_data$lnw),
Demographics = matrix(c(age, size, educ, sex), ncol = 4),
quaids = FALSE
)
}
Run the code above in your browser using DataLab