R/is.pos.def.R

####################################
#This function checks whether a    #
#given matrix is positive definite #
####################################

is.pos.def <- function(mat)
 {
 val = try(chol(mat), silent = TRUE)
 if (class(val) == "try-error") 
 return(FALSE)
 else return(TRUE)
 }

Try the B2Z package in your browser

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

B2Z documentation built on May 2, 2019, 6:33 a.m.