matrix_pd: Check whether a matrix is positive definite and regularize it...

View source: R/matrix_pd.R

matrix_pdR Documentation

Check whether a matrix is positive definite and regularize it if not positive definite

Description

This function checks whether a matrix is positive definite and regularizes it if not positive definite

Usage

matrix_pd(sym_matrix)

Arguments

sym_matrix

is a symmetric matrix

Details

This function checks whether a matrix is positive definite and regularizes it if not positive definite, as done in Hautsch, N., L. Kyj, and R. Oomen (2012)

Value

cxpd a (potentially regularized) positive definite a symmetric n x n matrix

References

Hautsch, N., L. Kyj, and R. Oomen (2012). A blocking and regularization approach to high-dimensional realized covariance estimation. Journal of Applied Econometrics, 27, 625–645

Examples

a = rbind(
   c(4,  0.5,1),
   c(0.5, 3 ,0),
   c(1,   0, -2)
   )
a
matrix_pd(a)

deanfantazzini/bitcoinFinance documentation built on June 12, 2024, 4:10 p.m.