choicemodels
choicemodels copied to clipboard
Comparison of native estimation code with PyLogit
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.
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:
- The current version of PyLogit on PyPI using a slow routine for calculating the hessian at the end of the estimation process.
- PyLogit not taking advantage of the specific data structures that I think UrbanSim most commonly uses: MNL with generic alternatives.
- PyLogit using a single codebase for the estimation of MNL as well as more general asymmetric "logit-type" choice models.