Skip to content

Refactor MNL estimation #52

@smmaurer

Description

@smmaurer

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions