PearsonDS (version 1.1)

PearsonV: The Pearson Type V (aka Inverse Gamma) Distribution

Description

Density, distribution function, quantile function and random generation for the Pearson type V (aka Inverse Gamma) distribution.

Usage

dpearsonV(x, shape, location, scale, params, log = FALSE)

ppearsonV(q, shape, location, scale, params, lower.tail = TRUE, log.p = FALSE)

qpearsonV(p, shape, location, scale, params, lower.tail = TRUE, log.p = FALSE)

rpearsonV(n, shape, location, scale, params)

Arguments

x, q

vector of quantiles.

p

vector of probabilities.

n

number of observations.

shape

shape parameter of Pearson type V distribution.

location

location parameter of Pearson type V distribution.

scale

scale parameter of Pearson type V distribution.

params

vector/list of length 3 containing parameters shape, location, scale for Pearson type V distribution (in this order!).

log, log.p

logical; if TRUE, probabilities p are given as log(p).

lower.tail

logical; if TRUE, probabilities are \(P[X\le x]\), otherwise, \(P[X>x]\).

Value

dpearsonV gives the density, ppearsonV gives the distribution function, qpearsonV gives the quantile function, and rpearsonV generates random deviates.

Details

The Pearson type V distributions are essentially Inverse Gamma distributions. Thus, all functions are implemented via calls to the corresponding functions for Gamma distributions, ie. dgamma, pgamma, qgamma and rgamma in package stats. Negative scale parameters (which reflect the distribution at location) are permitted to allow for negative skewness. The probability density function with parameters shape\(=a\), scale\(=s\) and location\(=\lambda\) is given by $$f(x)= \frac{|s|^a }{\Gamma(a)} |x-\lambda|^{-a-1} e^{-\frac{s}{x-\lambda}}$$ for \(s\ne 0\), \(a>0\) and \(\frac{s}{x-\lambda}> 0\).

References

See the references in GammaDist.

See Also

GammaDist, PearsonDS-package, Pearson

Examples

Run this code
# NOT RUN {
## define Pearson type V parameter set with shape=3, location=1, scale=-2
pVpars <- list(shape=3, location=1, scale=-2)
## calculate probability density function
dpearsonV(-4:1,params=pVpars)
## calculate cumulative distribution function
ppearsonV(-4:1,params=pVpars)
## calculate quantile function
qpearsonV(seq(0.1,0.9,by=0.2),params=pVpars)
## generate random numbers
rpearsonV(5,params=pVpars)
# }

Run the code above in your browser using DataLab