Inverse: Inverse of a Matrix

Description Usage Arguments Details Value Author(s) Examples

View source: R/gaussian-elimination.R

Description

Uses gaussianElimination to find the inverse of a square, non-singular matrix, X.

Usage

1
Inverse(X, tol = sqrt(.Machine$double.eps), ...)

Arguments

X

a square numeric matrix

tol

tolerance for checking for 0 pivot

...

other arguments passed on

Details

The method is purely didactic: The identity matrix, I, is appended to X, giving X | I. Applying Gaussian elimination gives I | X^{-1}, and the portion corresponding to X^{-1} is returned.

Value

the inverse of X

Author(s)

John Fox

Examples

1
2
3
4
5
  A <- matrix(c(2, 1, -1,
               -3, -1, 2,
               -2,  1, 2), 3, 3, byrow=TRUE)
  Inverse(A)
  Inverse(A, verbose=TRUE, fractions=TRUE)

matlib documentation built on April 4, 2018, 5:03 p.m.