tolerance_eigen: 'tolerance_eigen': An eigenvalue decomposition to truncate...

Description Usage Arguments Value Author(s) See Also Examples

View source: R/tolerance_eigen.R

Description

tolerance_eigen eliminates likely spurious components: any eigenvalue (squared singular value) below a tolerance level is elminated. The (likely) spurious eigen values and vectors are then eliminated from $vectors and $values. The use of a real positive value for tol will eliminate any small valued components. With tol, tolerance_eigen will stop if any singular values are complex or negative.

Usage

1
tolerance_eigen(x, tol = sqrt(.Machine$double.eps), ...)

Arguments

x

A data matrix of size for input to the eigen value decomposition (eigen)

tol

Default is sqrt(.Machine$double.eps). A tolerance level for eliminating near machine precision components. Use of this parameter causes tolerance_eigen to stop if negative or complex eigen values are detected. The use of tol < 0, NA, NaN, Inf, -Inf, or NULL passes through to eigen.

...

Further arguments to eigen. See eigen.

Value

A list with two elements (like eigen):

values

A vector containing the eigen values of x > tol.

vectors

A matrix whose columns contain the right singular vectors of x, present if nv > 0. Dimension min(c(ncol(x), nv, length(d)).

Author(s)

Derek Beaton

See Also

eigen

Examples

1
2
3
4
5
 data(wine)
 cor_X <- cor(as.matrix(wine$objective))
 s_asis <- tolerance_eigen(cor_X)
 s_.Machine <- tolerance_eigen(cor_X, tol=.Machine$double.eps)
 s_000001 <- tolerance_eigen(cor_X, tol=.000001)

derekbeaton/GSVD documentation built on Jan. 2, 2021, 9:21 p.m.