QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
CovarianceDecomposition Class Reference

Covariance decomposition into correlation and variances. More...

#include <getcovariance.hpp>

+ Collaboration diagram for CovarianceDecomposition:

Public Member Functions

 CovarianceDecomposition (const Matrix &covarianceMatrix, Real tolerance=1.0e-12)
 
const Arrayvariances () const
 
const ArraystandardDeviations () const
 
const MatrixcorrelationMatrix () const
 

Private Attributes

Array variances_
 
Array stdDevs_
 
Matrix correlationMatrix_
 

Detailed Description

Covariance decomposition into correlation and variances.

Extracts the correlation matrix and the vector of variances out of the input covariance matrix.

Note that only the lower symmetric part of the covariance matrix is used.

Precondition
The covariance matrix must be symmetric.
Tests:
cross checked with getCovariance

Definition at line 95 of file getcovariance.hpp.

Constructor & Destructor Documentation

◆ CovarianceDecomposition()

CovarianceDecomposition ( const Matrix covarianceMatrix,
Real  tolerance = 1.0e-12 
)
Precondition
covarianceMatrix must be symmetric

Definition at line 24 of file getcovariance.cpp.

+ Here is the call graph for this function:

Member Function Documentation

◆ variances()

const Array & variances ( ) const

returns the variances Array

Definition at line 102 of file getcovariance.hpp.

◆ standardDeviations()

const Array & standardDeviations ( ) const

returns the standard deviations Array

Definition at line 104 of file getcovariance.hpp.

◆ correlationMatrix()

const Matrix & correlationMatrix ( ) const

returns the correlation matrix

Definition at line 106 of file getcovariance.hpp.

+ Here is the caller graph for this function:

Member Data Documentation

◆ variances_

Array variances_
private

Definition at line 108 of file getcovariance.hpp.

◆ stdDevs_

Array stdDevs_
private

Definition at line 108 of file getcovariance.hpp.

◆ correlationMatrix_

Matrix correlationMatrix_
private

Definition at line 109 of file getcovariance.hpp.