| nig | R Documentation |
Density, distribution function, quantile function and
random generation for the normal inverse-Gaussian distribution
with parameters p, a and b.
dnig(x, delta, mu, nu, sigma, h = NULL, log = FALSE)
rnig(n, delta, mu, nu, sigma, h = NULL, seed = 0)
pnig(q, delta, mu, nu, sigma, h = NULL, lower.tail = TRUE, log.p = FALSE)
qnig(p, delta, mu, nu, sigma, h = NULL, lower.tail = TRUE, log.p = FALSE)
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. |
h |
A numeric value for the additional parameter, see details. |
log, log.p |
logical; if |
n |
number of observations. |
seed |
Seed for the random generation. |
lower.tail |
logical; if |
p |
vector of probabilities. |
The normal inverse-Gaussian distribution has density given by
f(x; \delta, \mu, \sigma, \nu) =
\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.
The additional parameter h is used when
V\sim IG(\nu,\nu h^{2})
. By the infinite divisibility,
\frac{1}{h} V \sim IG(\nu h, \nu h)
. Then
\delta+\mu V + \sigma \sqrt{V} Z
has the distribution of
NIG(\delta=-\mu h,\mu= \mu h, \sigma=\sigma \sqrt{h}, \nu=\nu h).
dnig gives the density, pnig gives the distribution function, qnig gives the quantile function, and rnig generates random deviates.
Invalid arguments will result in return value NaN, with a warning.
The length of the result is determined by n for rnig.
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.
Barndorff-Nielsen, O. (1997) Normal Inverse Gaussian Distributions and Stochastic Volatility Modelling, Scandinavian Journal of Statistics. 24, 1-13. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1111/1467-9469.00045")}
dgig, dig, digam
rnig(100, delta = 0, mu = 5, sigma = 1, nu = 1)
pnig(0.4, delta = 0, mu = 5, sigma = 1, nu = 1)
qnig(0.8, delta = 0, mu = 5, sigma = 1, nu = 1)
plot(function(x){dnig(x, delta = 0, mu = 5, sigma = 1, nu = 1)}, main =
"Normal inverse-Gaussian density", ylab = "Probability density",
xlim = c(0,10))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.