Sample_prior_predictive() failing based solely on `samples` parameter

This is a fairly difficult problem. It’s caused because our distributions and random variables only have a single shape parameter which does not distinguish between the event_shape (shape of a single draw of the raw distribution), and sample_shape (the shape that is passed into sample_prior_predictive), so when we feed samples from a random variable as a parameter into another RV we have an ambiguity where we can’t really tell if the array’s shape is due to the event_shape or the sample_shape. Presently, we assume it’s the latter, which in some distributions causes us to use a special broadcasting, broadcast_distribution_samples. We are ill equipped to consistently deal with this problem in pymc3 (pymc4 should work much better because we’ll use TFP). The quick and dirty workaround I can think of is to ask for (1, n) samples, instead of just n. Then you should be able to index into the first element to get the right answer.

1 Like