is_pos_def: Check a Matrix is Positive Definite

View source: R/cormat.R

is_pos_defR Documentation

Check a Matrix is Positive Definite

Description

is_pos_def makes a correlation matrix from a vector

Usage

is_pos_def(cor_mat, tol = 1e-08)

Arguments

cor_mat

a correlation matrix

tol

the tolerance for comparing eigenvalues to 0

Value

logical value

Examples

is_pos_def(matrix(c(1, .5, .5, 1), 2)) # returns TRUE
is_pos_def(matrix(c(1, .9, .9, 
                   .9, 1, -.2, 
                   .9, -.2, 1), 3)) # returns FALSE

faux documentation built on April 20, 2023, 9:13 a.m.