Large init positive log likelihood and final likelihood

156 views
Skip to first unread message

Chen Zhi

unread,
Mar 26, 2021, 1:33:12 PM3/26/21
to Biogeme
Hi,

I am trying to estimate parameters for a MNL model. 
The model im trying to estimate has more than 100+ parameters to estimate and the data set is also very huge. 

I am not sure if this is really problem, but I found the results a little bit weird. 
Both the init log likelihood and the final likelihood are very large and positive ( around 5000 and 20000 respectively). Shouldn't these be negative?
The initial values of my betas are zero, and I haven't set any bounds om them.
The final results of the parameters usually lie between -100 and 100.
The reason for termination is max amount of iterations reached.

Would really help if to know whether I should be concerned with such a huge loglikhood!

Thanks in advance!

Bierlaire Michel

unread,
Mar 27, 2021, 9:14:30 AM3/27/21
to kime...@gmail.com, Bierlaire Michel, Biogeme
It seems that you have a specification issue. 
The log likelihood must be negative, as the likelihood is a probability. 
The null likelihood (which is the init log likelihood if all betas are zero) is equal to - N ln(J), where J is the number of alternatives, and N the number of observations. This formula assumes that all alternatives are available for everybody. 
If it is not the case, you can calculate it as follows:
        expression = -log(bioMultSum(avail))
        nullLogLike = database.sumFromDatabase(expression)


--
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/bca7d525-6303-48ee-993e-8f3e98e9291bn%40googlegroups.com.

Chen Zhi

unread,
Mar 29, 2021, 2:39:51 AM3/29/21
to Biogeme

Hi, 

First of all thanks for the quick reply!
So because you mentioned that it probably is a specification issue I tried to simplify my code.
In the simple version I let my 7 utilities function each only consist of an ASC, which is a beta to be estimated and I said that all alternatives are available 
(av = {1:1, 2:1, 3:1, 4:1, 5:1, 6:1, 7:1}. 
But then it still returned a positive likelihood.
Do you have any Ideas where this goes wrong?
( to be sure: I used the models.logit model)

Thanks a lot!


Op zaterdag 27 maart 2021 om 14:14:30 UTC+1 schreef michel.b...@epfl.ch:

Bierlaire Michel

unread,
Mar 29, 2021, 2:41:07 AM3/29/21
to kime...@gmail.com, Bierlaire Michel, Biogeme
There must be something wrong with the data. They are probably not read properly. 

Reply all
Reply to author
Forward
0 new messages