is_posdef: Matrix Positive-Definiteness Check

Description Usage Arguments Value Examples

View source: R/cov-estim-help.R

Description

Performs a tolerance check for positive-definiteness of a symmetric matrix.

Usage

1
is_posdef(mat, tol = 1e-08)

Arguments

mat

a pxp matrix.

tol

a double with tolerance for the eigenvalues. Default value is 1e-8.

Value

a logical. TRUE, if the matrix mat is positive-definite.

Examples

1
2
3
4
5
6
7
data(sp200)
sp_rets <- sp200[,-1]
ml_sigma <- sigma_estim(sp_rets, "ML")
is_posdef(ml_sigma)

ml_sigma <- sigma_estim(sp_rets[1:100,], "ML")
is_posdef(ml_sigma)

antshi/CovEstim documentation built on Nov. 13, 2020, 2:25 p.m.