Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/reference-manual/transforms.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ Stan uses an affine transform. Such a variable $X$ is transformed to a new
variable $Y$, where

$$
Y = \mu + \sigma * X.
Y = \frac{X - \mu}{\sigma}.
$$

The default value for the offset $\mu$ is $0$ and for the multiplier $\sigma$ is
Expand All @@ -304,7 +304,7 @@ $1$ in case not both are specified.
The inverse of this transform is

$$
X = \frac{Y-\mu}{\sigma}.
X = \mu + \sigma \cdot Y.
$$

### Absolute derivative of the affine inverse transform
Expand All @@ -316,19 +316,19 @@ $$
\left|
\frac{d}{dy}
\left(
\frac{y-\mu}{\sigma}
\mu + \sigma \cdot y
\right)
\right|
= \frac{1}{\sigma}.
= \sigma.
$$

Therefore, the density of the transformed variable $Y$ is

$$
p_Y(y)
=
p_X \! \left( \frac{y-\mu}{\sigma} \right)
\cdot \frac{1}{\sigma}.
p_X \! \left( \mu + \sigma \cdot y \right)
\cdot \sigma.
$$


Expand Down