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

mvNcdf

Truncated multivariate normal cumulative distribution


Description

Computes an estimate and a deterministic upper bound of the probability Pr(l<X<u), where X is a zero-mean multivariate normal vector with covariance matrix Σ, that is, X is drawn from N(0,Σ). Infinite values for vectors u and l are accepted. The Monte Carlo method uses sample size n; the larger n, the smaller the relative error of the estimator.

Usage

mvNcdf(l, u, Sig, n = 1e+05)

Arguments

l

lower truncation limit

u

upper truncation limit

Sig

covariance matrix of N(0,Σ)

n

number of Monte Carlo simulations

Details

Suppose you wish to estimate Pr(l<AX<u), where A is a full rank matrix and X is drawn from N(μ,Σ), then you simply compute Pr(l-Aμ<AY<u-Aμ), where Y is drawn from N(0, AΣ A^\top).

Value

a list with components

  • prob: estimated value of probability Pr(l<X<u)

  • relErr: estimated relative error of estimator

  • upbnd: theoretical upper bound on true Pr(l<X<u)

Note

For small dimensions, say d<50, better accuracy may be obtained by using the (usually slower) quasi-Monte Carlo version mvNqmc of this algorithm.

Author(s)

Zdravko I. Botev

References

Z. I. Botev (2017), The Normal Law Under Linear Restrictions: Simulation and Estimation via Minimax Tilting, Journal of the Royal Statistical Society, Series B, 79 (1), pp. 1–24.

See Also

Examples

d <- 15; l <- 1:d; u <- rep(Inf, d);
Sig <- matrix(rnorm(d^2), d, d)*2; Sig=Sig %*% t(Sig)
mvNcdf(l, u, Sig, 1e4) # compute the probability

TruncatedNormal

Truncated Multivariate Normal and Student Distributions

v2.2
GPL-3
Authors
Zdravko Botev [aut] (<https://orcid.org/0000-0001-9054-3452>), Leo Belzile [aut, cre] (<https://orcid.org/0000-0002-9135-014X>)
Initial release
2020-05-16

We don't support your browser anymore

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