This is an old version, view current version.

10.5 Affinely transformed scalar

Stan uses an affine transform to be able to specify parameters with a given offset and multiplier.

Affine transform

For variables with expected offset μ and/or (positive) multiplier σ, Stan uses an affine transform. Such a variable X is transformed to a new variable Y, where

Y=Xμσ.

The default value for the offset μ is 0 and for the multiplier σ is 1 in case not both are specified.

Affine inverse transform

The inverse of this transform is

X=μ+σY.

10.5.1 Absolute derivative of the affine inverse transform

The absolute derivative of the affine inverse transform is

|ddy(μ+σy)|=σ.

Therefore, the density of the transformed variable Y is

pY(y)=pX(μ+σy)σ.