Last chance! 50% off unlimited learning
Sale ends in
The generalised g-and-h distribution is a flexible distribution used to model univariate data, similar to the g-k distribution. It is known for its ability to handle skewness and heavy-tailed behavior.
dist_gh(A, B, g, h, c = 0.8)
Vector of A (location) parameters.
Vector of B (scale) parameters. Must be positive.
Vector of g parameters.
Vector of h parameters. Must be non-negative.
Vector of c parameters (used for generalised g-and-h). Often fixed at 0.8 which is the default.
We recommend reading this documentation on https://pkg.mitchelloharawild.com/distributional/, where the math will render nicely.
In the following, let A
, B
, g
, h
, and c
.
Support:
Mean: Not available in closed form.
Variance: Not available in closed form.
Probability density function (p.d.f):
The g-and-h distribution does not have a closed-form expression for its density. Instead, it is defined through its quantile function:
where
Cumulative distribution function (c.d.f):
The cumulative distribution function is typically evaluated numerically due to the lack of a closed-form expression.
gk::dgh, dist_gk
dist <- dist_gh(A = 0, B = 1, g = 0, h = 0.5)
dist
if (FALSE) { # requireNamespace("gk", quietly = TRUE)
mean(dist)
variance(dist)
support(dist)
generate(dist, 10)
density(dist, 2)
density(dist, 2, log = TRUE)
cdf(dist, 4)
quantile(dist, 0.7)
}
Run the code above in your browser using DataLab