Skip to contents

Computes the skewness \(\gamma_1 = E[(X - \mu)^3] / \sigma^3\) for \(X \sim \mathrm{MHN}(\alpha, \beta, \gamma)\).

Usage

mhn_skewness(alpha, beta, gamma)

Arguments

alpha

Shape parameter (\(\alpha > 0\)), a single number.

beta

Rate-type parameter (\(\beta > 0\)), the coefficient of the Gaussian tail \(\exp(-\beta x^2)\); larger values pull mass toward zero. A single number.

gamma

Tilt parameter (\(\gamma \in R\)), the coefficient of the exponential tilt \(\exp(\gamma x)\). A single number.

Value

A numeric scalar.

Details

The skewness is formed from the second and third central moments. In exact arithmetic these follow from the mean of Sun et al. (2023, Lemma 2a) and the recurrence for the raw moments of their Lemma 2b; the function obtains them instead, wherever it can, by numerical integration of the unnormalised density, which needs no normalising constant and stays accurate under a large tilt.

Against independent quadratures, for shapes from 1 to 60 and tilts \(\gamma / \sqrt{\beta}\) from -20 to 12, the absolute error stayed below 1e-9; the largest found, 3e-10, is for a shape between 2 and 3 under a positive tilt.

For a subnormal shape, below the smallest normal double 2.2e-308, the skewness depends on the tilt \(z = \gamma / \sqrt{\beta}\) as follows. While the mass at the peak of the density is small against the mass by the origin (up to \(z\) of about 53 at the largest subnormal shape and 54.5 at the smallest), it grows like \(1 / \sqrt{\alpha}\) as the shape falls, by a factor that depends on the tilt: 1.25 at \(z = 0\) and \(2.8 \times 10^{-8}\) at \(z = 12\). It turns negative where the two masses are about equal (\(z\) from about 53.3 to 54.7), and above a tilt of 55 to 56.3 it no longer depends on \(\alpha\).

The function is not vectorised in its parameters: alpha, beta and gamma must each be a single number. To evaluate several parameter triples, use mapply, as in the examples.

The numerical methods are described in Appendix A of vignette("theory", package = "mhn").

References

Sun, J., Kong, M., & Pal, S. (2023). The Modified-Half-Normal distribution: Properties and an efficient sampling scheme. Communications in Statistics - Theory and Methods, 52(5), 1591–1613. (Lemmas 2a and 2b)

Examples

mhn_skewness(alpha = 2, beta = 1, gamma = 0)
#> [1] 0.6311107
mapply(mhn_skewness, alpha = c(0.5, 2, 5), beta = 1, gamma = c(-1, 0, 3))
#> [1] 1.8814298 0.6311107 0.1579617