R: truncated multivariate normal cumulative distribution
mvNcdf
R Documentation
truncated multivariate normal cumulative distribution
Description
computes an estimator 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;
Monte Carlo method uses sample size n;
Usage
mvNcdf(l, u, Sig, n)
Arguments
l
lower truncation limit
u
upper truncation limit
Sig
covariance matrix of N(0,Σ)
n
Monte Carlo simulation effort — the larger
the n, the smaller the relative error of the estimator.
Details
Suppose you wish to estimate p=Pr(l<AX<u),
where A is a full rank matrix
and X is drawn from N(μ,Σ), then you simply compute
p=Pr(l-Aμ<AY<u-Aμ),
where Y is drawn from N(0, AΣ A^\top).
Value
est with structure
$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.
Z. I. Botev (2015), The Normal Law Under Linear Restrictions:
Simulation and Estimation via Minimax Tilting, submitted to JRSS(B)
See Also
See also: mvNqmc and mvrandn
Examples
d=15;l=1:d;u=l+Inf;
Sig=matrix(rnorm(d^2),d,d)*2;Sig=Sig%*%t(Sig)
n=10^3 # size of simulation effort
x=mvNcdf(l,u,Sig,10^4) # compute the probability
print(x)