is_sym_pos_def: Check for positive definite matrix

Description Usage Arguments Value Examples

View source: R/is_sym_pos_def.R

Description

The function checks the numeric matrix A for symmetricity (Hermitian for complex matrices) first and then for non-zero eigenvalues

Usage

1

Arguments

A

Numeric matrix (real or complex)

Value

TRUE indicates that the matrix A is symmetric (Hermitian) positive definite

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
A<-matrix(c(1,2,3,4),2,2)  # not symmetric
is_sym_pos_def(A)   # FALSE

A<-matrix(c(1,2,2,1),2,2)  # Symmetric but an eigen value is not positive
is_sym_pos_def(A)   # FALSE

A<-matrix(c(2,1,1,2),2,2)  # Both symmetric and eigen values are positive
is_sym_pos_def(A)   # TRUE

A<-matrix(c(4,2-3i,2+3i,3),2,2)  # Hermitian but one eigen value is not positive
is_sym_pos_def(A)   # FALSE

SignalEstimation/corrtest documentation built on Dec. 28, 2021, 12:13 a.m.