Learn R Programming

qbld (version 1.0.3)

gig: Generalised Inverse Gaussian

Description

Probability distribution function, random generation for the Generalised Inverse Gaussian with three parameters \(a(chi)\), \(b(psi)\), \(p\).

Usage

dgig(x, a, b, p, log_density)

rgig(n, lambda, a, b)

Arguments

x

: Argument of pdf

a

: chi parameter. Must be nonnegative for positive lambda and positive else.

b

: psi parameter. Must be nonnegative for negative lambda and positive else.

log_density

: logical; returns log density if TRUE

n

: number of observations

lambda, p

: lambda parameter

Value

  • rgig returns a vector of random numbers from GIG(a,b,p).

  • dgig returns returns density of a GIG(a,b,p) at point x.

Details

The Generalised Inverse Gaussian distrubtion(GIG), which has the following pdf

$$f(x) = x^{\lambda-1}\exp\{-\frac{\omega}{2}(x + \frac{1}{x})\}$$

References

Devroye, L. Random variate generation for the generalized inverse Gaussian distribution. Stat Comput 24, 239<U+2013>246 (2014).

Wolfgang H<U+00F6>rmann and Josef Leydold (2013). Generating generalized inverse Gaussian random variates, Statistics and Computing (to appear), DOI: 10.1007/s11222-013-9387-3

J. S. Dagpunar (1989). An easily implemented generalised inverse Gaussian generator, Comm. Statist. B <U+2013> Simulation Comput. 18, 703<U+2013>710.

See Also

raldmix for random sampling from Asymmetric Laplace distribution

Examples

Run this code
# NOT RUN {
rgig(n = 1, lambda = 0.5, a = 1, b = 2)
dgig(x = 1, a = 1, b = 2, p = 0.5, log_density = FALSE)

# }

Run the code above in your browser using DataLab