From 8dbbdff673d717463a951ad9897b07ee423dd4bc Mon Sep 17 00:00:00 2001 From: martinmodrak Date: Wed, 12 May 2021 12:47:10 +0200 Subject: [PATCH] Fix #356 - affine transform docs has the wrong direction of transform --- src/reference-manual/transforms.Rmd | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/reference-manual/transforms.Rmd b/src/reference-manual/transforms.Rmd index 7ad1c978d..4e3a5bd45 100644 --- a/src/reference-manual/transforms.Rmd +++ b/src/reference-manual/transforms.Rmd @@ -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 @@ -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 @@ -316,10 +316,10 @@ $$ \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 @@ -327,8 +327,8 @@ 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. $$