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.


matherealize/simdata documentation built on Dec. 5, 2024, 4:17 a.m.