make_posdef: Matrix Positive-Definiteness

View source: R/cov_help_funcs.R

make_posdefR Documentation

Matrix Positive-Definiteness

Description

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

Usage

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

data(rets_m)
ml_sigma <- cov_estim_wrapper2(rets_m, "ML")
is_posdef(ml_sigma)
ml_sigma_posdef <- make_posdef(ml_sigma)
is_posdef(ml_sigma_posdef)


antshi/CovEstim documentation built on June 10, 2025, 3:11 a.m.