Learn R Programming

fBasics (version 4041.97)

inv: The inverse of a matrix

Description

Computes the inverse of a matrix.

Usage

inv(x)

Value

a 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