cm2ca {covKCD} | R Documentation |
Covariance matrix to covariance array
Description
Reshape a covariance matrix to a covariance array.
Usage
cm2ca(S, p1, p2)
Arguments
S |
a covariance matrix of dimension (p1p2)*(p1p2). |
p1 |
the row dimension. |
p2 |
the column dimension. |
Value
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.
Author(s)
Peter Hoff
Examples
p1<-4 ; p2<-7 ; p<-p1*p2
S<-rWishart(1,p,diag(p))[,,1]
A<-cm2ca(S,p1,p2)
range(S-ca2cm(A))
[Package covKCD version 0.1 Index]