Excel Lab
  • Excel Lab
  • Release Notes
  • Getting Started
    • Installing Excel Lab
      • Step 1: Download Files
      • Step 2: Register Libraries
      • Step 3: Activate Add-in
      • Step 4: Verify Installation
  • Functions
    • General
      • ISMATRIXPSD
      • MATRIX
      • XLABHELP
      • XLABINFO
      • XLABLICENSE
      • RESETPASSWORD
    • Return Models
      • CAPM
      • DESMOOTHRETURNS
      • IMPLIEDRETURNS
      • MLERETURNS
    • Risk Models
      • ANNUALIZERISK
      • EWMA
      • HISTORICALRISK
      • MLERISK
      • PORTFOLIORISK
      • TURBULENTRISK
      • QUIETRISK
    • Optimization
      • MVO
      • MTO
      • MVT
      • MVFRONTIER
      • MTFRONTIER
      • ISORETURN
    • Simulation
      • MCNORM
      • BOOTSTRAP
    • Exposure to Loss
      • LOSSPR
      • OMEGARATIO
      • SORTINORATIO
      • TAILRATIO
      • VALUEATRISK
      • MAXDD
    • Regression Analysis
      • FACTORANALYSIS
      • PSR
    • Scenario Analysis
      • MAHALANOBIS
      • SCENARIOPR
      • IMPLIEDSCENARIO
  • Frequently Asked Questions
    • Common Issues
    • FAQ
  • Further Reading
  • Windham's Research Insights
  • Watch Our Educational Videos
Powered by GitBook
On this page
  • Description
  • Syntax
  • Input(s)
  • Output(s)
  • Example
  1. Functions
  2. General

ISMATRIXPSD

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

PreviousGeneralNextMATRIX

Last updated 3 years ago

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. ). 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)

Argument
Description

x

Matrix to evaluate or solve.

isSolveNearest

Optional logical (TRUE or FALSE) flag. If true, the function will solve and return the nearest positive semidefinite matrix, otherwise it will only evaluate whether x is positive semidefinite or not. If the argument is not specified, the function defaults to false.

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

isSolveNearest
Output

true

Square matrix of the nearest positive semidefinite matrix relative to x.

false (default)

Logical indicating whether input square matrix x is positive semidefinite.

Example

Cholsky decomposition
56KB
ISMATRIXPSD.xlsx
Example Workbook: ISMATRIXPSD
Check or solve to the closest positive semidefinite matrix!