I'm interested in finding the mean and covariance of a truncated normal random vector. Suppose Y
is a vector containing [Y1 Y2 Y3]
. Y
follows a multivariate normal distribution with the following mean and covariance:
mu <- c(0.5, 0.5, 0.5)
sigma <- matrix(c( 1, 0.6, 0.3,
0.6, 1, 0.2,
0.3, 0.2, 2), 3, 3)
The truncation region is the set of Y
s such that AY >= 0
. For instance,
A <- matrix(c(1, -2, -0.5, 1.5, -2, 0, 3, -1, -1, 4, 0, -2), byrow = TRUE, nrow = 4)
> A
[,1] [,2] [,3]
[1,] 1.0 -2 -0.5
[2,] 1.5 -2 0.0
[3,] 3.0 -1 -1.0
[4,] 4.0 0 -2.0
For the following draw of Y
, it does not satisfy AY >= 0
:
set.seed(3)
Y <- rmvnorm(n = 1, mean = mu, sigma = sigma)
> all(A %*% as.matrix(t(Y)) >= 0)
[1] FALSE
But for other draws of Y
, they will satisfy AY >= 0
, and I want to find the mean and covariance of those Y
s that satisfy AY >= 0
.
There are existing packages in R that compute the mean and covariance of a truncated normal distribution. For example, mtmvnorm
from the tmvtnorm
package:
library(tmvtnorm)
mtmvnorm(mu, sigma, lower = ???, upper = ???)
However, the truncation set that I have, i.e, set of Y
s that satisfy AY >= 0
, cannot be described by just lower
and upper
bounds. Is there another way to R to compute the mean and covariance of a truncated normal?