gal: The Generalized Asymmetric Laplace (GAL) Distribution

View source: R/noise.R

galR Documentation

The Generalized Asymmetric Laplace (GAL) Distribution

Description

Density, distribution function, quantile function and random generation for the generalized asymmetric Laplace distribution with parameters mu, sigma and nu, delta.

Usage

dgal(x, delta, mu, nu, sigma, log = FALSE)

rgal(n, delta, mu, nu, sigma, seed = 0)

pgal(q, delta, mu, nu, sigma, lower.tail = TRUE, log.p = FALSE)

qgal(p, delta, mu, nu, sigma, lower.tail = TRUE, log.p = FALSE)

Arguments

x, q

vector of quantiles.

delta

A numeric value for the location parameter.

mu

A numeric value for the shift parameter.

nu

A numeric value for the shape parameter.

sigma

A numeric value for the scaling parameter.

log, log.p

logical; if TRUE, probabilities/densities p are returned as log(p).

n

number of observations.

seed

Seed for the random generation.

lower.tail

logical; if TRUE, probabilities are P[X\leq x], otherwise, P[X>x].

p

vector of probabilities.

Details

The generalized asymmetric Laplace distribution has density given by

f(x; p, a, b) = \frac{e^{\nu+\mu(x-\delta)/\sigma^2}\sqrt{\nu\mu^2/\sigma^2+\nu^2}}{\pi\sqrt{\nu\sigma^2+(x-\delta)^2}} K_1(\sqrt{(\nu\sigma^2+(x-\delta)^2)(\mu^2/\sigma^4+\nu/\sigma^2)}),

where K_p is modified Bessel function of the second kind of order p, x>0, \nu>0 and \mu,\delta, \sigma\in\mathbb{R}. See Barndorff-Nielsen (1977, 1978 and 1997) for further details.

If the mixing variable V follows a Gamma distribution (same parameterization in R):

V \sim \Gamma(h \nu, \nu),

then the poserior follows the GAL distribution (a special case of GIG distribution):

-\mu +\mu V + \sigma \sqrt{V} Z \sim GIG(h \nu - 0.5, 2 \nu + (\frac{\mu}{\sigma})^{2}, 0)

Value

dgal gives the density, pgal gives the distribution function, qgal gives the quantile function, and rgal generates random deviates.

Invalid arguments will result in return value NaN, with a warning.

The length of the result is determined by n for rgal.

References

Barndorff-Nielsen, O. (1977) Exponentially decreasing distributions for the logarithm of particle size. Proceedings of the Royal Society of London.

Series A, Mathematical and Physical Sciences. The Royal Society. 353, 401–409. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1098/rspa.1977.0041")}

Barndorff-Nielsen, O. (1978) Hyperbolic Distributions and Distributions on Hyperbolae, Scandinavian Journal of Statistics. 5, 151–157.

See Also

dgig, dig, digam

Examples

rgal(100, delta = 0, mu = 5, sigma = 1, nu = 1)
pgal(0.4, delta = 0, mu = 5, sigma = 1, nu = 1)
qgal(0.8, delta = 0, mu = 5, sigma = 1, nu = 1)
plot(function(x){dgal(x, delta = 0, mu = 5, sigma = 1, nu = 1)}, main =
"generalized asymmetric Laplace density", ylab = "Probability density",
xlim = c(0,10))

ngme2 documentation built on May 20, 2026, 9:10 a.m.