is_cor_matrix {simdata} | R Documentation |
Check if matrix is a correlation matrix
Description
Checks if matrix is numeric, symmetric, has diagonal elements of one,
has only entries in [-1, 1]
, and is positive definite. Prints a warning
if a problem was found.
Usage
is_cor_matrix(m, tol = 1e-09)
Arguments
m |
Matrix. |
tol |
Tolerance for checking diagonal elements. |
Value
TRUE
if matrix is a correlation matrix, else FALSE
.
[Package simdata version 0.4.0 Index]