Learn R Programming

fBasics (version 4021.93)

inv: The inverse of a matrix

Description

Returns the inverse of a matrix.

Usage

inv(x)

Value

the inverse matrix.

Arguments

x

a numeric matrix.

References

Golub, van Loan, (1996); Matrix Computations, 3rd edition. Johns Hopkins University Press.

Examples

Run this code
## Create Pascal Matrix:
   P = pascal(5)
   P
         
## Compute the Inverse Matrix:
   inv(P)
   
## Check:
   inv(P) %*% P    
   
## Alternatives:
   chol2inv(chol(P))
   solve(P)                     

Run the code above in your browser using DataLab