pymc-devs / pymc-examples

Examples of PyMC models, including a library of Jupyter notebooks.
https://www.pymc.io/projects/examples/en/latest/
MIT License
259 stars 211 forks source link

New discrete choice #618

Open mitch-at-orika opened 7 months ago

mitch-at-orika commented 7 months ago

Testing one alternative utility not zero (just the constant)

Issue #617


:books: Documentation preview :books:: https://pymc-examples--618.org.readthedocs.build/en/618/

review-notebook-app[bot] commented 7 months ago

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

review-notebook-app[bot] commented 6 months ago

View / edit / reply to this conversation on ReviewNB

NathanielF commented on 2023-12-18T18:37:48Z ----------------------------------------------------------------

typo - "When [constants] are included

Also, when introducing this clarifying distinction it might be worth saying how this is occasionally mistaken for the need to 0 out the entire equation for the outside good, but the actual identification requirements are not as strict see reference etc...


review-notebook-app[bot] commented 6 months ago

View / edit / reply to this conversation on ReviewNB

NathanielF commented on 2023-12-18T18:37:49Z ----------------------------------------------------------------

Line #18.            beta_ic * wide_heating_df["ic.hp"] + beta_oc * wide_heating_df["oc.hp"]

If you're changing this line you should remove of clarify the np.zeros line


review-notebook-app[bot] commented 6 months ago

View / edit / reply to this conversation on ReviewNB

NathanielF commented on 2023-12-18T18:37:50Z ----------------------------------------------------------------

Line #20.            0 + beta_ic * wide_heating_df["ic.hp"] + beta_oc * wide_heating_df["oc.hp"]

This is fine. I think but we should keep to this pattern in subsequent models then too.


review-notebook-app[bot] commented 6 months ago

View / edit / reply to this conversation on ReviewNB

NathanielF commented on 2023-12-18T18:37:51Z ----------------------------------------------------------------

Great! Both coefficients are negative. Immediately better and more interpretable out of the gate. More effective sample sizes too.


review-notebook-app[bot] commented 6 months ago

View / edit / reply to this conversation on ReviewNB

NathanielF commented on 2023-12-18T18:37:52Z ----------------------------------------------------------------

Interesting that there appears to be wider uncertainty now. I guess we have more free parameters and they just propagate. I think the right interpretation is to stress a bit more on the freedom to specify individual utility for goods that is unlocked in this approach to the models


review-notebook-app[bot] commented 6 months ago

View / edit / reply to this conversation on ReviewNB

NathanielF commented on 2023-12-18T18:37:52Z ----------------------------------------------------------------

Check that this specification makes sense after re-fit.


review-notebook-app[bot] commented 6 months ago

View / edit / reply to this conversation on ReviewNB

NathanielF commented on 2023-12-18T18:37:53Z ----------------------------------------------------------------

Maybe add a note under these model comparison plots about how the freedom of the utility specification drives our understanding about the various components of market demand, and how the bayesian model development workflow helps uncover and validate the influences on desire


review-notebook-app[bot] commented 6 months ago

View / edit / reply to this conversation on ReviewNB

NathanielF commented on 2023-12-18T18:37:54Z ----------------------------------------------------------------

I think we should change this model too, but there is an argument that it's worth show-casing the common "zero-out" method too. But if you leave it as is you should add a note to explain the different approach.


review-notebook-app[bot] commented 6 months ago

View / edit / reply to this conversation on ReviewNB

NathanielF commented on 2023-12-18T18:37:55Z ----------------------------------------------------------------

Not necessary but it might be nice to overlay the 50% HDI on top of the 95% hdi you see here. It's more Bayesian in spirit and shows the centre of the distributions better.


NathanielF commented 6 months ago

Thanks for the PR @mitch-at-orika! Sorry it took me so long to get back to you - Christmas has been waaay too busy. I've added a few comments above. Mostly about deciding how consistent we want to be in updating the model specification and making sure the rest of the text reflects the new model specification.

NathanielF commented 6 months ago

On the pre-commit checks it looks like you just need to reset the notebook and run all cells from the top.