-
-
Notifications
You must be signed in to change notification settings - Fork 124
Description
Summary:
It appears that the transformation in the Affinely transformed scalar section is reversed compared to how it is implemented in Stan math.
Description:
In the documentation, we state that Y = mu + sigma * X
where Y is the unconstrained variable as used by Stan and X is what the user sees (at least that's how it is used in the Lower-bounded scalar chapter). However, the implementation (https://github.com/stan-dev/math/blob/92075708b1d1796eb82e3b284cd11e544433518e/stan/math/prim/fun/offset_multiplier_constrain.hpp) and the way it is used suggests that the transformation is inverted, i.e. that Y = (X - mu)/sigma
. Consequently the Jacobian in the docs is 1 / sigma
while in the code it is sigma
.
Additional Information:
Noticed this when inspecting https://discourse.mc-stan.org/t/offset-multiplier-initialization/20712
Current Version:
v2.26.0