Why does sample_posterior_predictive use only one chain?

I’m not sure what is going wrong here without an example to run.

What happens in fast_sample_posterior_predictive is that we create a single chain which is a dict of variable names to arrays of shape n, ... where n = cs for c the number of chains and s the length of each chain in the posterior multi-trace (and heaven help you if the chains aren’t all of equal length).

If it is desired to keep size, then for each ary in the dictionary we do

ary.reshape((nchains, ndraws, *ary.shape[1:]))

… which looks like it should do the right thing, assuming that nchains and ndraws are being computed correctly. Again, given an example, I could check this. It would be interesting to know whether there is any difference when you pass an InferenceData or a MultiTrace as the posterior trace to this function.

This is likely a problem of pm.summary() expecting something from the posterior predictive that the latter is not prepared to give. TBH, I didn’t even know that pm.summary() could be used with a posterior predictive – I thought it could only be used on a posterior trace, which has sampling statistics that are not present in the posterior predictive (which is sampled with an entirely different procedure).

@OriolAbril – Should pm.summary() – which is really just az.summary() even work on a posterior predictive distribution? In PyMC3 these are very different things from posterior distributions.

I don’t think we can make more progress without a runnable example. @bridgeland would you see if you can provide one?