pdsDeterminant {bbricks}R Documentation

determinant of a positive definite symmetric matrix

Description

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

Usage

pdsDeterminant(S, LOG = FALSE)

Arguments

S

a symmetric positive definitive matrix.

LOG

logical, return log(det(S)) if TRUE, return det(S) if FALSE, default FALSE.

Value

A matrix, the determinant of "S".

Examples

Sigma = matrix(c(1.3,1,1,2),2,2)      # some positive definite symmetric matrix
pdsDeterminant(Sigma)                 # get inv(Sigma)
pdsDeterminant(Sigma,LOG=TRUE)        # 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]