The g-and-k distribution is a flexible distribution often used to model univariate data. It is particularly known for its ability to handle skewness and heavy-tailed behavior.
dist_gk(A, B, g, k, c = 0.8)We recommend reading this documentation on pkgdown which renders math nicely. https://pkg.mitchelloharawild.com/distributional/reference/dist_gk.html
In the following, let \(X\) be a g-k random variable with parameters
A, B, g, k, and c.
Support: \((-\infty, \infty)\)
Mean: Not available in closed form.
Variance: Not available in closed form.
Probability density function (p.d.f):
The g-k distribution does not have a closed-form expression for its density. Instead, it is defined through its quantile function:
$$ Q(u) = A + B \left( 1 + c \frac{1 - \exp(-gz(u))}{1 + \exp(-gz(u))} \right) (1 + z(u)^2)^k z(u) $$
where \(z(u) = \Phi^{-1}(u)\), the standard normal quantile of u.
Cumulative distribution function (c.d.f):
The cumulative distribution function is typically evaluated numerically due to the lack of a closed-form expression.
dist <- dist_gk(A = 0, B = 1, g = 0, k = 0.5)
dist
#> <distribution[1]>
#> [1] gk(A = 0, B = 1, g = 0, k = 0.5)
mean(dist)
#> [1] 0
variance(dist)
#> [1] 4.000037
support(dist)
#> <support_region[1]>
#> [1] R
generate(dist, 10)
#> [[1]]
#> [1] -1.5986911 -0.2453794 -4.3080963 0.7281328 0.3522837 -1.5050043
#> [7] 1.4988522 -0.7995753 1.0306936 -2.7572915
#>
density(dist, 2)
#> [1] 0.07092933
density(dist, 2, log = TRUE)
#> [1] -2.646071
cdf(dist, 4)
#> [1] 0.9698865
quantile(dist, 0.7)
#> [1] 0.5921306