Function validate_correlation_matrix
Source pub fn validate_correlation_matrix(matrix: &DMatrix<f64>) -> Result<()>
Expand description
Check if a matrix is a valid correlation matrix.
A valid correlation matrix must be:
- Square
- Symmetric
- Have unit diagonal
- Be positive semi-definite
- Have only finite entries
§Arguments
matrix - Matrix to validate
§Returns
Ok(()) if valid, error otherwise.