Learn R Programming

PEIP (version 2.0-1)

ginv: Get inverse

Description

Get inverse of matrisx or solve Ax=b.

Usage

ginv(G, x, tol = 1e-12)

Arguments

G

Design Matrix

x

right hand side

tol

tolerance

Value

inverse as a N by 1 matrix.

Details

This function used as alternative to matlab code that does this h = G\x to get the inverse

See Also

solve, Ainv

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 = ginv(GAB, rhs, tol = 1e-12)
tout - truex 

# }

Run the code above in your browser using DataLab