Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
Public Member Functions | List of all members
CovarianceSalvage Struct Referenceabstract

#include <qle/math/covariancesalvage.hpp>

+ Inheritance diagram for CovarianceSalvage:
+ Collaboration diagram for CovarianceSalvage:

Public Member Functions

virtual ~CovarianceSalvage ()
 
virtual std::pair< Matrix, Matrix > salvage (const Matrix &m) const =0
 

Detailed Description

Interface, salvage(m) should return (p,s) with p = the salvaged (i.e. positive semidefinite) version of m s = a square root of p, if provided, otherwise an empty Matrix

An implementation of this class represents a method to make a given covariance matrix m positive semidefinite. This includes an implementation that just returns the input matrix unchanged, e.g. for cases where it is known in advance / for theoretical reasons that the matrix m is positive semidefinite.

If the method produces a square root of the output matrix as a side product, this should be returned in addition since many use cases that require a salvaged covariance matrix also require a square root of this matrix e.g. for generating correlated normal random variates. A repeated computation of the square root can be avoided this way. The returned square root may but is not required to be the unique symmetric positive semidefinite square root of the salvaged covariance matrix p.

If the method does not provide a square root, an empty matrix Matrix() should be returned instead, in which case the caller is responsible to compute a square root if required.

Definition at line 49 of file covariancesalvage.hpp.

Constructor & Destructor Documentation

◆ ~CovarianceSalvage()

virtual ~CovarianceSalvage ( )
virtual

Definition at line 50 of file covariancesalvage.hpp.

50{}

Member Function Documentation

◆ salvage()

virtual std::pair< Matrix, Matrix > salvage ( const Matrix &  m) const
pure virtual

Implemented in NoCovarianceSalvage, and SpectralCovarianceSalvage.

+ Here is the caller graph for this function: