Returns the inverse cumulative distribution, aka quantile, function for a distribution evaluated at a given point between 0 and 1.

# S3 method for Distribution
quantile(x, p, ..., lower.tail = TRUE, log.p = FALSE, simplify = TRUE)

Arguments

x

Distribution.

p

vector of probabilities to evaluate function at.

...

additional arguments.

lower.tail

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

log.p

logical; if TRUE then \(q_X(exp(p))\) is returned.

simplify

if TRUE (default) returns results in simplest form (vector or data.table) otherwise as data.table.

Value

Inverse cumulative distribution function evaluated at given points as either a numeric if simplify is TRUE or as a data.table.

Details

The quantile function, \(q_X\), is the inverse cdf, i.e. $$q_X(p) = F^{-1}_X(p) = \inf\{x \in R: F_X(x) \ge p\}$$

If lower.tail is FALSE then \(q_X(1-p)\) is returned.

If available a quantile will be returned without warning using an analytic expression. Otherwise, if the distribution has not been decorated with FunctionImputation, NULL is returned. To impute the quantile, use decorate(distribution, FunctionImputation), this will provide a numeric calculation for the quantile with warning.

Additional named arguments can be passed, which are required for composite distributions such as ProductDistribution and VectorDistribution.

R6 Usage

$quantile(p, ..., lower.tail = TRUE, log.p = FALSE, simplify = TRUE)

See also

pdf, cdf, rand for other statistical functions. FunctionImputation, decorate for imputing missing functions.