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

Try the imabc package in your browser

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

imabc documentation built on April 12, 2021, 9:06 a.m.