Nesting Model Convergence

42 views
Skip to first unread message

Alene Lucille Holmgren

unread,
May 5, 2024, 4:55:01 AMMay 5
to Biogeme
Dear Professor Bierlaire, 

I am attempting to estimate a few nested logit iterations on a basic MNL reference model. I'm running into a few issues: 
1. The basic MNL reference model is no longer converging, despite having converged with the exact same specifications on a previous run. 
2. The nested models have never converged - two out of the three will finish at roughly the same values (to about 3 decimal places) at every attempt, but the other one will not. 

I've attempted increasing the maximum number of iterations, attempting different estimation methods, etc. but so far everything has come up short. Do you have any advice on how best to deal with these issues? This is an example specification: 
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 

Michel Bierlaire

unread,
May 5, 2024, 4:59:07 AMMay 5
to alliehol...@u.northwestern.edu, Michel Bierlaire, Biogeme
The nest parameter must be larger than one, and you constrain it to be between 0 and 1. It should be

MU2 = Beta('MU2', 1, 1, None, 0)

For the logit, it may be due to messed up starting point. Erase all files with extension .iter in the directory, and try again.

If it still does not work, it means that you have modified something to the model without paying attention.
> --
> You received this message because you are subscribed to the Google Groups "Biogeme" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to biogeme+u...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/biogeme/8f41bdc6-29bc-4317-9a6d-3dd166a01e10n%40googlegroups.com.

Michel Bierlaire
Transport and Mobility Laboratory
School of Architecture, Civil and Environmental Engineering
EPFL - Ecole Polytechnique Fédérale de Lausanne
http://transp-or.epfl.ch
http://people.epfl.ch/michel.bierlaire

Michel Bierlaire

unread,
May 6, 2024, 2:17:47 AMMay 6
to Alene Lucille Holmgren, Michel Bierlaire, Biogeme
Well, the data decide. If the nested logit is rejected, try another nest structure. Or be happy with the logit.

> On 6 May 2024, at 05:50, Alene Lucille Holmgren <alliehol...@u.northwestern.edu> wrote:
>
> Dear Professor Bierlaire,
>
> Thank you very much for your advice. When taking out a certain variable from my MNL, it will begin to converge again, however, now I run into the issue that every mu (for different nests) is being estimated at exactly 1.00000, which does not make much sense in context, as they are nests that should hypothetically share at least some characteristics. Is there any potential fix for this, or reason why it may be occurring?
>
> Best wishes,
> Alene

Michel Bierlaire

unread,
May 7, 2024, 2:45:28 AMMay 7
to Alene Lucille Holmgren, Michel Bierlaire, Biogeme
Great. This new syntax was indeed designed to make the model specification easier.


> On 6 May 2024, at 08:35, Alene Lucille Holmgren <alliehol...@u.northwestern.edu> wrote:
>
> Dear Professor Bierlaire,
>
> Thank you very much for your help. I did that using the OneNestForNestedLogit and NestsForNestedLogit instead of my current format helps fix some of this issue.
>
> Best wishes,
> Alene
Reply all
Reply to author
Forward
0 new messages