11.16 Rethinking Code

Thank you @junpenglao and @AlexAndorra. Your clarification helps! I’m keying into this bit:

As a check of my understanding of the sample_posterior_predictive method – specifically for this particular case: it’s really being used as a convenient way of grabbing samples from the posterior trace using a replication structure specified by set_data?

Procedurally this seems a little bit different from computing p as a proportion from a predictive distribution of Bernoulli trials. Am I correct thinking that since p is a deterministic function of the parameters a and b, there should be a value of p in trace_11_4 for every value returned by sample_posterior_predictive? i.e there is no _rng computation happening here.

Thanks again!