relative.eigen {vcvComp} | R Documentation |
Relative eigenanalysis
Description
Computes the Riemanian distance between two variance-covariance matrices of same dimensions and the relative eigenvectors and eigenvalues of S1 with respect to S2
Usage
relative.eigen(S1, S2, method = 0, pa = 0)
Arguments
S1 |
a variance-covariance matrix |
S2 |
a variance-covariance matrix |
method |
an integer for the method of matrix inversion (see function 'minv') |
pa |
an integer for the parameter of matrix inversion (see function 'minv') |
Value
A list containing the following named components:
relValues |
the vector of relative eigenvalues |
relVectors |
the matrix of relative eigenvectors |
distCov |
the distance between the two covariance matrices |
relGV |
the product of the nonzero relative eigenvalues = the ratio of the generalized variances. The generalized variance corresponds to the determinant of the covariance matrix. |
logGV |
the log ratio of the generalized variances |
q |
the number of nonzero eigenvalues |
References
Bookstein F, Mitteroecker P (2014) Comparing covariance matrices by relative eigenanalysis, with applications to organismal biology. Evolutionary Biology 41: 336-350. https://doi.org/10.1007/s11692-013-9260-5
See Also
See minv
for the method and the parameter used for the matrix inversion
Examples
# Data matrix of 2D landmark coordinates
data("Tropheus.IK.coord")
coords <- which(names(Tropheus.IK.coord) == "X1"):which(names(Tropheus.IK.coord) == "Y19")
proc.coord <- as.matrix(Tropheus.IK.coord[coords])
# Data reduction
phen.pca <- prcomp(proc.coord, rank. = 5, tol = sqrt(.Machine$double.eps))
pc.scores <- phen.pca$x
# Covariance matrix of each population
S.phen.pop <- cov.group(pc.scores, groups = Tropheus.IK.coord$POP.ID)
# Relative PCA = relative eigenanalysis between 2 covariance matrices
# (population IKA1 relative to IKS5)
relEigen.a1s5 <- relative.eigen(S.phen.pop[, , "IKA1"], S.phen.pop[, , "IKS5"])