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

eigenvalues.manymatrices

Computation of Eigenvalues of Many Symmetric Matrices


Description

This function computes the eigenvalue decomposition of N symmetric positive definite matrices. The eigenvalues are computed by the Rayleigh quotient method (Lange, 2010, p. 120). In addition, the inverse matrix can be calculated.

Usage

eigenvalues.manymatrices(Sigma.all, itermax=10, maxconv=0.001,
    inverse=FALSE )

Arguments

Sigma.all

An N \times D^2 matrix containing the D^2 entries of N symmetric matrices of dimension D \times D

itermax

Maximum number of iterations

maxconv

Convergence criterion for convergence of eigenvectors

inverse

A logical which indicates if the inverse matrix shall be calculated

Value

A list with following entries

lambda

Matrix with eigenvalues

U

An N \times D^2 Matrix of orthonormal eigenvectors

logdet

Vector of logarithm of determinants

det

Vector of determinants

Sigma.inv

Inverse matrix if inverse=TRUE.

References

Lange, K. (2010). Numerical Analysis for Statisticians. New York: Springer.

Examples

# define matrices
Sigma <- diag(1,3)
Sigma[ lower.tri(Sigma) ] <- Sigma[ upper.tri(Sigma) ] <- c(.4,.6,.8 )
Sigma1 <- Sigma

Sigma <- diag(1,3)
Sigma[ lower.tri(Sigma) ] <- Sigma[ upper.tri(Sigma) ] <- c(.2,.1,.99 )
Sigma2 <- Sigma

# collect matrices in a "super-matrix"
Sigma.all <- rbind( matrix( Sigma1, nrow=1, byrow=TRUE),
                matrix( Sigma2, nrow=1, byrow=TRUE) )
Sigma.all <- Sigma.all[ c(1,1,2,2,1 ), ]

# eigenvalue decomposition
m1 <- sirt::eigenvalues.manymatrices( Sigma.all )
m1

# eigenvalue decomposition for Sigma1
s1 <- svd(Sigma1)
s1

sirt

Supplementary Item Response Theory Models

v3.10-118
GPL (>= 2)
Authors
Alexander Robitzsch [aut,cre] (<https://orcid.org/0000-0002-8226-3132>)
Initial release
2021-09-22 17:45:34

We don't support your browser anymore

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