Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

evaluateS

Evaluate numerical properties square matrix


Description

Function that evaluates various numerical properties of a square input matrix. The intended use is to evaluate the various numerical properties of what is assumed to be a covariance matrix. Another use is to evaluate the various numerical properties of a (regularized) precision matrix.

Usage

evaluateS(S, verbose = TRUE)

Arguments

S

Covariance or (regularized) precision matrix.

verbose

A logical indicating if output should be printed on screen.

Details

The function evaluates various numerical properties of a covariance or precision input matrix. The function assesses if the input matrix is symmetric, if all its eigenvalues are real, if all its eigenvalues are strictly positive, and if it is a diagonally dominant matrix. In addition, the function calculates the trace, the determinant, and the spectral condition number of the input matrix. See, e.g., Harville (1997) for more details on the mentioned (numerical) matrix properties.

Value

symm

A logical indicating if the matrix is symmetric.

realEigen

A logical indicating if the eigenvalues are real.

posEigen

A logical indicating if the eigenvalues are strictly positive.

dd

A logical indicating if the matrix is diagonally dominant.

trace

A numerical giving the value of the trace.

det

A numerical giving the value of the determinant.

condNumber

A numerical giving the value of the spectral condition number.

Author(s)

Wessel N. van Wieringen, Carel F.W. Peeters <cf.peeters@vumc.nl>

References

Harville, D.A.(1997). Matrix algebra from a statistician's perspective. New York: Springer-Verlag.

See Also

Examples

## Obtain some (high-dimensional) data
p = 25
n = 10
set.seed(333)
X = matrix(rnorm(n*p), nrow = n, ncol = p)
colnames(X)[1:25] = letters[1:25]
Cx <- covML(X)

## Evaluate numerical properties covariance matrix
## Obtain, e.g., value trace
Seval <- evaluateS(Cx); Seval
Seval$trace

## Evaluate numerical properties precision matrix after regularization
P <- ridgeP(Cx, lambda = 10, type = 'Alt')
Peval <- evaluateS(P); Peval

rags2ridges

Ridge Estimation of Precision Matrices from High-Dimensional Data

v2.2.4
GPL (>= 2)
Authors
Carel F.W. Peeters [cre, aut], Anders Ellern Bilgrau [aut], Wessel N. van Wieringen [aut]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.