VXXa: "Bias-corrected" eigenvalue dispersion indices

VXXaR Documentation

“Bias-corrected” eigenvalue dispersion indices

Description

These functions calculate bias-corrected or adjusted eigenvalue dispersion indices

VESa: bias-corrected eigenvalue variance of covariance matrix

VRSa: adjusted relative eigenvalue variance of covariance matrix

VRRa: adjusted relative eigenvalue variance of correlation matrix

Usage

VESa(
  X,
  S,
  L,
  n,
  divisor = c("UB", "ML"),
  m = switch(divisor, UB = N - 1, ML = N),
  center = TRUE,
  nv = 0,
  check = TRUE,
  ...
)

VRSa(
  X,
  S,
  L,
  n,
  divisor = c("UB", "ML"),
  m = switch(divisor, UB = N - 1, ML = N),
  center = TRUE,
  nv = 0,
  check = TRUE,
  ...
)

VRRa(X, S, L, n, center = TRUE, nv = 0, check = TRUE, ...)

Arguments

X

Data matrix from which covariance/corrrelation matrix is obtained

S

Covariance/correlation matrix

L

Vector of eigenvalues

n

Degrees of freedom in a length-1 numeric. Ignored with warning when X is provided; required otherwise (see Details).

divisor, m

These are as in VE and influence eigenvalue magnitude (and hence uncorrected eigenvalue variance) of covariance matrices. However, note that the adjusted indices are independent of the choice of divisor and hence are unaffected by these arguments.

center

Logical to specify whether sample-mean-centering should be done

nv

Numeric to specify how many eigenvectors are to be retained; default 0

check

Logical to specify whether structures of X, S, and L are checked (see Details in VE)

...

Additional arguments are internally passed to VE(). The arguments sub, drop_0, and tol can be used to specify which eigenvalues are to be involved (see VE). scale. does not take effect, as the choice is already implied when these functions are used.

Details

These functions are to be used with sample data matrix, covariance/correlation matrix, or eigenvalues, and not to be used with population quantities. Unless X is provided, the degrees of freedom n should be specified as this is required for adjustment. When X is provided, n is automatically set to be nrow(X) - as.numeric(center).

These functions internally call VE(L = L, nv = 0, check = FALSE, ...) with appropriately constructed (or user-specified) L, and adjusted eigenvalue dispersion indices are appended to the outcome list. If nv > 0, eigenvectors are calculated before this function call and returned as well.

Bias correction is possible for eigenvalue variance of covariance matrices, but not straightforward for relative eigenvalue variance (of either covariance or correlation matrices), because the latter is a nonlinear function of the population value (see Watanabe, 2022). Although this could potentially be achievable for correlation matrices, expression for its variance is not known to the author.

The bias-corrected eigenvalue variance of a sample covariance matrix also has smaller variance than the uncorrected version. On the other hand, the adjusted relative eigenvalue variance of a sample covariance/correlation matrix has larger variance than the unadjusted version.

Value

A list similar to the output of VE(), with an additional element:

VESa()

$VESa: Bias-corrected eigenvalue variance of covariance matrix.

VRSa()

$VRSa: Adjusted relative eigenvalue variance of covariance matrix

VRRa()

$VRRa: Adjusted relative eigenvalue variance of correlation matrix

References

Watanabe, J. (2022) Statistics of eigenvalue dispersion indices: quantifying the magnitude of phenotypic integration. Evolution, 76, 4–28. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1111/evo.14382")}.

See Also

VE for the main function

Exv.VXX for expectation (bias) in the ordinary estimators

Exv.VXXa for the expectation/variance of the adjusted estimators

Examples

# Spherical covariance matrix (VE = VR = 0)
Sigma <- diag(4)
VE(S = Sigma)

N <- 20
set.seed(375)
X <- rmvn(N = N, Sigma = Sigma)
S <- cov(X)
L <- eigen(S)$values

# Bias-corrected eigenvalue variance of covariance matrix
VESa(X = X)
VESa(S = S, n = N - 1)$VESa # Same, but n is required
VESa(L = L, n = N - 1)$VESa # Same
# Note the overestimation in VE and VR,
# and (slightly) better performance of VESa
# (although it does not always work this well)

# Adjusted relative eigenvalue variance of covariance matrix
VRSa(X = X)$VRSa

# Population value for the correlation matrix (same to Sigma in this case)
VE(S = stats::cov2cor(Sigma))

# Adjusted relative eigenvalue variance of correlation matrix
VRRa(X = X)


# Covariance/correlation matrix with strong covariation (VR = 0.8)
(Sigma2 <- GenCov(p = 4, VR = 0.8, evectors = "Givens"))
VE(S = Sigma2)

N <- 20
X2 <- rmvn(N = N, Sigma = Sigma2)

VESa(X = X2)
# This is on average better than the un-corrected version

VRSa(X = X2)
VRRa(X = X2)
# But these are slightly worse (as expected)


watanabe-j/eigvaldisp documentation built on Dec. 8, 2023, 4:38 a.m.