m <- matrix(nrow=5, ncol=5) m <- ifelse(row(m)==col(m), 1, 0.2) c <- chol(m) # Choleski decomposition u <- matrix(rnorm(2000*5), ncol=5) uc <- u %*% c cr <- pnorm(uc) cr <- qbinom(cr,1,0.5) cor(cr) I expected that the cor(cr) to be 0.2 as i set in m, but the result is around 0.1. Why is that? Thanks -- View this message in context: http://r.789695.n4.nabble.com/Choleski-decomposition-tp4651475.html Sent from the R help mailing list archive at Nabble.com.
On Nov 30, 2012, at 10:34 AM, jaybell wrote:> m <- matrix(nrow=5, ncol=5) > m <- ifelse(row(m)==col(m), 1, 0.2) > c <- chol(m) # Choleski decomposition > u <- matrix(rnorm(2000*5), ncol=5) > uc <- u %*% c > cr <- pnorm(uc) > cr <- qbinom(cr,1,0.5) > cor(cr) > I expected that the cor(cr) to be 0.2 as i set in m, but the result is > around 0.1. > Why is that? ThanksCross-posting to rhelp and Stackoverflow is deprecated (at least on Rhelp). If you didn't get effective advice after a reasonable interval (measured in days) it would make sense to look elsewhere. But this is essentially a statistics questions rather than a coding question and you were advised on SO to post the question on a website that is designed for statistics questions. Rhelp is not that site. -- David Winsemius, MD Alameda, CA, USA
Apparently Analagous Threads
- qbinom
- R: Re: chol( neg.def.matrix ) WAS: Re: Choleski and Choleski with pivoting of matrix fails
- R: Re: R: Re: chol( neg.def.matrix ) WAS: Re: Choleski and Choleski with pivoting of matrix fails
- Cholesky Decomposition
- R: RE: R: Re: R: Re: chol( neg.def.matrix ) WAS: Re: Choleski and Choleski with pivoting of matrix fails