is_cor_matrix: Check if matrix is a correlation matrix

View source: R/utilities.R

is_cor_matrixR 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.


simdata documentation built on April 4, 2025, 12:50 a.m.