Unlimited learning, half price | 50% off
Get 50% off unlimited learning

svrep (version 0.7.0)

get_nearest_psd_matrix: Approximates a symmetric, real matrix by the nearest positive semidefinite matrix.

Description

Approximates a symmetric, real matrix by the nearest positive semidefinite matrix in the Frobenius norm, using the method of Higham (1988). For a real, symmetric matrix, this is equivalent to "zeroing out" negative eigenvalues. See the "Details" section for more information.

Usage

get_nearest_psd_matrix(X)

Value

The nearest positive semidefinite matrix of the same dimension as X.

Arguments

X

A symmetric, real matrix with no missing values.

Details

Let A denote a symmetric, real matrix which is not positive semidefinite. Then we can form the spectral decomposition A=ΓΛΓ, where Λ is the diagonal matrix whose entries are eigenvalues of A. The method of Higham (1988) is to approximate A with A~=ΓΛ+Γ, where the ii-th entry of Λ+ is max(Λii,0).

References

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

Examples

Run this code
X <- matrix(
  c(2, 5, 5,
    5, 2, 5,
    5, 5, 2),
  nrow = 3, byrow = TRUE
)
get_nearest_psd_matrix(X)

Run the code above in your browser using DataLab