x <- cov(matrix(rnorm(100), nrow=10, ncol=10))
is.posi_def(x) #FALSE
is.posi_def(x, semi=TRUE) #TRUE
Xnew <- is.posi_def(x, semi=FALSE, make=TRUE)$X.new
identical(x, Xnew) #FALSE
identical(x, is.posi_def(x, semi=TRUE, make=TRUE)$X.new) #TRUE
Run the code above in your browser using DataLab