Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

qmvnorm

Quantiles of the Multivariate Normal Distribution


Description

Computes the equicoordinate quantile function of the multivariate normal distribution for arbitrary correlation matrices based on inversion of pmvnorm, using a stochastic root finding algorithm described in Bornkamp (2018).

Usage

qmvnorm(p, interval = NULL, tail = c("lower.tail", 
        "upper.tail", "both.tails"), mean = 0, corr = NULL, 
        sigma = NULL, algorithm = GenzBretz(),
        ptol = 0.001, maxiter = 500, trace = FALSE, ...)

Arguments

p

probability.

interval

optional, a vector containing the end-points of the interval to be searched. Does not need to contain the true quantile, just used as starting values by the root-finder. If equal to NULL a guess is used.

tail

specifies which quantiles should be computed. lower.tail gives the quantile x for which P[X ≤ x] = p, upper.tail gives x with P[X > x] = p and both.tails leads to x with P[-x ≤ X ≤ x] = p.

mean

the mean vector of length n.

corr

the correlation matrix of dimension n.

sigma

the covariance matrix of dimension n. Either corr or sigma can be specified. If sigma is given, the problem is standardized. If neither corr nor sigma is given, the identity matrix is used for sigma.

algorithm

an object of class GenzBretz, Miwa or TVPACK specifying both the algorithm to be used as well as the associated hyper parameters.

ptol, maxiter, trace

Parameters passed to the stochastic root-finding algorithm. Iteration stops when the 95% confidence interval for the predicted quantile is inside [p-ptol, p+ptol]. maxiter is the maximum number of iterations for the root finding algorithm. trace prints the iterations of the root finder.

...

additional parameters to be passed to GenzBretz.

Details

Only equicoordinate quantiles are computed, i.e., the quantiles in each dimension coincide. The result is seed dependend.

Value

A list with two components: quantile and f.quantile give the location of the quantile and the difference between the distribution function evaluated at the quantile and p.

References

Bornkamp, B. (2018). Calculating quantiles of noisy distribution functions using local linear regressions. Computational Statistics, 33, 487–501.

See Also

Examples

qmvnorm(0.95, sigma = diag(2), tail = "both")

mvtnorm

Multivariate Normal and t Distributions

v1.1-1
GPL-2
Authors
Alan Genz [aut], Frank Bretz [aut], Tetsuhisa Miwa [aut], Xuefei Mi [aut], Friedrich Leisch [ctb], Fabian Scheipl [ctb], Bjoern Bornkamp [ctb] (<https://orcid.org/0000-0002-6294-8185>), Martin Maechler [ctb], Torsten Hothorn [aut, cre] (<https://orcid.org/0000-0001-8301-0471>)
Initial release
2020-06-09

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.