Learn R Programming

EigenR (version 1.2.3)

Eigen_UtDU: 'UtDU' decomposition of a matrix

Description

Cholesky-'UtDU' decomposition of a symmetric or Hermitian matrix.

Usage

Eigen_UtDU(M)

Arguments

M

a square symmetric/Hermitian positive or negative semidefinite matrix, real/complex

Value

The Cholesky-'UtDU' decomposition of M in a list (see example).

Details

Symmetry is not checked; only the lower triangular part of M is used.

Examples

Run this code
# NOT RUN {
x <- matrix(c(1:5, (1:5)^2), 5, 2)
x <- cbind(x, x[, 1] + 3*x[, 2])
M <- crossprod(x)
UtDU <- Eigen_UtDU(M)
U <- UtDU$U
D <- UtDU$D
perm <- UtDU$perm
UP <- U[, perm]
t(UP) %*% diag(D) %*% UP # this is `M`
# }

Run the code above in your browser using DataLab