Title: | Generalized Normal/Exponential Power Distribution |
---|---|
Description: | Functions for obtaining generalized normal/exponential power distribution probabilities, quantiles, densities and random deviates. The generalized normal/exponential power distribution was introduced by Subbotin (1923) and rediscovered by Nadarajah (2005). The parametrization given by Nadarajah (2005) <doi:10.1080/02664760500079464> is used. |
Authors: | Maryclare Griffin |
Maintainer: | Maryclare Griffin <[email protected]> |
License: | GPL (>=2) |
Version: | 1.0.2 |
Built: | 2024-11-04 05:34:29 UTC |
Source: | https://github.com/maryclare/gnorm |
Density, distribution function and random generation for the generalized normal/exponential power distribution.
A generalized normal random variable with parameters
,
and
has density:
The mean and variance of are
and
, respectively.
dgnorm(x, mu = 0, alpha = 1, beta = 1, log = FALSE) pgnorm(q, mu = 0, alpha = 1, beta = 1, lower.tail = TRUE, log.p = FALSE) qgnorm(p, mu = 0, alpha = 1, beta = 1, lower.tail = TRUE, log.p = FALSE) rgnorm(n, mu = 0, alpha = 1, beta = 1)
dgnorm(x, mu = 0, alpha = 1, beta = 1, log = FALSE) pgnorm(q, mu = 0, alpha = 1, beta = 1, lower.tail = TRUE, log.p = FALSE) qgnorm(p, mu = 0, alpha = 1, beta = 1, lower.tail = TRUE, log.p = FALSE) rgnorm(n, mu = 0, alpha = 1, beta = 1)
x , q
|
vector of quantiles |
mu |
location parameter |
alpha |
scale parameter |
beta |
shape parameter |
log , log.p
|
logical; if TRUE, probabilities p are given as log(p) |
p |
vector of probabilities |
n |
number of observations |
lower.tail |
logical; if TRUE (default), probabilities are |
dgnorm
, pgnorm
, qgnorm
andrgnorm
are all parametrized as in Version 1 of the Generalized Normal Distribution Wikipedia page,
which uses the parametrization given by in Nadarajah (2005).
The same distribution was described much earlier by Subbotin (1923) and named the exponential power distribution by Box and Tiao (1973).
Box, G. E. P. and G. C. Tiao. "Bayesian inference in Statistical Analysis." Addison-Wesley Pub. Co., Reading, Mass (1973).
Nadarajah, Saralees. "A generalized normal distribution." Journal of Applied Statistics 32.7 (2005): 685-694.
Subbotin, M. T. "On the Law of Frequency of Error." Matematicheskii Sbornik 31.2 (1923): 206-301.
# Plot generalized normal/exponential power density # that corresponds to the standard normal density xs <- seq(-1, 1, length.out = 100) plot(xs, dgnorm(xs, mu = 0, alpha = sqrt(2), beta = 2), type = "l", xlab = "x", ylab = expression(p(x))) # Plot the generalized normal/exponential power CDF # that corresponds to the standard normal CDF s <- seq(-1, 1, length.out = 100) plot(xs, pgnorm(xs, 0, sqrt(2), 2), type = "l", xlab = "q", ylab = expression(paste("Pr(", x<=q, ")", sep = ""))) # Plot the generalized normal/exponential power inverse CDF # that corresponds to the standard normal inverse CDF xs <- seq(0, 1, length.out = 100) plot(xs, qgnorm(xs, 0, sqrt(2), 2), type = "l", xlab = "p", ylab = expression(paste("q: p = Pr(", x<=q, ")", sep = ""))) # Make a histogram of draws from the generalized normal/exponential # power distribution that corresponds to a standard normal distribution xs <- rgnorm(100, 0, sqrt(2), 2)
# Plot generalized normal/exponential power density # that corresponds to the standard normal density xs <- seq(-1, 1, length.out = 100) plot(xs, dgnorm(xs, mu = 0, alpha = sqrt(2), beta = 2), type = "l", xlab = "x", ylab = expression(p(x))) # Plot the generalized normal/exponential power CDF # that corresponds to the standard normal CDF s <- seq(-1, 1, length.out = 100) plot(xs, pgnorm(xs, 0, sqrt(2), 2), type = "l", xlab = "q", ylab = expression(paste("Pr(", x<=q, ")", sep = ""))) # Plot the generalized normal/exponential power inverse CDF # that corresponds to the standard normal inverse CDF xs <- seq(0, 1, length.out = 100) plot(xs, qgnorm(xs, 0, sqrt(2), 2), type = "l", xlab = "p", ylab = expression(paste("q: p = Pr(", x<=q, ")", sep = ""))) # Make a histogram of draws from the generalized normal/exponential # power distribution that corresponds to a standard normal distribution xs <- rgnorm(100, 0, sqrt(2), 2)