Logo
Reference manual - version orea_version
Public Member Functions | List of all members
ParSensitivityConverter Class Reference

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.
 
ParSensitivityAnalysis::ParContainer inverseJacobian () const
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ ParSensitivityConverter()

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.

Member Function Documentation

◆ rawKeys()

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

◆ parKeys()

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

◆ convertSensitivity()

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.

Parameters
zeroSensitivitiesarray of zero sensitivities ordered according to rawKeys()
Returns
array of par sensitivities ordered according to parKeys()