R/my.positive.definite.solve.R

my.positive.definite.solve <- function(A, eps = 1e-15 ) {
  h <- eigen(A,symmetric=TRUE)
  ind <-  (1:(dim(A))[1])[h$values >= eps]
  return( ( h$vectors[,ind] %*% diag(1/h$values[ind],length(ind)) %*% t( h$vectors[,ind])))
}

Try the pendensity package in your browser

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

pendensity documentation built on May 2, 2019, 3:58 a.m.