SEMCOG / semcog_urbansim

7 stars 6 forks source link

Extra variables, ELCM config files, example ELCM simulation notebook #1

Closed janowicz closed 7 years ago

janowicz commented 7 years ago

This pull request includes the new variables introduced as part of ELCM estimation, the ELCM configuration files from the autospec run with variable category constraints, and a notebook (elcm_simulate.ipynb) with an example of simulating and generating probability maps. The notebook utilizes a class and some new functions introduced into utils.py, all related to simulating choice models (an alternative to the utils.lcm_simulate function). These will be included as part of forthcoming model templates. The new code in utils.py has the aim of preserving access to the underlying MNLDiscreteChoiceModel object throughout the simulation, setting the stage for simulation strategy as more pluggable thing (e.g. lottery_choices vs random_choices vs unit_choices vs equilibration_choices etc.), and easier access to intermediate location choice model output such as probabilities.

The new variables in extra_variables.py were pruned/updated based on the data delivery from 3/24/2017. Autospec for ELCM was re-run based on these new variable definitions and the updated data. Variables that no longer exist (e.g. parcels.wlk_library,parcels_wlk_urgentcare) were dropped from the recipe.

Eh2406 commented 7 years ago

Sorry, things got very busy at work today and I did not get to look this over yet. I will give this a proper review tomorrow, god willing.

Eh2406 commented 7 years ago

Overall the code looks good.

We split up and reorganized it variables, givan the new structoure whare is the best place for extra_variables.py to go?

janowicz commented 7 years ago

Thanks for the review! I think we could split up the variables in extra_variables.py by category and then put them in the appropriate module (e.g. employment vars to variables_employment.py). For the variable definitions that automatically disaggregate from the available columns in the node tables, perhaps we could run this at the end of build_networks/neighborhood_vars. Or we could move away from doing variable calculations in a single neighborhood vars step and instead register pandana-based variables that get calculated upon demand. Looking foward to chatting tomorrow

janowicz commented 7 years ago

Re-organized the extra variables into the category-specific variable modules. If you think things look ok now, feel free to merge.

janowicz commented 7 years ago

Ok, got it! Will make changes along these lines.

janowicz commented 7 years ago

@semcogli Did an additional re-shuffling of the extra variables into more category-appropriate modules given your definitions above. Let me know what you think. And please feel free to keep moving things around as you see fit.