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 lound 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).