R/test_singularity.R

Defines functions test_singularity

test_singularity <- function(x, tol) {
  # Initialize return value to FALSE
  singular <- FALSE

  # Get eigen values
  e_value <- eigen(x, symmetric = TRUE, only.values = TRUE)$values
  if (any(e_value < tol)) { singular <- TRUE }

  return(singular)
}
carolyner/imabc documentation built on March 28, 2023, 6:43 a.m.