Learn R Programming

Runuran (version 0.21.0)

udgig: UNU.RAN object for Generalized Inverse Gaussian distribution

Description

Create UNU.RAN object for a Generalized Inverse Gaussian distribution. Two parametrizations are available. [Distribution] -- Generalized Inverse Gaussian.

Usage

udgig(theta, psi, chi, lb=0, ub=Inf)
udgiga(theta, omega, eta=1, lb=0, ub=Inf)

Arguments

theta
shape parameter.
psi, chi
shape parameters (must be strictly positive).
omega, eta
shape parameters (must be strictly positive).
lb
lower bound of (truncated) distribution.
ub
upper bound of (truncated) distribution.

Value

  • An object of class "unuran.cont".

Details

The generalized inverse Gaussian distribution with parameters $\theta$, $\psi$, and $\chi$ has density proportional to $$f(x) = x^{\theta-1} \exp\left( -\frac{1}{2} \left(\psi x + \frac{\chi}{x}\right)\right)$$ where $\psi>0$ and $\chi>0$.

An alternative parametrization used parameters $\theta$, $\omega$, and $\eta$ and has density proportional to $$f(x) = x^{\theta-1} \exp\left( -\frac{\omega}{2} \left(\frac{x}{\eta}+\frac{\eta}{x}\right)\right)$$ The domain of the distribution can be truncated to the interval (lb,ub).

References

N.L. Johnson, S. Kotz, and N. Balakrishnan (1994): Continuous Univariate Distributions, Volume 1. 2nd edition, John Wiley & Sons, Inc., New York. Chap. 15, p. 284.

See Also

unuran.cont.

Examples

Run this code
## Create distribution object for GIG distribution
distr <- udgig(theta=3, psi=1, chi=1)
## Generate generator object; use method PINV (inversion)
gen <- pinvd.new(distr)
## Draw a sample of size 100
x <- ur(gen,100)

Run the code above in your browser using DataLab