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

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to