Hi Prof. Bierlaire,
I have been working on comparing MNL model with the Choice Set Formation model. When comparing the results they have different null log-likelihoods that make it difficult to compare them. I previously thought the null log-likelihood should be the same if we used the same dataset. So, the problem might be with defining V or AV?
Please feel free to correct me.
I have provide my CSF script here
### Class membership utility
CONSTRAINT_one = (
coef_intercept_1 +\
BCSF_INCOME_LOW_1 * low_income +\
BCSF_INCOME_HIGH_1 * high_income
)
CONSTRAINT_two = (
coef_intercept_2 +\
BCSF_INCOME_LOW_2 * low_income +\
BCSF_INCOME_HIGH_2 * high_income
)
delta_zero = 1 #zero car choice always considered
delta_one = exp(CONSTRAINT_one)/(1+ exp(CONSTRAINT_one)) #one car or more choice is probability
delta_two = exp(CONSTRAINT_two)/(1+ exp(CONSTRAINT_two)) #multiple cars choice is probability
#P({i}) is the probability of considering the choice set composed with i alternative
#derive from Bonucci and Ben-Akiva equation
PROB_CLASS_A = (1-delta_one)*(1-delta_two)
PROB_CLASS_B = delta_one * (1-delta_two)
PROB_CLASS_C = delta_one * delta_two
### The contribution to the log likelihood functions is the logarithm of a CSF model
#### CSF Model (Choice Set Formation) (MANSKI's)
# Associate utility functions with the numbering of alternatives
V_class_A = {1: V10, 2: 0, 3: 0}
V_class_B = {1: V10, 2: V11, 3: 0}
V_class_C = {1: V10, 2: V11, 3: V21}
av_class_A = {1.0: 1, 2 :0, 3: 0 }
av_class_B = {1.0: 1, 2 :1, 3: 0 }
av_class_C = {1.0: 1, 2 :1, 3: 1 }
# #CSF
# # #The choice model is a discrete mixture of logit, with availability conditions
prob_util_class_A = models.logit(V_class_A, av_class_A, multiveh)
prob_util_class_B = models.logit(V_class_B, av_class_B, multiveh)
prob_util_class_C = models.logit(V_class_C, av_class_C, multiveh)
prob = prob_util_class_A*(PROB_CLASS_A) + prob_util_class_B*(PROB_CLASS_B) + prob_util_class_C*(PROB_CLASS_C)
logprob = log(prob)