Page 1 of 2

Joint model Log-likelihood fails at starting values

Posted: 07 Jul 2023, 10:38
by ChrisDjie
Dear Mr., Ms.,

I have a joint model of kilometers driven by car, train, and other modes.
Due to the logarithmic distributions of kilometers traveled, the km/mode is modeled as the fraction of exp(km_total) driven per mode.
Mathematically, this should work, but when estimating the model, I get the following error: Log-likelihood calculation fails at values close to the starting values!

Did I make a mistake?
If not: is there a way to avoid this issue in Apollo?

Many thanks,
Chris

PS. I am trying to built a more complicated latent class model. I first tried building this model in biogeme, but it was too sensitive to the starting values. I hope to have better luck in Apollo.

Re: Joint model Log-likelihood fails at starting values

Posted: 07 Jul 2023, 11:22
by stephanehess
Hi

I'm not sure I follow your model specification

Can you write it down mathematically?

Stephane

Re: Joint model Log-likelihood fails at starting values

Posted: 07 Jul 2023, 11:50
by ChrisDjie
Dear Stephane,

Thank you for your very quick reply.
Does this help?

...

Whereby ld is a parameter representing the log of kilometers traveled, U is the utility of each mode m, F is the fraction of kilometers traveled per mode m, and dm is the number of kilometers traveled with mode m (the target variable).

Best regards,

Chris

Re: Joint model Log-likelihood fails at starting values

Posted: 07 Jul 2023, 12:33
by stephanehess
Okay, this is what I thought you were doing. Is this based on actual theory, as you seem to have some circular dependencies here.

Did you consider instead using a discrete continuous model?

Re: Joint model Log-likelihood fails at starting values

Posted: 07 Jul 2023, 13:42
by ChrisDjie
Dear Stephane,

We are fairly certain there are no circular dependencies in the model.
The estimation issue seems to be purely numerical/computational.

We did get a simplified 2class version of this model (km/mode for car-owning and carless households) working in biogeme.
The results were sensible.

Best, Chris

Re: Joint model Log-likelihood fails at starting values

Posted: 07 Jul 2023, 13:43
by ChrisDjie
*Apologies: an extended 2class version of this model.Yet, our intended 3class model did not work due to computational issues.

Re: Joint model Log-likelihood fails at starting values

Posted: 07 Jul 2023, 14:55
by stephanehess
For now, there isn't really a convergence issue, but a purely numerical issue. If you can share your code and data with me outside the forum, then I'll have a look at that for you

Re: Joint model Log-likelihood fails at starting values

Posted: 07 Jul 2023, 15:00
by ChrisDjie
Dear Stephane,

Thank you.
I cannot share my data though: it is (very) privacy sensitive because it is based on residential addresses and license plates.

Best regards,

Chris

Re: Joint model Log-likelihood fails at starting values

Posted: 07 Jul 2023, 16:56
by stephanehess
I understand. That makes it difficult of course for me to help debug your model. Essentially, I believe your starting values are leading to an initial failure, but it could be due to the coding of the model.

You could try and see what you get out by simply calculating the log-likelihood.

After defining your model, try

Code: Select all

tmp=apollo_probabilities(apollo_beta,apollo_inputs,functionality="output")

Re: Joint model Log-likelihood fails at starting values

Posted: 16 Jul 2023, 10:05
by ChrisDjie
Dear Stephane,

Thank you for the tip.
Something came up in the meantime, but I'll make sure to follow up after the holidays.

Best regards,

Chris