cm2ca {covKCD} | R Documentation |
Reshape a covariance matrix to a covariance array.
cm2ca(S, p1, p2)
S |
a covariance matrix of dimension (p1p2)*(p1p2). |
p1 |
the row dimension. |
p2 |
the column dimension. |
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.
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))