QuantLib: CovarianceDecomposition Class Reference

A free/open-source library for quantitative finance Reference manual - version 1.12

Public Member Functions | List of all members
CovarianceDecomposition Class Reference

Covariance decomposition into correlation and variances. More...

`#include <ql/math/matrixutilities/getcovariance.hpp>`

## Public Member Functions
| CovarianceDecomposition (const Matrix &covarianceMatrix, Real tolerance=1.0e-12)
const Array & | variances () const
const Array & | standardDeviations () const
const Matrix & | correlationMatrix () const

## 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

## Constructor & Destructor Documentation

## ◆ CovarianceDecomposition()

CovarianceDecomposition | ( | const Matrix & | covarianceMatrix,
|  | Real | tolerance = `1.0e-12`
| ) |  |

Precondition
  covarianceMatrix must be symmetric

## Member Function Documentation

## ◆ variances()

const Array& variances | ( |  | ) | const

returns the variances Array

## ◆ standardDeviations()

const Array& standardDeviations | ( |  | ) | const

returns the standard deviations Array

## ◆ correlationMatrix()

const Matrix& correlationMatrix | ( |  | ) | const

returns the correlation matrix