Learn R Programming

PearsonDS (version 1.3.1)

PearsonI: The Pearson Type I (aka Beta) Distribution

Description

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

Usage

dpearsonI(x, a, b, location, scale, params, log = FALSE)

ppearsonI(q, a, b, location, scale, params, lower.tail = TRUE, log.p = FALSE)

qpearsonI(p, a, b, location, scale, params, lower.tail = TRUE, log.p = FALSE)

rpearsonI(n, a, b, location, scale, params)

Value

dpearsonI gives the density, ppearsonI gives the distribution function, qpearsonI gives the quantile function, and rpearsonI generates random deviates.

Arguments

x, q

vector of quantiles.

p

vector of probabilities.

n

number of observations.

a

first shape parameter of Pearson type I distribution.

b

second shape parameter of Pearson type I distribution.

location

location parameter of Pearson type I distribution.

scale

scale parameter of Pearson type I distribution.

params

vector/list of length 4 containing parameters a, b, location, scale for Pearson type I 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]\).

Details

Essentially, Pearson type I distributions are (location-scale transformations of) Beta distributions, the above functions are thus simple wrappers for dbeta, pbeta, qbeta and rbeta contained in package stats. The probability density function with parameters a, b, scale\(=s\) and location\(=\lambda\) is given by $$f(x)=\frac{1}{|s|}\frac{\Gamma(a+b)}{\Gamma(a)\Gamma(b)}\left(\frac{x-\lambda}{s} \right)^{a-1}\left(1-\frac{x-\lambda}{s}\right)^{b-1}$$ for \(a>0\), \(b>0\), \(s\ne 0\), \(0<\frac{x-\lambda}{s}<1\).

References

See the references in Beta.

See Also

Beta, PearsonDS-package, Pearson

Examples

Run this code
## define Pearson type I parameter set with a=2, b=3, location=1, scale=2
pIpars <- list(a=2, b=3, location=1, scale=2)
## calculate probability density function
dpearsonI(seq(1,3,by=0.5),params=pIpars)
## calculate cumulative distribution function
ppearsonI(seq(1,3,by=0.5),params=pIpars)
## calculate quantile function
qpearsonI(seq(0.1,0.9,by=0.2),params=pIpars)
## generate random numbers
rpearsonI(5,params=pIpars)

Run the code above in your browser using DataLab