'TransformedDistribution' object has no attribute 'random' during pm.sample_ppc

The main inference implemented in PyMC3 (NUTS and ADVI) sample/approxiamate parameters that are on the real line [-inf, inf]. Thus, for bounded parameter (Exponential distribution etc) it will first apply a transformation from its domain to the real line and do sampling/approximation there.

For the random method, it is usually defined not on the transformed space. For the purpose of your example you can do:

...
pm.sample_ppc(trace, vars = [w, mu, tau], 5000, random_seed=SEED)
1 Like