50% off | Unlimited Data & AI Learning
Get 50% off unlimited learning

mixbox (version 1.2.3)

rigaussian: Simulating from inversse Gaussian random variable.

Description

Using method of Michael and Schucany (1976), we can generate from inversse Gaussian random variable. The density function of an inversse Gaussian distribution is given by fW(w|\boldθ)=β2πw3exp{β(wα)22α2w}, where w>0 and \boldθ=(α,β). Herein α>0 is the mean and β>0 are the first (mean) and second (shape) parameter of this family, respectively.

Usage

rigaussian(n, alpha, beta)

Value

simulated realizations of size n from inversse Gaussian random variable.

Arguments

n

size of required samples.

alpha

tail mean parameter.

beta

shape parameter.

Author

Mahdi Teimouri

References

J. R. Michael and Schucany, (1976). Generating Random Variates Using Transformations with Multiple Roots, The American Statistician, 30(2), 88-90, tools:::Rd_expr_doi("10.1080/00031305.1976.10479147").

Examples

Run this code
# \donttest{
    n <- 100
alpha <- 4
 beta <- 2
rigaussian(n, alpha, beta)
# }

Run the code above in your browser using DataLab