indifinv: Indefinite Inverse of matrix.

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

View source: R/eiginv.R

Description

Compute the inverse of matrix using spectoral decomposition, using eigenvalues and eigen vectors of matrix.

Usage

1
indifinv(mtrx, stp = T, symmetric = all(mtrx == t(mtrx)))

Arguments

mtrx

square matrix to compute the inverse.

stp

if stp=T when error happened stop running program, if stp=F, does not stop program but return back Fault object.

symmetric

symmetric

Used for computing eigenvalues, if symmetric=T the matrix is symetric, if symmetric=F the matrix is not symetric.

Details

eiginv function compute the inverse of matrix using spectoral decomposition

A_{k \times k}=\textbf{P} Λ \textbf{P}'

where

\textbf{P}=[e_1,…,e_k]

Λ=diag(λ_i)

in which λ_i is eigenvalues of matrix A coresponding to eigenvector e_i. Then the inverse is:

A^{-1}=\textbf{P} Λ^{-1} \textbf{P}'

Value

If matrix eigenvalues are not zero return the inverse of matrix, otherwise returns Fault object with fault number=9, means the matrix is not positive definit.

Note

eiginv return back error if negative eigen values occured, means singular matrix. But indifinv raise error if infinite or null values occured. The eigenvalues decomposition is used as eiginv.

Author(s)

Hossein Riazoshams, Jan 2010. Email: riazihosein@gmail.com URL http://www.riazoshams.com/nlr/

References

Riazoshams H, Midi H, and Ghilagaber G, 2018,. Robust Nonlinear Regression, with Application using R, Joh Wiley and Sons.

See Also

eiginv

Examples

1
2
 a1=matrix(c(1,2,3,4,5,6,7,8,9),nrow=3)
 indifinv(a1)

nlr documentation built on July 31, 2019, 5:09 p.m.

Related to indifinv in nlr...