View source: R/rags2ridgesFused.R
| isSymmetricPD | R Documentation |
Function to test if a matrix is symmetric positive (semi)definite or
not.
isSymmetricPD(M)
isSymmetricPSD(M, tol = 1e-04)
M |
A square symmetric matrix. |
tol |
A numeric giving the tolerance for determining positive semi-definiteness. |
Tests positive definiteness by Cholesky decomposition. Tests positive
semi-definiteness by checking if all eigenvalues are larger than
-\epsilon|\lambda_1| where \epsilon is the tolerance and
\lambda_1 is the largest eigenvalue.
While isSymmetricPSD returns TRUE if the matrix is
symmetric positive definite and FASLE if not. In practice, it tests
if all eigenvalues are larger than -tol*|l| where l is the largest
eigenvalue. More
here.
Returns a logical value. Returns TRUE if the M
is symmetric positive (semi)definite and FALSE if not. If M
is not even symmetric, the function throws an error.
Anders Ellern Bilgrau Carel F.W. Peeters <carel.peeters@wur.nl>, Wessel N. van Wieringen
isSymmetric
A <- matrix(rnorm(25), 5, 5)
## Not run:
isSymmetricPD(A)
## End(Not run)
B <- symm(A)
isSymmetricPD(B)
C <- crossprod(B)
isSymmetricPD(C)
isSymmetricPSD(C)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.