| geigen_cov | R Documentation |
Maximises v'Cv subject to v'Rv = 1 and the additional
constraint that v lies in the retained range of R. Successive
components are R-orthogonal. If P is the orthogonal projector
onto that range, the returned vectors satisfy
P C v = \lambda R v and V'RV = I. For a full-rank R this is
the usual equation C v = \lambda R v. It also holds for a singular
R when C maps its retained range into itself. Otherwise the component
of C v outside the retained range need not vanish.
geigen_cov(
C,
R = NULL,
ncomp = NULL,
constraints_remedy = c("error", "ridge", "clip", "identity"),
rank_rtol = 1e-06,
metric_rtol = .metric_rtol_default(),
verbose = FALSE
)
C |
A p x p symmetric matrix. Asymmetry beyond roundoff is an error;
an indefinite |
R |
Variable-side constraint/metric. Can be:
|
ncomp |
Number of components to return. Default is all positive eigenvalues. |
constraints_remedy |
What to do with an indefinite |
rank_rtol |
Relative cutoff for component acceptance on the
singular-value scale (components with |
metric_rtol |
Relative tolerance for validating |
verbose |
Logical. If TRUE, print progress messages. Default FALSE. |
This is a different estimator from the GMD of genpca_cov,
which uses R^{1/2} C R^{1/2}. If C and R commute, their common
eigenvectors can be ordered differently: the GMD weights variances by
metric eigenvalues, whereas this estimator divides by them. With
R = c * I, the directions and their ordering agree, but the eigenvalue
scales differ unless c = 1.
C is validated for symmetry but may be indefinite (the generalized
eigenproblem is still defined); a warning is issued when its minimum
eigenvalue is below -metric_rtol * scale. R must be positive
semi-definite; an indefinite R is subject to constraints_remedy.
A plain list with the same components as genpca_cov
(v, d, lambda, k, propv, cumv, R_rank) and
method = "geigen". propv is relative to
\mathrm{tr}(R^{-1/2} C R^{-1/2}) on the range of R.
genpca_cov
C <- cov(scale(iris[,1:4], center=TRUE, scale=FALSE))
w <- c(1, 1, 0.5, 2)
fit_gmd <- genpca_cov(C, R = w, ncomp = 2)
fit_geigen <- geigen_cov(C, R = w, ncomp = 2)
# different estimators: the singular values generally differ
rbind(gmd = fit_gmd$d, geigen = fit_geigen$d)
# With singular R, the equation is projected onto its retained range
C <- matrix(c(2, 1, 1, 2), 2)
R <- diag(c(1, 0))
fit <- geigen_cov(C, R, ncomp = 1)
P <- diag(c(1, 0))
P %*% C %*% fit$v - (R %*% fit$v) * fit$lambda
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.