PearsonDS (version 1.1)

PearsonVII: The Pearson Type VII (aka Student's t) Distribution

Description

Density, distribution function, quantile function and random generation for the Pearson type VII (aka Student's t) distribution.

Usage

dpearsonVII(x, df, location, scale, params, log = FALSE)

ppearsonVII(q, df, location, scale, params, lower.tail = TRUE, log.p = FALSE)

qpearsonVII(p, df, location, scale, params, lower.tail = TRUE, log.p = FALSE)

rpearsonVII(n, df, location, scale, params)

Arguments

x, q

vector of quantiles.

p

vector of probabilities.

n

number of observations.

df

degrees of freedom of Pearson type VII distribution

location

location parameter of Pearson type VII distribution.

scale

scale parameter of Pearson type VII distribution.

params

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

dpearsonVII gives the density, ppearsonVII gives the distribution function, qpearsonVII gives the quantile function, and rpearsonVII generates random deviates.

Details

The Pearson type VII distribution is a simple (location-scale) transformation of the well-known Student's t distribution; the probability density function with parameters df\(=n\), location\(=\lambda\) and scale\(=s\) is given by $$f(x) = \frac{\Gamma(\frac{n+1}{2})}{\sqrt{n \pi} \Gamma(\frac{n}{2})} \left(1 + \frac{(\frac{x-\lambda}{s})^2}{n}\right)^{-\frac{n+1}{2}}$$ for \(s\ne 0\). The above functions are thus only wrappers for dt, pt, qt and rt contained in package stats.

References

See the references in TDist.

See Also

TDist, PearsonDS-package, Pearson

Examples

Run this code
# NOT RUN {
## define Pearson type VII parameter set with df=7, location=1, scale=1
pVIIpars <- list(df=7, location=1, scale=1)
## calculate probability density function
dpearsonVII(-2:4,params=pVIIpars)
## calculate cumulative distribution function
ppearsonVII(-2:4,params=pVIIpars)
## calculate quantile function
qpearsonVII(seq(0.1,0.9,by=0.2),params=pVIIpars)
## generate random numbers
rpearsonVII(5,params=pVIIpars)
# }

Run the code above in your browser using DataCamp Workspace