Learn R Programming

nlr (version 0.1-3)

indifinv: Indefinite Inverse of matrix.

Description

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

Usage

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

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.

Details

eiginv function compute the inverse of matrix using spectoral decomposition $$ A_{k \times k}=\textbf{P} \Lambda \textbf{P}' $$ where $$ \textbf{P}=[e_1,\dots,e_k] $$ $$ \Lambda=diag(\lambda_i) $$ in which \(\lambda_i\) is eigenvalues of matrix A coresponding to eigenvector \(e_i\). Then the inverse is: $$ A^{-1}=\textbf{P} \Lambda^{-1} \textbf{P}' $$

References

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

See Also

eiginv

Examples

Run this code
# NOT RUN {
 a1=matrix(c(1,2,3,4,5,6,7,8,9),nrow=3)
 indifinv(a1)
# }

Run the code above in your browser using DataLab