Compare matrices via Modified Krzanowski Correlation
Compare matrices via Modified Krzanowski Correlation
Calculates the modified Krzanowski correlation between matrices, projecting the variance in each principal components of the first matrix in to the ret.dim.2 components of the second matrix.
cov.x: Single covariance matrix ou list of covariance matrices. If cov.x is a single matrix is supplied, it is compared to cov.y. If cov.x is a list of matrices is supplied and no cov.y is supplied, all matrices are compared between each other. If cov.x is a list of matrices and a single cov.y matrix is supplied, all matrices in list are compared to it.
cov.y: First argument is compared to cov.y. If cov.x is a list, every element in cov.x is projected in cov.y.
...: additional arguments passed to other methods
ret.dim.1: number of retained dimensions for first matrix in comparison, default for nxn matrix is n/2-1
ret.dim.2: number of retained dimensions for second matrix in comparison, default for nxn matrix is n/2-1
parallel: if TRUE computations are done in parallel. Some foreach back-end must be registered, like doParallel or doMC.
full.results: if FALSE returns only total variance, if TRUE also per PC variance.
Returns
Ratio of projected variance to total variance, and ratio of projected total in each PC
Examples
c1 <- RandomMatrix(10)c2 <- RandomMatrix(10)KrzProjection(c1, c2)m.list <- RandomMatrix(10,3)KrzProjection(m.list)KrzProjection(m.list, full.results =TRUE)KrzProjection(m.list, ret.dim.1=5, ret.dim.2=4)KrzProjection(m.list, ret.dim.1=4, ret.dim.2=5)KrzProjection(m.list, c1)KrzProjection(m.list, c1, full.results =TRUE)## Not run:#Multiple threads can be used with some foreach backend library, like doMC or doParallellibrary(doMC)registerDoMC(cores =2)KrzProjection(m.list, parallel =TRUE)## End(Not run)
References
Krzanowski, W. J. (1979). Between-Groups Comparison of Principal Components. Journal of the American Statistical Association, 74(367), 703. doi:10.2307/2286995