This is an old version, view current version.

10.2 Lower Bounded Scalar

Stan uses a logarithmic transform for lower and upper bounds.

Lower Bound Transform

If a variable X is declared to have lower bound a, it is transformed to an unbounded variable Y, where

Y=log(Xa).

Lower Bound Inverse Transform

The inverse of the lower-bound transform maps an unbounded variable Y to a variable X that is bounded below by a by

X=exp(Y)+a.

Absolute Derivative of the Lower Bound Inverse Transform

The absolute derivative of the inverse transform is

|ddy(exp(y)+a)|=exp(y).

Therefore, given the density pX of X, the density of Y is

pY(y)=pX(exp(y)+a)exp(y).