Eigen_pinverse {EigenR}R Documentation

Pseudo-inverse of a matrix

Description

Pseudo-inverse of a real or complex matrix (Moore-Penrose generalized inverse).

Usage

Eigen_pinverse(M)

Arguments

M

a matrix, real or complex, not necessarily square

Value

The pseudo-inverse matrix of M.

Examples

library(EigenR)
M <- rbind(
  toeplitz(c(3, 2, 1)), 
  toeplitz(c(4, 5, 6))
)
Mplus <- Eigen_pinverse(M)
all.equal(M, M %*% Mplus %*% M)
all.equal(Mplus, Mplus %*% M %*% Mplus)
#' a complex matrix
A <- M + 1i * M[, c(3L, 2L, 1L)]
Aplus <- Eigen_pinverse(A)
AAplus <- A %*% Aplus
all.equal(AAplus, t(Conj(AAplus))) #' `A %*% Aplus` is Hermitian
AplusA <- Aplus %*% A
all.equal(AplusA, t(Conj(AplusA))) #' `Aplus %*% A` is Hermitian

[Package EigenR version 1.3.0 Index]