R/helpers.R

Defines functions is_positive_definite

# Using cholesky decomp to check if symmetric matrix S is positive.definite
is_positive_definite <- function(S) {
    tryCatch({
        L <- chol(S)
        TRUE
    }, error = function(e) FALSE)
}
phuchonguyen/mpower documentation built on Oct. 2, 2022, 7:57 p.m.