Learn R Programming

evolqg (version 0.3-4)

KrzProjection: Compare matrices via Modified Krzanowski Correlation

Description

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.

Usage

KrzProjection(cov.x, cov.y, ...)

# S3 method for default KrzProjection(cov.x, cov.y, ret.dim.1 = NULL, ret.dim.2 = NULL, ...)

# S3 method for list KrzProjection( cov.x, cov.y = NULL, ret.dim.1 = NULL, ret.dim.2 = NULL, parallel = FALSE, full.results = FALSE, ... )

Value

Ratio of projected variance to total variance, and ratio of projected total in each PC

Arguments

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.

Author

Diogo Melo, Guilherme Garcia

References

Krzanowski, W. J. (1979). Between-Groups Comparison of Principal Components. Journal of the American Statistical Association, 74(367), 703. doi:10.2307/2286995

See Also

RandomSkewers,MantelCor

Examples

Run this code
c1 <- RandomMatrix(10)
c2 <- RandomMatrix(10)
KrzProjection(c1, c2)

# \donttest{
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)
# }
if (FALSE) {
#Multiple threads can be used with some foreach backend library, like doMC or doParallel
library(doMC)
registerDoMC(cores = 2)
KrzProjection(m.list, parallel = TRUE)
}

Run the code above in your browser using DataLab