Stan Math Library
5.0.0
Automatic Differentiation
|
void stan::math::check_corr_matrix | ( | const char * | function, |
const char * | name, | ||
const StdVec & | y | ||
) |
Throw an exception if the specified matrix is not a valid correlation matrix.
A valid correlation matrix is symmetric positive definite, has a unit diagonal (all 1 values), and has all values between -1 and 1 (inclusive).
StdVec | A standard vector with inner type either inheriting from Eigen::MatrixBase with neither rows or columns defined at compile time to be equal to 1 or a var_value with the var's inner type inheriting from Eigen::MatrixBase with neither rows or columns defined at compile time to be equal to 1. |
function | Name of the function this was called from |
name | Name of the variable |
y | Matrix to test |
`std::invalid_argument` | if the matrix is not square |
`std::domain_error` | if the matrix is non-symmetric, diagonals not near 1, not positive definite, or any of the elements are NaN |
Definition at line 76 of file check_corr_matrix.hpp.