Helpful Stan Functions
|
Functions | |
real | unit_johnson_lpdf (vector x, real mu, real sigma) |
real | unit_johnson_cdf (real x, real mu, real sigma) |
real | unit_johnson_lcdf (real x, real mu, real sigma) |
real | unit_johnson_lccdf (real x, real mu, real sigma) |
real | unit_johnson_rng (real mu, real sigma) |
The distribution is defined for outcomes bounded between the open (0, 1) interval. It is described in detail at Gündüz, S., & Korkmaz, M. Ç. (2020). A New Unit Distribution Based On The Unbounded Johnson Distribution Rule: The Unit Johnson SU Distribution. Pakistan Journal of Statistics and Operation Research, 16(3), 471-490. https://doi.org/10.18187/pjsor.v16i3.3421.
real unit_johnson_cdf | ( | real | x, |
real | mu, | ||
real | sigma | ||
) |
Unit Johnson SU cumulative density function
The Unit Johnson SU distribution is defined as
\[ F(y \mid \mu,\sigma) = \Phi(\mu + \sigma \sinh^{-1}(\text{logit}(y)) ) \]
where \(\mu\) is the location parameter defined on the \(\mathbb{R}\) and \(\sigma\) is a scale parameter, restricted to the positive reals, \(\mathbb{R}^+\).
x | Vector |
mu | Real |
sigma | Real (0,Inf) scale parameter |
real unit_johnson_lccdf | ( | real | x, |
real | mu, | ||
real | sigma | ||
) |
Unit Johnson SU log complementary cumulative density function
The Unit Johnson SU complementary cumulative distribution is defined as
\[ S(y \mid \mu,\sigma) = 1 - \Phi(\mu + \sigma \sinh^{-1}(\text{logit}(y)) ) \]
where \(\mu\) is the location parameter defined on the \(\mathbb{R}\) and \(\sigma\) is a scale parameter, restricted to the positive reals, \(\mathbb{R}^+\).
x | Vector |
mu | Real |
sigma | Real (0,Inf) scale parameter |
real unit_johnson_lcdf | ( | real | x, |
real | mu, | ||
real | sigma | ||
) |
Unit Johnson SU log cumulative density function
The Unit Johnson SU cumulative is defined as
\[ F(y \mid \mu,\sigma) = \Phi(\mu + \sigma \sinh^{-1}(\text{logit}(y)) ) \]
where \(\mu\) is the location parameter defined on the \(\mathbb{R}\) and \(\sigma\) is a scale parameter, restricted to the positive reals, \(\mathbb{R}^+\).
x | Vector |
mu | Real |
sigma | Real (0,Inf) scale parameter |
real unit_johnson_lpdf | ( | vector | x, |
real | mu, | ||
real | sigma | ||
) |
The Unit Johnson SU distribution is defined as
\[ p(y \mid \mu,\sigma) = \frac{\sigma}{y (1 - y) \sqrt{1 + \text{logit}(y)^2}}\phi(\mu + \sigma \sinh^{-1}(\text{logit}(y)) ) \]
where \(\mu\) is the location parameter defined on the \(\mathbb{R}\) and \(\sigma\) is a scale parameter, restricted to the positive reals, \(\mathbb{R}^+\).
x | Vector |
mu | Real |
sigma | Real (0, Inf) scale parameter |
real unit_johnson_rng | ( | real | mu, |
real | sigma | ||
) |
Unit Johnson SU random number generator function
A unit Johnson SU can be generated by
\begin{aligned} u &\sim \mathcal{U}(0,\,1) \\ x &= \sinh^{-1}\bigg(\frac{\Phi^{-1}(u) - \mu}{\sigma}\bigg) \\ y &= \text{inv_logit}(x) \end{aligned}
where \( x \sim \text{Johnson }S_U(\mu, \sigma)\) and \( y \sim UJS_U(\mu, \sigma)\).
mu | Real |
sigma | Real (0, Inf) scale parameter |