Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor MNL estimation #52

Open
smmaurer opened this issue Nov 21, 2018 · 1 comment
Open

Refactor MNL estimation #52

smmaurer opened this issue Nov 21, 2018 · 1 comment

Comments

@smmaurer
Copy link
Member

smmaurer commented Nov 21, 2018

It would be nice to refactor the MNL estimation code, which was originally brought over from urbansim.urbanchoice.mnl. It's been updated in places to provide additional estimation metrics and resolve deprecation warnings, but is mostly unchanged.

The code seems fast and reliable, but it's hard to use, hard to update, and appears to include some partial or extraneous functionality that would be nice to either remove or document and test (e.g. GPU acceleration, estimation weights, latent classes).

Roughly, the pieces are:

1. Probability calculation (mnl_probs)

Already refactored in MultinomialLogitResults.probabilities(), but that version may need to be adapted to accept numpy arrays instead of dataframes for faster iteration in the estimation stage.

2. Likelihood calculation (mnl_loglik)

Hardest part -- can be cleaned up similarly, with dependencies on the PMAT utility removed.

3. Orchestration of maximum likelihood estimation (mnl_estimate)

Pretty straightforward.

4. Calculation of estimation metrics (mnl_estimate)

Pretty straightforward.

5. Simulation (mnl_simulate)

Already refactored; now fully replaced by choicemodels.tools.simulation.

@smmaurer
Copy link
Member Author

May want to look at issue #53 first, in case we can avoid maintaining an estimation codebase entirely.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant