powered by
Reshape a covariance matrix to a covariance array.
cm2ca(S, p1, p2)
a four-way array where entry i1,j1,i2,j2 gives the covariance between element i1,j1 and element i2,j2 of a random matrix.
a covariance matrix of dimension (p1p2)*(p1p2).
the row dimension.
the column dimension.
Peter Hoff
p1<-4 ; p2<-7 ; p<-p1*p2 S<-rWishart(1,p,diag(p))[,,1] A<-cm2ca(S,p1,p2) range(S-ca2cm(A))
Run the code above in your browser using DataLab