ginv: Get inverse

Description Usage Arguments Details Value Note Author(s) See Also Examples

View source: R/ginv.R

Description

Get inverse of matrisx or solve Ax=b.

Usage

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

Arguments

G

Design Matrix

x

right hand side

tol

tolerance

Details

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

Value

inverse as a N by 1 matrix.

Note

Be careful about the usage of tolerance

Author(s)

Jonathan M. Lees<[email protected]>

See Also

solve, Ainv

Examples

1
2
3
4
5
6
7
8
9
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 

PEIP documentation built on Jan. 20, 2018, 9:03 a.m.