Learn R Programming

TRSbook (version 1.0.4)

mpinv: Moore Penrose inverse

Description

Computes the Moore Penrose inverse of a matrix

Usage

mpinv(M,eps=1e-13)

Value

The Moore-Penrose inverse of M

Arguments

M

a matrix

eps

real precision

Author

Lafaye de Micheaux Pierre <lafaye@unsw.edu.au>, Remy Drouilhet <Remy.Drouilhet@upmf-grenoble.fr>, Liquet Benoit <b.liquet@uq.edu.au>

References

Chapter 10 (Basic Mathematics: Matrix Operations, Integration, and Optimization) from the book: The R Software, Fundamentals of Programming and Statistical Analysis

Examples

Run this code
A <- matrix(c(2,3,5,4),nrow=2,ncol=2)
solve(A)
mpinv(A)
B <- matrix(c(4,2,8,4),nrow=2,ncol=2)
# solve(B) # gives an error.
mpinv(B)

Run the code above in your browser using DataLab