Dear Professsor Bierlier,
We are constructing a hybrid choice model using Biogeme, but when we try to add latent variables to a Multinomial choice model, the results become poor (the p-value can be so large that it goes to 0.99).By the way, the latent variables have been obtained through SEM.
We research the factors that influence the choice of different travel modes. Here is our code, can you give us some advice?
-------------------------------------------------------------------------------------
#latent variables:DEP\COST\ENV
DEP = (
coef_intercept_DEP
+ coef_MEMBER_DEP * MEMBER
+ coef_EDUCATION_DEP * EDUCATION
+ sigma_s * omega
)
COST = (
coef_intercept_COST
+ coef_INCOME_1_COST * INCOME_1
+ coef_INCOME_2_COST * INCOME_2
+ coef_EDUCATION_DEP * EDUCATION
+ coef_AGE_1_COST * AGE_1
+ coef_AGE_3_COST * AGE_3
+ sigma_s * omega
)
ENV = (
coef_INCOME_1_ENV * INCOME_1
+ coef_AGE_1_ENV * AGE_1
+ sigma_s * omega
)
# utility function :CAR、PT、BIKE
V1 = (
ASC_CAR
+ BETA_FREQ_1_CAR * FREQ_1
+ BETA_FREQ_2_CAR * FREQ_2
+ BETA_DIS_METRO_CAR * DIS_METRO
+ BETA_CAR_NUM_CAR * CAR
+ BETA_BIKE_NUM_CAR * BIKE
#
latent variables
+ BETA_DEP_CAR * DEP
+ BETA_COST_CAR * COST
+ BETA_ENV_CAR * ENV
)
V2 = (
ASC_PT
+ BETA_FREQ_3_PT * FREQ_3
+ BETA_TIME_1_PT * TIME_1
+ BETA_TIME_2_PT * TIME_2
+ BETA_DIS_METRO_PT * DIS_METRO
+ BETA_BIKE_NUM_PT * BIKE
# latent variables
+ BETA_DEP_PT * DEP
+ BETA_COST_PT * COST
+ BETA_ENV_PT * ENV
)
V3 = (
ASC_BIKE
+ BETA_DIS_METRO_BIKE * DIS_METRO
+ BETA_CAR_NUM_BIKE * CAR
+ BETA_BIKE_NUM_BIKE * BIKE
#
latent variables
+ BETA_DEP_BIKE * DEP
+ BETA_COST_BIKE * COST
+ BETA_ENV_BIKE * ENV
)
V = {1: V1, 2: V2, 3: V3}
condprob = models.logit(V, None, MODE)
loglike = log(Integrate(condprob * density, 'omega'))
# estimate
the_biogeme = bio.BIOGEME(database, loglike)
the_biogeme.modelName = 'the_biogeme'
the_biogeme_WORK.saveIterations = False
the_biogeme_WORK.generate_pickle = False
the_biogeme_WORK.generateHtml = False
result_WORK = the_biogeme_WORK.estimate(optimization_algorithm=opt.bioNewton)
BioSummary = result_WORK.shortSummary()
BioStats = result_WORK.getGeneralStatistics()
----------------------------------------------------------------------------------------------------------------------
In the code above, I added all the latent variables and the results were poor and the estimated coefficients were large. Then I tried adding only one latent variable, DEP, and found that the results were even worse. Here's the result.
Many thanks.
Best regards,
Yuneng Jiang