ISMATRIXPSD

Verify if a matrix is positive semidefinite. Solve for the nearest positive semidefinite matrix if it is not.

Description

Positive semidefinite matrices are useful in portfolio theory because they are symmetric and easy to decompose. This is particularly useful for optimization (e.g. Cholsky decomposition). When a matrix is symmetric and positive semidefinite, we can decompose it in a lower triangular matrix and find its inverse - which is computationally more efficient than inverting a matrix. Positive semidefinite matrices are a special case of symmetric matrices and is a good check for covariance and correlation matrices.

This function allows you to check if your matrix is positive semidefinite, and if it isn't it will perturb its elements to solve for the nearest positive semidefinite matrix.

We consider a matrix positive semidefinite if its characteristic roots are greater or equal to zero.

Syntax

The following describes the function signature for use in Microsoft Excel's formula bar.

=ISMATRIXPSD(x, isSolveNearest)

Input(s)

Output(s)

The function's output will vary depending on the specification of the isSolveNearest argument. The following table will describe the corresponding output result.

Logical whether x is positive semidefinite or otherwise. Nearest positive semidefinite matrix

Example

Last updated