Learn R Programming

optR (version 1.2.5)

inv.optR: Invert a matrix using LU decomposition

Description

function invert a matrix A using LU decomposition such that A*inv(A)=I

Usage

inv.optR(A, tol = 1e-07)

Arguments

A
: Input matrix
tol
: tolerance

Value

A : Inverse of Matrix A

Examples

Run this code
# Invert the matrix using LU decomposition
A<-matrix(c(0.6,-0.4,1, -0.3,0.2,0.5,0.6,-1,0.5), nrow=3,ncol=3, byrow = TRUE) 
InvA<-inv.optR(A)

Run the code above in your browser using DataLab