-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Sample Posterior Predictive Behavior #3208
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
Comments
That's not quite the case - it randomly samples from all 2000 posterior samples and generates 500 posterior predictive samples. |
You're right, thanks - I read line 1131 from there, instead of 1129. I'll update the issue. |
Cool - also
is probably not needed. I am curious about the context of the purpose change: is it for it to easier to work with using arviz? i guess Stan return the posterior predictive samples the same (chains, draws, ...) shape as the MCMC samples. |
So really the proposal is to sample the number of total samples, which makes sense to me. |
junpenglao - Yes, the impetus for this is in ArviZ, the dimensions allow you to select by chain and draw, so having that consistent would be nice. I could imagine ppc joint scatter plots being interesting (or maybe not interesting at all?) The scatter plots would require that these dimensions be aligned. twiecki - This would also stop shuffling the samples (which seems fine to me) This seems like a positive enough response that I'll make a PR! |
@ColCarroll @junpenglao @twiecki I had some trouble trying to understand how posterior predictive sampling worked until I looked at the source code. If it is ok with you I will submit a PR to expand the docs a little and I was also thinking in logging some warning when I am not really sure about the use of |
@OriolAbril That would be much appreciated. |
This is a proposal to update
sample_posterior_predictive
behavior.Consider:
I propose this should print
(2000,)
.Current behavior is
(500,)
, and the implementation is roughly:Good things:
Bad things:
Ignores all but the first chainfirst chain'sposterior samplestooThis would be a reasonably large breaking change! In a perfect world, I would want the return value to always be
(4, 500)
, but if we make it so.reshape(4, 500)
matches up with the shape of the full trace. My suggestion is:shuffle
argumentsamples
is bigger than 2000 andshuffle
isFalse
, cycle back over the posterior (in order).The text was updated successfully, but these errors were encountered: