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

Add interaction_simulate estimation recipe and notebook example for larch #352

Closed
bstabler opened this issue Oct 15, 2020 · 3 comments
Closed
Assignees

Comments

@bstabler
Copy link
Contributor

bstabler commented Oct 15, 2020

The non_mandatory_tour_frequency model is setup a little differently than the others, maybe because it is by person type, and so it uses the interaction_simulate estimation data bundle writer. See https://github.com/ActivitySim/activitysim/blob/develop/activitysim/examples/example_estimation/configs/estimation.yaml#L78

@jpn--
Copy link
Member

jpn-- commented Nov 16, 2020

I propose the estimation data bundle output for this model be reorganized as such:

./non_mandatory_tour_frequency
+-- non_mandatory_tour_frequency_alternatives.csv
+-- non_mandatory_tour_frequency_model_settings.yaml
+-- non_mandatory_tour_frequency_SPEC.csv
+-- PTYPE_ABC
|   +-- non_mandatory_tour_frequency_coeffs_PTYPE_ABC.csv
|   +-- non_mandatory_tour_frequency_choosers_combined.csv
|   +-- non_mandatory_tour_frequency_interaction_expression_values.csv
+-- PTYPE_XYZ
|   +-- non_mandatory_tour_frequency_coeffs_PTYPE_XYZ.csv
|   +-- non_mandatory_tour_frequency_choosers_combined.csv
|   +-- non_mandatory_tour_frequency_interaction_expression_values.csv
+  ... for all PTYPES ...

This doesn't require actually changing the content of any files -- all of these exist at least once in the current EDB output. We just will remap the directory as shown to remove duplication and consolidate all eight models into a single top-level EDB to streamline estimation.

I will manually reconfigure files to this structure for now and move forward with work to finish the estimation code, on the premise that @toliwaga will eventually make the changes to conform the EDB output to this pattern.

@jpn--
Copy link
Member

jpn-- commented Nov 24, 2020

Notebook implementing the non_mandatory_tour_frequency model estimation is in 2252f1e. This notebook implements coefficient "back-mapping" -- this automates the process of converting all coefficients that have exactly identical values into a common estimated coefficient. This refactoring was done manually in other models but was not done here. It greatly improves model estimation stability, although as for certain other segmented models, the size of the test dataset is too small to reliably generate models for smaller segments. The back-mapping can be disabled by commenting out one cell as indicated.

@bstabler
Copy link
Contributor Author

#417

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

3 participants