| r1 {MatrixCorrelation} | R Documentation |
Matrix similarity as described by Ramsey et al. (1984).
r1(X1, X2, center = TRUE) r2(X1, X2, center = TRUE) r3(X1, X2, center = TRUE) r4(X1, X2, center = TRUE) GCD(X1, X2, ncomp1 = Rank(X1), ncomp2 = Rank(X2), center = TRUE)
X1 |
first |
X2 |
second |
center |
|
ncomp1 |
(GCD) number of subspace components from the first |
ncomp2 |
(GCD) number of subspace components from the second |
Details can be found in Ramsey's paper:
r1: inner product correlation
r2: orientation-independent inner product correlation
r3: spectra-independent inner product correlations (including orientation)
r4: Spectra-Independent inner product Correlations
GCD: Yanai's Generalized Coefficient of Determination (GCD) Measure. To reproduce the original GCD, use all components. When X1 and X2 are dummy variables, GCD is proportional with Pillai's criterion: tr(W^-1(B+W)).
A single value measuring the similarity of two matrices.
Kristian Hovde Liland
Ramsay, JO; Berg, JT; Styan, GPH; 1984. "Matrix Correlation". Psychometrica 49(3): 403-423.
X1 <- matrix(rnorm(100*300),100,300) usv <- svd(X1) X2 <- usv$u[,-3] %*% diag(usv$d[-3]) %*% t(usv$v[,-3]) r1(X1,X2) r2(X1,X2) r3(X1,X2) r4(X1,X2) GCD(X1,X2) GCD(X1,X2, 5,5)