MU2 = Beta('MU2', 0.5, 0, 1.0, 0)
V1 = ASC_RAIL + B_IVTT*IVTT + B_Cost*COST + B_Male*MALE + B_Numvehic*NUMVEHIC + B_Employ*EMPLOYST + B_Business*BUSINESS + B_Dist_RAIL*DIST + B_Age0*AGE0
V2 = ASC_BUS + B_IVTT*IVTT + B_Cost*COST + B_Male*MALE + B_Numvehic*NUMVEHIC + B_Employ*EMPLOYST + B_Business*BUSINESS + B_Age0*AGE0
V3 = ASC_AIR + B_IVTT*IVTT + B_Cost*COST + B_Male*MALE + B_Numvehic*NUMVEHIC + B_Employ*EMPLOYST + B_Business*BUSINESS + B_Dist_AIR*DIST + B_Age0*AGE0
V4 = ASC_CAR + B_Dist_CAR*DIST
V = {1: V1, 2: V2, 3: V3, 4: V4}
av = {1: RAIL_AV, 2: BUS_AV, 3: AIR_AV, 4: CAR_AV}
# Nests
road_travel = MU2, [2, 4]
rail = 1.0, [1]
air = 1.0, [3]
nests2 = road_travel, rail, air
logprob = models.lognested(V,av,nests2, CHOICE)
the_biogeme = bio.BIOGEME(database,logprob)
the_biogeme.modelName = 'nested2_TSM'
results = the_biogeme.estimate()
round(results.getEstimatedParameters(),5)
Please note that:
1. The nested models will converge if I just specify the constants only utility functions, and sometimes if I add in the cost or IVTT variable, but they do not converge past that.
2. Using NestsforNestedLogit instead of this structure yields the same issues.
Please let me know how one might approach this, thank you very much for your time and help.
Best wishes,
Alene