Learn R Programming

distributional (version 0.6.0)

dist_gh: The generalised g-and-h Distribution

Description

[Stable]

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.

Usage

dist_gh(A, B, g, h, c = 0.8)

Arguments

A

Vector of A (location) parameters.

B

Vector of B (scale) parameters. Must be positive.

g

Vector of g parameters.

h

Vector of h parameters. Must be non-negative.

c

Vector of c parameters (used for generalised g-and-h). Often fixed at 0.8 which is the default.

Details

We recommend reading this documentation on pkgdown which renders math nicely. https://pkg.mitchelloharawild.com/distributional/reference/dist_gh.html

In the following, let \(X\) be a g-and-h random variable with parameters A = \(A\), B = \(B\), g = \(g\), h = \(h\), and c = \(c\).

Support: \((-\infty, \infty)\)

Mean: Does not have a closed-form expression. Approximated numerically.

Variance: Does not have a closed-form expression. Approximated numerically.

Probability density function (p.d.f):

The g-and-h distribution does not have a closed-form expression for its density. The density is approximated numerically from the quantile function. The distribution is defined through its quantile function:

$$ Q(u) = A + B \left( 1 + c \frac{1 - \exp(-gz(u))}{1 + \exp(-gz(u))} \right) \exp(h z(u)^2/2) z(u) $$

where \(z(u) = \Phi^{-1}(u)\) is the standard normal quantile function.

Cumulative distribution function (c.d.f):

Does not have a closed-form expression. The cumulative distribution function is approximated numerically by inverting the quantile function.

Quantile function:

$$ Q(p) = A + B \left( 1 + c \frac{1 - \exp(-g\Phi^{-1}(p))}{1 + \exp(-g\Phi^{-1}(p))} \right) \exp(h (\Phi^{-1}(p))^2/2) \Phi^{-1}(p) $$

where \(\Phi^{-1}(p)\) is the standard normal quantile function.

See Also

gk::dgh(), gk::pgh(), gk::qgh(), gk::rgh(), dist_gk()

Examples

Run this code
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