Exactly. pm.Deterministic is used to save “intermediate” calculations into the trace. Sometimes you need to do stuff like this:
with pm.Model() as model:
theta_raw = pm.Normal("theta_raw", 0, 1)
like = pm.Binomial("like", pm.math.exp(theta_raw), n= 10, observed = [2,5,8]
But then you lose the transformed version of theta_raw. You can just apply np.exp() to the samples in the posterior, but maybe it makes more sense to save the transformed values in the trace:
with pm.Model() as model:
theta_raw = pm.Normal("theta_raw", 0, 1)
theta = pm.Deterministic("theta", pm.math.exp(theta_raw))
like = pm.Binomial("like", theta, n= 10, observed = [2,5,8]