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

Estimation process unstable #10

Closed JGONGSQ closed 7 years ago

JGONGSQ commented 7 years ago

Hi,

When I try run your code with my sample data, parameter coefficients are not stable, not sure why. Can you have a look? Sometimes even the coefficient sign would be changed as well. Such as my "Male" variable, could be both positive and negative coefficients. Can you explain why? Do you have some random "input" in your estimation process?

timothyb0912 commented 7 years ago

Which code are you trying to use? Posting a link to a gist where I can see what you've done would be useful. Alternatively posting the code you've used and a link to your data would be equally helpful.

The only code that has random input in the estimation process is the mixed logit code that uses maximum simulated likelihood for estimation. Even then, you can set the seed in the estimation so that results are constant across repeated estimations.

In general, if you have highly correlated variables and you ever-so-slightly change your specifications, then parameter signs may flip and coefficient magnitudes may not be very stable.