Learn R Programming

ZVCV (version 2.1.2)

nearPD: Nearest symmetric positive definite matrix

Description

This function finds the nearest symmetric positive definite matrix to the given matrix. It is used throughout the package to handle numerical issues in matrix inverses and cholesky decompositions.

Usage

nearPD(K0)

Value

The closest symmetric positive definite matrix to K0.

Arguments

K0

A square matrix

Author

Adapted from Matlab code by John D'Errico

References

Higham, N. J. (1988). Computing a nearest symmetric positive semidefinite matrix. Linear Algebra and its Applications, 103, 103-118.

D'Errico, J. (2013). nearestSPD Matlab function. https://uk.mathworks.com/matlabcentral/fileexchange/42885-nearestspd.