covKCD {covKCD} | R Documentation |
Kronecker-core covariance decomposition
Description
Computes the Kronecker-core decomposition of a covariance matrix.
Usage
covKCD(S, p1, p2, tol = 1e-08)
Arguments
S |
a covariance matrix of dimension (p1p2)*(p1p2). |
p1 |
the row dimension. |
p2 |
the column dimension. |
tol |
the convergence tolerance of the iterative algorithm. |
Details
The Kronecker-core decomposition is a representation of an arbitrary covariance matrix S in terms of a separable Kronecker covariance matrix K and a complementary non-separable core covariance matrix C. The Kronecker covariance is the separable covariance matrix that is closest to S in terms of the divergence function
\log|K| + \mbox{trace}(K^{-1}S).
The core covariance matrix C is computed from S and K via
C = K^{-1/2} S K^{-1/2}.
Value
covKCD
returns a list with the following elements:
- K
the Kronecker covariance matrix;
- C
the core covariance matrix;
- K1
the row covariance matrix;
- K2
the column covariance matrix;
- div
the divergence between
S
andK
across iterations of the algorithm.
Author(s)
Peter Hoff
Examples
p1<-4 ; p2<-3 ; n<-200
# create a matrix Y with separable covariance
A<-matrix(rnorm(p1*p1),p1,p1)
B<-matrix(rnorm(p2*p2),p2,p2)/3
Y<-array(rnorm(n*p1*p2),dim=c(n,p1,p2))
Y<-aperm( apply(Y,c(1,3),function(y){ A%*%y } ),c(2,1,3))
Y<-aperm( apply(Y,c(1,2),function(y){ B%*%y } ),c(2,3,1))
# covariance
S<-mcov(Y)
KCD<-covKCD(S,p1,p2)
plot(A%*%t(A), KCD$K1)
plot(B%*%t(B), KCD$K2)