[R] Random Matrix theory

Spencer Graves spencer.graves at pdf.com
Sat Feb 12 04:05:01 CET 2005


      What kind of random matrices?  The following will produce a random 
orthogonal matrix.  I'm not certain of its distribution, but I think 
it's likely uniform:  I generate a matrix from rnorm(.., sd) and compute 
its singular value decomposition.  I think I saw someplace that the 
result should be essentially a random orthogonal matrix, but I'm not 
sure of that. 

rortho <- function(k=3, sd=100){
  a <- array(rnorm(k^2, sd=sd), dim=c(k,k))
  s1 <-  sample(c(-1,1), 3, replace=TRUE)
  s2 <-  sample(c(-1,1), 3, replace=TRUE)
  (s1*rep(s2, each=3)*svd(a)$u)
}

      hope this helps. 
      spencer graves

T. Murlidharan Nair wrote:

> Any package that implements Random matrix theory  application in R.
> I am completely new to this subject, so just wanted to explore it.
> Cheers ../Murli
>
> ______________________________________________
> R-help at 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




More information about the R-help mailing list