[R] Singular matrix

From: Marc Bernard <bernarduse1_at_yahoo.fr>
Date: Thu 06 Oct 2005 - 23:11:09 EST


Dear All,  

I have written the following programs to find a non-singular (10*10) covariance matrix. Here is the program:  

nitems <- 10

x <- array(rnorm(5*nitems,3,3), c(5,nitems))

sigma <- t(x)%*%x

inverse <- try(solve(sigma), TRUE)  

while(inherits(inverse, "try-error"))

{

x <- array(rnorm(5*nitems,3,3), c(5,nitems))

sigma <- t(x)%*%x

inverse <- try(solve(sigma), TRUE)

}  

The loop doesn't stop ... This means that no "non-singular" matrix was found!!!

some thing wrong !!  

Thanks a lot for any reply  

Bernard                       


        [[alternative HTML version deleted]]



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Thu Oct 06 23:16:02 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:40:38 EST