VXXa | R Documentation |
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
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, ...)
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
|
divisor, m |
These are as in |
center |
Logical to specify whether sample-mean-centering should be done |
nv |
Numeric to specify how many eigenvectors are to be retained;
default |
check |
Logical to specify whether structures of X, S, and L are checked
(see Details in |
... |
Additional arguments are internally passed to |
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.
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
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")}.
VE
for the main function
Exv.VXX
for expectation (bias) in the ordinary estimators
Exv.VXXa
for the expectation/variance of
the adjusted estimators
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.