ql/MonteCarlo/getcovariance.hpp File Reference
Detailed Description
Covariance matrix calculation.
#include <ql/Math/matrix.hpp>
#include <ql/Utilities/dataformatters.hpp>
Include dependency graph for getcovariance.hpp:
|
Namespaces |
namespace | QuantLib |
Functions |
template<class DataIterator> |
Disposable< Matrix > | getCovariance (DataIterator volBegin, DataIterator volEnd, const Matrix &corr, Real tolerance=1.0e-12) |
Function Documentation
Disposable<Matrix> QuantLib::getCovariance |
( |
DataIterator |
volBegin, |
|
|
DataIterator |
volEnd, |
|
|
const Matrix & |
corr, |
|
|
Real |
tolerance = 1.0e-12 |
|
) |
|
|
|
Combines the correlation matrix and the vector of volatilities to return the covariance matrix.
Note that only the symmetric part of the correlation matrix is used. Also it is assumed that the diagonal member of the correlation matrix equals one.
- Precondition:
- The correlation matrix must be symmetric with the diagonal members equal to one.
- Tests:
- tested on know values and cross checked with CovarianceDecomposition
|
|