igt {ig} | R Documentation |
Density, distribution function, quantile function and random generation for the inverse gaussian type distribution with mean parameter mu, scale parameter lambda and associated kernel.
digt(x, mu = 1.0, lambda = 1.0, nu = 1.0, kernel = "normal", log = FALSE) pigt(q, mu = 1.0, lambda = 1.0, nu = 1.0, kernel = "normal", lower.tail = TRUE, log.p = FALSE) qigt(p, mu = 1.0, lambda = 1.0, nu = 1.0, kernel = "normal", lower.tail = TRUE, log.p = FALSE) rigt(n, mu = 1.0, lambda = 1.0, nu = 1.0, kernel = "normal")
x, q |
Vector of observations (quantiles). |
p |
Vector of probabilities. |
mu |
Mean. |
lambda |
Scale parameter. |
nu |
Shape parameter corresponding to the degrees of freedom of the t distribution. In the case of the Laplace, logistic, normal kernels, nu can be fixed at the value 1.0 since this parameter is not involved in these kernels. |
n |
Number of observations. |
kernel |
Kernel of the pdf of the associated symmetrical distribution
by means of which the IGTD is obtained. The kernels:
"laplace" , "logistic" , "normal" and
"t" are available. |
log, log.p |
Logical; if TRUE, probabilities p are given as log(p). |
lower.tail |
Logical; if TRUE (default), probabilities are P[X <= x], otherwise, P[X > x]. |
Probability density function (pdf) for the IGTD with mean parameter mu, scale
parameter lambda and associated kernel g. The IGTD is a
generalization of the IGTD; for details see Sanhueza, Leiva and Balakrishnan
(2008). The g argument corresponds to the kernel of the pdf of the
associated symmetrical distribution. In the ig package, the IGTD can be
obtained from the following kernels: Laplace, logistic, normal (classical
case) and Student-t. All these kernels are implemented in the R
software. The Laplace or double exponential distribution can be obtained
from the normalp package developed by Mineo (2005).
If mu, lambda or g are not specified, then they assume the default
values 1.0, 1.0 and "normal"
, respectively.
The IGTD has pdf given by
f_T(t)=f_Z(a_{t}) sqrt{λ}/sqrt{t^{3}},
with t > 0, μ>0 and λ>0, where f_Z(cdot) = c,g(cdot) is the pdf of the associated symmetrical about zero distribution and a_{t} = a_{t}(μ,λ) = sqrt{λ/μ} [sqrt{t/μ} - sqrt{μ/t}].
It is not possible to find the quantile function of the IGTD in a closed analytical form, so these values must be obtained by numerical methods.
Statistical inference tools may not exist in closed form for the IGTD, which is not the case for the classical IGTD. Hence, simulation and numerical studies are needed, which require a random number (r.n) generator. Next, we present a r.n. generator for the IGTD following a similar procedure to the one given in Chhikara and Folks (1989, pp. 52-53) for the classical inverse Gaussian distribution. This generator has been implemented in the ig package. Thus, if T sim {rm IGT}(μ, λ; g), the algorithm steps are: begin{itemize}
begin{enumerate}
digt()
gives the density, pigt()
gives the distribution function,
qigt()
gives the quantile function, and rigt()
generates random deviates.
Víctor Leiva <victor.leiva@uv.cl; victor.leiva@yahoo.com>,
Hugo Hernández <hugo.hernandez.p@gmail.com> and
Antonio Sanhueza <asanhueza@ufro.cl>.
Sanhueza, A., Leiva, V., Balakrishnan, N. (2008). A new class of inverse Gaussian type distributions. Metrika (in press).
Chhikara, R. S. and Folks, J. L. (1989). The Inverse Gaussian Distribution. Marcel Dekker, New York.
## Computes the pdf of the IGTD with g = "normal" for a vector x with mu = 1.0, ## lambda = 1.0 x <- seq(0.01, 4, by = 0.01) fx <- digt(x, mu = 1.0, lambda = 1.0, nu = 1.0, kernel = "normal") print(fx) ## At the end there is a graph of this pdf plot(x, fx, main = "pdf of the IGTD (classical case)", ylab = "f(x)") ## Computes the cdf of the IGTD with g = "normal" for a vector x with mu = 1.0, ## lambda = 1.0 Fx <- pigt(x, mu = 1.0, lambda = 1.0, nu = 1.0, kernel = "normal") print(Fx) ## At the end there is a graph of this cdf plot(x, Fx, main = "cdf of the IGTD (classical case)", ylab = "F(x)") ## Compute the 50 percentile (median) for a vector of probabilities x ## of the IGT with mu = 1.0, lambda = 1.0 and kernel = "normal" q <- qigt(0.5, mu = 1.0, lambda = 1.0, kernel = "normal") q ## Generates a sample x from the IGTD with normal kernel. ## At the end we have the histogram of x x <- rigt(1000, mu = 1.0, lambda = 1.0, nu = 1.0, kernel = "normal") hist(x, main = "Histogram of a sample from IGTD")