Thanks for the explanation, @lucianopaz.
I’m not sure how this relates to @junpenglao’s answer, though.
As I understood his answer, the only point at which we have to worry about getting un-transformed values is at the bottom of the theano graph.
But if I understand you correctly, that is not true – when sampling from the prior predictive, we could end up with random samples of untransformed RVs where we expect transformed ones, and those untransformed values could be used to compute values of children. If that is the case, then any use of a transformed RV, anywhere in a PyMC3 model, can cause prior predictive sampling to fail.
For posterior predictive, things will be correct if the transformed values are captured in the trace generated by pm.sample() But sometimes this cannot be done for out of sample predictions, if variables’ shapes are functions of data.
If I am summarizing correctly, then any use of predictive sampling in PyMC3 is potentially risky.