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

Support xarray input to sample_posterior_predictive #3846

Merged
merged 4 commits into from
Mar 20, 2020

Conversation

michaelosthege
Copy link
Member

@michaelosthege michaelosthege commented Mar 20, 2020

As described in #3828, making predictions from InferenceData can be very useful.

What this PR does:

  • add tests that pass InferenceData.posterior and InferenceData.prior to pm.sample_posterior_predictive
  • extend sample_posterior_predictive such that it can feed on these xarray.Dataset structures
  • add entry to release notes

@codecov
Copy link

codecov bot commented Mar 20, 2020

Codecov Report

Merging #3846 into master will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3846      +/-   ##
==========================================
+ Coverage   90.74%   90.75%   +0.01%     
==========================================
  Files         135      135              
  Lines       21159    21184      +25     
==========================================
+ Hits        19201    19226      +25     
  Misses       1958     1958              
Impacted Files Coverage Δ
pymc3/distributions/posterior_predictive.py 88.79% <100.00%> (+0.13%) ⬆️
pymc3/sampling.py 85.16% <100.00%> (+0.05%) ⬆️
pymc3/tests/test_sampling.py 99.64% <100.00%> (+0.01%) ⬆️

rpgoldman and others added 2 commits March 20, 2020 19:16
* xarray test for fast posterior predictive sampling.

* Move Dataset translation to util.

The translation from xarray Dataset to a list of points was previously open-coded into sample_posterior_predictive.  Pulled it out so it can be used in both spp and fast_sample_posterior_predictive.

* fast_sample_posterior_predictive support for xarray traces.
@michaelosthege
Copy link
Member Author

@rpgoldman Thanks for expanding this to fast_sample_posterior_predictive!
Should be good to go now.

@rpgoldman rpgoldman merged commit 3036da5 into pymc-devs:master Mar 20, 2020
@michaelosthege michaelosthege deleted the issue-3828 branch May 2, 2020 10:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants