timothyb0912 / pylogit

A python package for estimating conditional logit models.
https://pypi.org/project/pylogit/
BSD 3-Clause "New" or "Revised" License
187 stars 104 forks source link

Derive and Implement Analytic Hessian for Mixed Logit #5

Open timothyb0912 opened 7 years ago

timothyb0912 commented 7 years ago

This is on the agenda for the coming months, but pull requests or contributions are always welcome.

At the moment, the sum of the outer products of the gradient are used as an approximation to the actual hessian.

Eh2406 commented 7 years ago

Do we know that the Hessian has a closed form? If so do we know what it is? ("Derive" suggests we may not.) All answers are okay. Just trying to assess how much work this will be.

timothyb0912 commented 7 years ago

Hey, the same deal applies here as for the nested logit.

I think the hessian exists in closed-form. This is based on the fact that the gradient exists in closed form and that nothing indicates that the derivative of the gradient would be undefined or lose its closed-form nature. I haven't checked the math completely, but equation (3) of the the following link may be the hessian for a mixed logit model (or at least closely related to it): MM ALGORITHM FOR GENERAL MIXED MULTINOMIAL LOGIT MODELS

I say derive simply because one might have to derive the formulas oneself, and I typically do so anyway just to make sure I really understand the formulas when trying to code everything up.