Density function, distribution function, quantile function, random
generation, raw moments, limited moments and moment generating
function for the Inverse Gaussian distribution with parameters
mean
and shape
.
dinvgauss(x, mean, shape = 1, dispersion = 1/shape,
log = FALSE)
pinvgauss(q, mean, shape = 1, dispersion = 1/shape,
lower.tail = TRUE, log.p = FALSE)
qinvgauss(p, mean, shape = 1, dispersion = 1/shape,
lower.tail = TRUE, log.p = FALSE,
tol = 1e-14, maxit = 100, echo = FALSE, trace = echo)
rinvgauss(n, mean, shape = 1, dispersion = 1/shape)
minvgauss(order, mean, shape = 1, dispersion = 1/shape)
levinvgauss(limit, mean, shape = 1, dispersion = 1/shape, order = 1)
mgfinvgauss(t, mean, shape = 1, dispersion = 1/shape, log = FALSE)
vector of quantiles.
vector of probabilities.
number of observations. If length(n) > 1
, the length is
taken to be the number required.
parameters. Must be strictly positive. Infinite values are supported.
an alternative way to specify the shape.
logical; if TRUE
, probabilities/densities
logical; if TRUE
(default), probabilities are
order of the moment. Only order = 1
is
supported by levinvgauss
.
limit of the loss variable.
small positive value. Tolerance to assess convergence in the Newton computation of quantiles.
positive integer; maximum number of recursions in the Newton computation of quantiles.
logical; echo the recursions to screen in the Newton computation of quantiles.
numeric vector.
dinvgauss
gives the density,
pinvgauss
gives the distribution function,
qinvgauss
gives the quantile function,
rinvgauss
generates random deviates,
minvgauss
gives the levinvgauss
gives the limited expected value, and
mgfinvgauss
gives the moment generating function in t
.
Invalid arguments will result in return value NaN
, with a warning.
The inverse Gaussian distribution with parameters mean
dispersion
The limiting case shape
rate
phi
). This distribution has no
finite strictly positive, integer moments.
The limiting case
If the random variable
The
The moment generating function of the inverse guassian is defined for
t <= 1/(2 * mean^2 * phi)
.
Giner, G. and Smyth, G. K. (2016), “statmod: Probability Calculations for the Inverse Gaussian Distribution”, R Journal, vol. 8, no 1, p. 339-351. https://journal.r-project.org/archive/2016-1/giner-smyth.pdf
Chhikara, R. S. and Folk, T. L. (1989), The Inverse Gaussian Distribution: Theory, Methodology and Applications, Decker.
Devroye, L. (1986), Non-Uniform Random Variate Generation, Springer-Verlag. http://luc.devroye.org/rnbookindex.html
dinvgamma
for the inverse gamma distribution.
# NOT RUN {
dinvgauss(c(-1, 0, 1, 2, Inf), mean = 1.5, dis = 0.7)
dinvgauss(c(-1, 0, 1, 2, Inf), mean = Inf, dis = 0.7)
dinvgauss(c(-1, 0, 1, 2, Inf), mean = 1.5, dis = Inf) # spike at zero
## Typical graphical representations of the inverse Gaussian
## distribution. First fixed mean and varying shape; second
## varying mean and fixed shape.
col = c("red", "blue", "green", "cyan", "yellow", "black")
par = c(0.125, 0.5, 1, 2, 8, 32)
curve(dinvgauss(x, 1, par[1]), from = 0, to = 2, col = col[1])
for (i in 2:6)
curve(dinvgauss(x, 1, par[i]), add = TRUE, col = col[i])
curve(dinvgauss(x, par[1], 1), from = 0, to = 2, col = col[1])
for (i in 2:6)
curve(dinvgauss(x, par[i], 1), add = TRUE, col = col[i])
pinvgauss(qinvgauss((1:10)/10, 1.5, shape = 2), 1.5, 2)
minvgauss(1:4, 1.5, 2)
levinvgauss(c(0, 0.5, 1, 1.2, 10, Inf), 1.5, 2)
# }
Run the code above in your browser using DataLab