PearsonDS (version 1.1)

PearsonIII: The Pearson Type III (aka Gamma) Distribution

Description

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

Usage

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

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

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

rpearsonIII(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 III distribution.

location

location parameter of Pearson type III distribution.

scale

scale parameter of Pearson type III distribution.

params

vector/list of length 3 containing parameters shape, location, scale for Pearson type III 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

dpearsonIII gives the density, ppearsonIII gives the distribution function, qpearsonIII gives the quantile function, and rpearsonIII generates random deviates.

Details

Essentially, the above functions are wrappers for dgamma, pgamma, qgamma and rgamma contained in package stats. As a minor (but important) extension, 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 thus given by $$f(x)= \frac{1}{|s|^a \Gamma(a)} |x-\lambda|^{a-1} e^{-\frac{x-\lambda}{s}}$$ for \(s\ne 0\), \(a>0\) and \(\frac{x-\lambda}{s}\ge 0\).

References

See the references in GammaDist.

See Also

GammaDist, PearsonDS-package, Pearson

Examples

Run this code
# NOT RUN {
## define Pearson type III parameter set with shape=3, location=1, scale=-2
pIIIpars <- list(shape=3, location=1, scale=-0.5)
## calculate probability density function
dpearsonIII(-4:1,params=pIIIpars)
## calculate cumulative distribution function
ppearsonIII(-4:1,params=pIIIpars)
## calculate quantile function
qpearsonIII(seq(0.1,0.9,by=0.2),params=pIIIpars)
## generate random numbers
rpearsonIII(5,params=pIIIpars)
# }

Run the code above in your browser using DataLab