make_posdef: Matrix Positive-Definiteness

Description Usage Arguments Value References Examples

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

Description

Produces a positive-definite matrix (to a certain tolerance). Originally found under \insertCitecorpcorpackage;textualCovEstim.

Usage

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

Arguments

mat

a pxp matrix.

tol

a double, the tolerance for the relative positiveness of eigenvalues compared to the largest eigenvalue. Default value is tol=1e-8. If NULL, a machine tolerance approximation is applied.

Value

a positive-definite (to the tolerance of tol) matrix.

References

\insertRef

corpcorpackageCovEstim

Examples

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

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