pdsInverse {bbricks}R Documentation

Inverse of a positive definite symmetric matrix

Description

Use Cholesky decomposition to calculate the inverse of S, where S = A'A, A is a upper diagonal matrix. inv(S) = inv(A)inv(A)'.

Usage

pdsInverse(S, returnUpper = FALSE)

Arguments

S

a symmetric positive definitive matrix.

returnUpper

logical, return inv(A) if returnUpper=TRUE,return inv(S) if returnUpper=FALSE, default FALSE.

Value

A matrix, the inverse of "S".

Examples

Sigma = matrix(c(2,1,1,2),2,2)      # some positive definite symmetric matrix
pdsInverse(Sigma)                   # get inv(Sigma)
pdsInverse(Sigma,returnUpper=TRUE)  # get inv(A), where Sigma=A'A, A is upper triangle

[Package bbricks version 0.1.4 Index]