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

Report number of records in estimation #210

Open
hanase opened this issue Apr 17, 2018 · 3 comments
Open

Report number of records in estimation #210

hanase opened this issue Apr 17, 2018 · 3 comments

Comments

@hanase
Copy link
Contributor

hanase commented Apr 17, 2018

It would be very useful if the dcm estimation class reports how many records were used in the estimation. Especially in segmented choice models, when the segments might be smaller than estimation_sample_size, it would be extremely helpful to have that info.

It could go into the report_fit method. I would create a pull request but I don't know where the sample size is stored.

@smmaurer
Copy link
Member

This is something I've wanted as well. I don't think the number of observations is stored currently, but we could modify urbanchoice.mnl_estimate() to retain it:

https://github.com/UDST/urbansim/blob/master/urbansim/urbanchoice/mnl.py#L175-L268

Going farther, it would be nice to have a full summary table, like we get from StatsModels for OLS. I looked into this last year and set up a prototype in the ChoiceModels codebase. Here's the code and here's what it looks like (cell 13 near the bottom).

So a solution is definitely coming when we update UrbanSim to use the ChoiceModels estimation codebase later this year, but it should also be feasible to add reporting of the observation count as a quick fix. Maybe in conjunction with #208?

@smmaurer
Copy link
Member

We now have code in ChoiceModels to generate a full summary table for MNL estimation: UDST/choicemodels#31

We should be able to bring this over to the current version of UrbanSim without too much surgery.

@hanase
Copy link
Contributor Author

hanase commented Jul 10, 2018

Great - thanks Sam!

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

2 participants