Learn R Programming

PEIP (version 2.0-1)

Ainv: An Inverse Solution

Description

QR decomposition solution to Ax=b

Usage

Ainv(GAB, x, tol = 1e-12)

Arguments

GAB

design matrix

x

right hand side

tol

tolerance for singularity

Value

Inverse Solution

Details

I needed something to make up for the lame-o matlab code that does this h = G\x to get the inverse

Examples

Run this code
# NOT RUN {
set.seed(2015)
GAB = matrix(runif(36), ncol=6)
truex =rnorm(ncol(GAB))
rhs = GAB %*% truex

rhs = as.vector(rhs )

tout = Ainv(GAB, rhs, tol = 1e-12)
tout - truex 

# }

Run the code above in your browser using DataLab