ParSensitivityConverter class. More...
#include <orea/engine/parsensitivityanalysis.hpp>
Public Member Functions | |
ParSensitivityConverter (const ParSensitivityAnalysis::ParContainer &parSensitivities, const std::map< ore::analytics::RiskFactorKey, std::pair< QuantLib::Real, QuantLib::Real > > &shiftSizes) | |
const std::set< ore::analytics::RiskFactorKey > & | rawKeys () |
Inspectors. More... | |
const std::set< ore::analytics::RiskFactorKey > & | parKeys () |
boost::numeric::ublas::vector< Real > | convertSensitivity (const boost::numeric::ublas::vector< Real > &zeroSensitivities) |
Takes an array of zero sensitivities and returns an array of par sensitivities. More... | |
void | writeConversionMatrix (ore::data::Report &reportOut) const |
Write the inverse of the transposed Jacobian to the reportOut . More... | |
ParSensitivityAnalysis::ParContainer | inverseJacobian () const |
Private Attributes | |
std::set< ore::analytics::RiskFactorKey > | rawKeys_ |
std::set< ore::analytics::RiskFactorKey > | parKeys_ |
QuantLib::SparseMatrix | jacobi_transp_inv_ |
boost::numeric::ublas::vector< QuantLib::Real > | zeroShifts_ |
Vector of absolute zero shift sizes. More... | |
boost::numeric::ublas::vector< QuantLib::Real > | parShifts_ |
Vector of absolute par shift sizes. More... | |
ParSensitivityConverter class.
1) Build Jacobi matrix containing sensitivities of par rates (first index) w.r.t. zero shifts (second index) 2) Convert zero rate and optionlet vol sensitivities into par rate/vol sensitivities
Let: p_ij denote curve i's par instrument j (curve may be a discount or an index curve) z_kl denote curve k's zero shift l (curve may be a discount or an index curve) i,k run from 0 to I j,l run from 0 to J
Organisation of the matrix: z_00 z_01 z_02 ... z_0J ... z_10 z_11 ... z_1J ... z_I0 z_I1 ... z_IJ p_00 p_01 p_02 ... p_0J p_10 p_11 ... p_1J ... p_I0 p_I1 ... p_IJ
The curve numbering starts with discount curves (by ccy), followed by index curves (by index name). The number J of par instruments respectively zero shifts can differ between discount and index curves. The number of zero shifts matches the number of par instruments. The Jacobi matrix is therefore quadratic by construction.
Definition at line 174 of file parsensitivityanalysis.hpp.
ParSensitivityConverter | ( | const ParSensitivityAnalysis::ParContainer & | parSensitivities, |
const std::map< ore::analytics::RiskFactorKey, std::pair< QuantLib::Real, QuantLib::Real > > & | shiftSizes | ||
) |
Constructor where parSensitivities
is the par rate sensitivities w.r.t. zero shifts shiftSizes
gives the absolute zero and par shift sizes for each risk factor key.
Definition at line 572 of file parsensitivityanalysis.cpp.
const std::set< ore::analytics::RiskFactorKey > & rawKeys | ( | ) |
Inspectors.
Return the set of raw, i.e. zero, risk factor keys The ordering in this set defines the order of the columns in the Jacobi matrix
Definition at line 187 of file parsensitivityanalysis.hpp.
const std::set< ore::analytics::RiskFactorKey > & parKeys | ( | ) |
Return the set of par risk factor keys The ordering in this set defines the order of the rows in the Jacobi matrix
Definition at line 190 of file parsensitivityanalysis.hpp.
boost::numeric::ublas::vector< Real > convertSensitivity | ( | const boost::numeric::ublas::vector< Real > & | zeroSensitivities | ) |
Takes an array of zero sensitivities and returns an array of par sensitivities.
zeroSensitivities | array of zero sensitivities ordered according to rawKeys() |
Definition at line 781 of file parsensitivityanalysis.cpp.
void writeConversionMatrix | ( | ore::data::Report & | reportOut | ) | const |
Write the inverse of the transposed Jacobian to the reportOut
.
Definition at line 808 of file parsensitivityanalysis.cpp.
ParSensitivityAnalysis::ParContainer inverseJacobian | ( | ) | const |
Definition at line 206 of file parsensitivityanalysis.hpp.
|
private |
Definition at line 220 of file parsensitivityanalysis.hpp.
|
private |
Definition at line 221 of file parsensitivityanalysis.hpp.
|
private |
Definition at line 223 of file parsensitivityanalysis.hpp.
|
private |
Vector of absolute zero shift sizes.
Definition at line 225 of file parsensitivityanalysis.hpp.
|
private |
Vector of absolute par shift sizes.
Definition at line 227 of file parsensitivityanalysis.hpp.