[R] Linear transformation of multivariate normal

Dmitry Pavlyuk
2014-01-03T13:29:06Z

Hello, Colleges!

I'm having a problem with illustration of linear transformation of
multivariate gaussian RV using R.
According to the theory, if X ~ N(0, I), then CX ~ N(0,CC').
But the code below doesn't illustrate this. Please could you help me to
find a mistake

> require(tmvtnorm)
> C = matrix(c(2,0,1,1), 2,2)
> x = c(1,2)
> pmvnorm(lower=rep(-Inf,2),upper=x, sigma=diag(2))
[1] 0.822204
attr(,"error")
[1] 1e-15
attr(,"msg")
[1] "Normal Completion"
> pmvnorm(lower=rep(-Inf,2),upper=as.vector(C%*%x), sigma=C %*% t(C))
[1] 0.9452332
attr(,"error")
[1] 1e-15
attr(,"msg")
[1] "Normal Completion"

Dmitry