choicemodels icon indicating copy to clipboard operation
choicemodels copied to clipboard

Comparison of native estimation code with PyLogit

Open smmaurer opened this issue 6 years ago • 1 comments

PyLogit estimation for MNL is more flexible than the native ChoiceModels implementation (originally brought over from urbansim.urbanchoice.mnl), but much slower. See initial experiments here: Destination-choice-models-02.ipynb

What's causing the performance gap? If it would be easy to fix in PyLogit, then we wouldn't need to maintain a separate estimation codebase.

smmaurer avatar Nov 21 '18 00:11 smmaurer

Let me know what you find as the root cause of the slowness or what you're considering changing!

Also, feel free to open up a pull request! I'm happy to accept any changes that increase estimation speed while not breaking tests. =)

I imagine some of the slowness comes from:

  1. The current version of PyLogit on PyPI using a slow routine for calculating the hessian at the end of the estimation process.
  2. PyLogit not taking advantage of the specific data structures that I think UrbanSim most commonly uses: MNL with generic alternatives.
  3. PyLogit using a single codebase for the estimation of MNL as well as more general asymmetric "logit-type" choice models.

timothyb0912 avatar Jan 08 '19 19:01 timothyb0912