udgig function

UNU.RAN object for Generalized Inverse Gaussian distribution

UNU.RAN object for Generalized Inverse Gaussian distribution

Create UNU.RAN object for a Generalized Inverse Gaussian distribution. Two parametrizations are available.

[Distribution] -- Generalized Inverse Gaussian.

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.

Details

The generalized inverse Gaussian distribution with parameters thetatheta, psipsi, and chichi

has density proportional to

f(x)=xθ1exp(12(ψx+χx))f(x)=x(theta1)exp(1/2(psix+chi/x)) f(x) = x^{\theta-1} \exp\left( -\frac{1}{2} \left(\psi x + \frac{\chi}{x}\right)\right)f(x) = x^(theta-1) * exp( -1/2 * (psi*x + chi/x) )

where psi>0psi>0 and chi>0chi>0.

An alternative parametrization used parameters thetatheta, omegaomega, and etaeta

and has density proportional to

f(x)=xθ1exp(ω2(xη+ηx))f(x)=x(theta1)exp(omega/2(x/eta+eta/x)) f(x) = x^{\theta-1} \exp\left( -\frac{\omega}{2} \left(\frac{x}{\eta}+\frac{\eta}{x}\right)\right)f(x) = x^(theta-1) * exp( -omega/2 * (x/eta + eta/x) )

The domain of the distribution can be truncated to the interval (lb,ub).

Returns

An object of class "unuran.cont".

Note

These two parametrizations can be converted into each other by means of the following transformations:

ψ=ωη,      χ=ω\etapsi=omega/eta,chi=omegaeta \psi = \frac{\omega}{\eta},\;\;\;\chi = \omega\etapsi = omega/eta, chi = omega*eta ω=χψ,      η=χψomega=sqrt(chipsi),eta=sqrt(chi/psi) \omega = \sqrt{\chi\psi},\;\;\;\eta = \sqrt{\frac{\chi}{\psi}}omega = sqrt(chi*psi), eta = sqrt(chi/psi)

See Also

unuran.cont.

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.

Author(s)

Josef Leydold and Wolfgang H"ormann unuran@statmath.wu.ac.at .

Examples

## 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)
  • Maintainer: Josef Leydold
  • License: GPL (>= 2)
  • Last published: 2025-04-07