When I browse the Stan forum, I often read about the need for adjusting the Jacobian. However, I rarely find this topic on this forum, and I am wondering if we should instead be more careful.
From what I understood, in general, we need need to adjust the Jacobian when we perform a change of variable. From the Stan manual (p. 291):
[there is a] difference between a change of variables and a simple
variable transformation. A transformation samples a parameter, then transforms it,
whereas a change of variables transforms a parameter, then samples it. Only the
latter requires a Jacobian adjustment
I have hard time to understand when we would need to adjust the Jacobian in our PyMC3 code:
- If I read the quote correctly, the use of
Deterministicin PyMC3 to transform a parameter should be a safe operation, right? Are there cases in which this is not true? - Stan allows to declare something like
log(y) ~ normal(mu, sigma), that is we can apply a function to the left hand side of the statement (This seems to be the typical example that need a Jacobian adjustment.) PyMC3, however, does not allow such statement, right? If so, we will not encounter such problem in our code.