pymc icon indicating copy to clipboard operation
pymc copied to clipboard

Explain the behavior of `var_names` in `sample_posterior_predictive`

Open ricardoV94 opened this issue 2 years ago • 5 comments

This is still a draft. I want to add two more examples first about the default ppc and predictions use-cases

TODO

  • [ ] Add example about common use for in-sample posterior_predictive
  • [ ] Add example about common use for predictions
  • [ ] Change conclusion about non-dependence on deterministics or fix behavior
  • [ ] Explain volatility when MutableData changes

Link to function docs preview: https://pymcio--7014.org.readthedocs.build/projects/docs/en/7014/api/generated/pymc.sample_posterior_predictive.html


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

ricardoV94 avatar Nov 17 '23 09:11 ricardoV94

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 92.24%. Comparing base (6c6fd13) to head (08fca4e). Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #7014   +/-   ##
=======================================
  Coverage   92.24%   92.24%           
=======================================
  Files         100      100           
  Lines       16887    16887           
=======================================
  Hits        15577    15577           
  Misses       1310     1310           
Files Coverage Δ
pymc/sampling/forward.py 95.90% <ø> (ø)

codecov[bot] avatar Nov 17 '23 10:11 codecov[bot]

Last suggestion, getting into the weeds of personal preferences -- I think the API docs would look nicer if you added a title (in bold or italics or w/e) to each of the two examples.

I also think the code in the new section would be easier to follow if you split the model definition plus each function call into a separate code block and wrote your commentary as text instead of code comments.

jessegrabowski avatar Nov 17 '23 12:11 jessegrabowski

Last suggestion, getting into the weeds of personal preferences -- I think the API docs would look nicer if you added a title (in bold or italics or w/e) to each of the two examples.

I also think the code in the new section would be easier to follow if you split the model definition plus each function call into a separate code block and wrote your commentary as text instead of code comments.

I agree, even better would be a markdown header, but I don't know if that's supported :D

ricardoV94 avatar Nov 17 '23 12:11 ricardoV94

I think you can use restructuredtext subsubsection headings, like:

Example 1: Exploring the effect of var_names on outputs ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

See here. It's pretty hideous for viewing in an IDE, though.

jessegrabowski avatar Nov 17 '23 12:11 jessegrabowski

That worked @jessegrabowski

ricardoV94 avatar Nov 17 '23 14:11 ricardoV94

Thanks @ricardoV94 , these clarifications are very much welcome!

I want to add two more examples first about the default ppc and predictions use-cases

Seems like default ppc is done and you only need predictions use-case?

AlexAndorra avatar Feb 23 '24 18:02 AlexAndorra

I have addressed several review comments:

  • Do not call new draws posterior predictive draws, but add a note for the first case where it is equivalent
  • Fix the Deterministics example

I also expanded with two new example sections:

  • Posterior predictive checks and predictions: Shows the common use case
  • Using new models: Shows how you can use a new model with new variables

It's ready for review again. It is also likely I messed up the myst formatting so any help appreciated.

ricardoV94 avatar Feb 27 '24 11:02 ricardoV94

@AlexAndorra thanks for the review and suggestions. I've addressed them

ricardoV94 avatar Feb 28 '24 10:02 ricardoV94

Things seem to be working. @AlexAndorra wanna do one last pass?

ricardoV94 avatar Mar 01 '24 13:03 ricardoV94