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(X - a). \]

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

\[ \left| \, \frac{d}{dy} \left( \exp(y) + a \right) \, \right| = \exp(y). \]

Therefore, given the density \(p_X\) of \(X\), the density of \(Y\) is

\[ p_Y(y) = p_X\!\left( \exp(y) + a \right) \cdot \exp(y). \]