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)
}

Try the mpower package in your browser

Any scripts or data that you put into this service are public.

mpower documentation built on Sept. 21, 2022, 9:13 a.m.