adlift (version 1.3-3)

Rmatsolve: Rmatsolve

Description

This function calculates matrix inverses for symmetric matrices.

Usage

Rmatsolve(m)

Arguments

m

a (symmetric) matrix.

Value

inv

the matrix inverse of m.

Details

This function uses the eigenvalue decomposition of a matrix m to work out its inverse. The function is used here since standard matrix inverse algorithms do not cope well with matrices which are near singular (this often happens in the regression stages of the forward transforms.

Examples

Run this code
# NOT RUN {
#
#create a 4x4 matrix
m<-matrix(runif(16),4,4)

temp<-crossprod(m)

#i.e. temp is t(m)%*%m

inv<-Rmatsolve(temp)

# }

Run the code above in your browser using DataCamp Workspace