Par Sensitivity Analysis. More...
#include <orea/engine/parsensitivityanalysis.hpp>
Public Types | |
typedef std::map< std::pair< ore::analytics::RiskFactorKey, ore::analytics::RiskFactorKey >, Real > | ParContainer |
Public Member Functions | |
ParSensitivityAnalysis (const QuantLib::Date &asof, const QuantLib::ext::shared_ptr< ore::analytics::ScenarioSimMarketParameters > &simMarketParams, const ore::analytics::SensitivityScenarioData &sensitivityData, const string &marketConfiguration=Market::defaultConfiguration, const bool continueOnError=false, const std::set< ore::analytics::RiskFactorKey::KeyType > &typesDisabled={}) | |
Constructor. More... | |
virtual | ~ParSensitivityAnalysis () |
void | computeParInstrumentSensitivities (const QuantLib::ext::shared_ptr< ore::analytics::ScenarioSimMarket > &simMarket) |
Compute par instrument sensitivities. More... | |
const ParContainer & | parSensitivities () const |
Return computed par sensitivities. Empty if they have not been computed yet. More... | |
void | alignPillars () |
align pillars in scenario simulation market parameters with those of the par instruments More... | |
const std::set< ore::analytics::RiskFactorKey > & | relevantRiskFactors () const |
get / set the relevant scenarios (if empty, these are ignored) More... | |
std::set< ore::analytics::RiskFactorKey > & | relevantRiskFactors () |
std::map< ore::analytics::RiskFactorKey, std::pair< QuantLib::Real, QuantLib::Real > > | shiftSizes () const |
Return the zero rate and par rate absolute shift size for each risk factor key. More... | |
void | disable (const std::set< ore::analytics::RiskFactorKey::KeyType > &types) |
const std::set< ore::analytics::RiskFactorKey::KeyType > & | typesDisabled () const |
Return the set of key types disabled for this instance of ParSensitivityAnalysis. More... | |
const ParSensitivityInstrumentBuilder::Instruments & | parInstruments () const |
Static Public Member Functions | |
static bool | isParType (ore::analytics::RiskFactorKey::KeyType type) |
Returns true if risk factor type is applicable for par conversion. More... | |
Private Member Functions | |
void | augmentRelevantRiskFactors () |
Augment relevant risk factors. More... | |
void | populateShiftSizes (const ore::analytics::RiskFactorKey &key, QuantLib::Real parRate, const QuantLib::ext::shared_ptr< ore::analytics::ScenarioSimMarket > &simMarket) |
Populate shiftSizes_ for key given the implied fair par rate parRate . More... | |
Private Attributes | |
QuantLib::Date | asof_ |
As of date for the calculation of the par sensitivities. More... | |
QuantLib::ext::shared_ptr< ore::analytics::ScenarioSimMarketParameters > | simMarketParams_ |
Simulation market parameters. More... | |
ore::analytics::SensitivityScenarioData | sensitivityData_ |
Sensitivity data. More... | |
ParContainer | parSensi_ |
sensitivity of par rates w.r.t. raw rate shifts (including optionlet/cap volatility) More... | |
ParSensitivityInstrumentBuilder::Instruments | instruments_ |
std::string | marketConfiguration_ |
bool | continueOnError_ |
std::set< ore::analytics::RiskFactorKey > | relevantRiskFactors_ |
std::set< ore::analytics::RiskFactorKey::KeyType > | typesDisabled_ |
Set of risk factor types disabled for this instance of ParSensitivityAnalysis. More... | |
std::map< ore::analytics::RiskFactorKey, std::pair< QuantLib::Real, QuantLib::Real > > | shiftSizes_ |
Static Private Attributes | |
static std::set< ore::analytics::RiskFactorKey::KeyType > | parTypes_ |
Par Sensitivity Analysis.
This class adds par sensitivity conversion to the base class functionality
Definition at line 57 of file parsensitivityanalysis.hpp.
typedef std::map<std::pair<ore::analytics::RiskFactorKey, ore::analytics::RiskFactorKey>, Real> ParContainer |
Definition at line 59 of file parsensitivityanalysis.hpp.
ParSensitivityAnalysis | ( | const QuantLib::Date & | asof, |
const QuantLib::ext::shared_ptr< ore::analytics::ScenarioSimMarketParameters > & | simMarketParams, | ||
const ore::analytics::SensitivityScenarioData & | sensitivityData, | ||
const string & | marketConfiguration = Market::defaultConfiguration , |
||
const bool | continueOnError = false , |
||
const std::set< ore::analytics::RiskFactorKey::KeyType > & | typesDisabled = {} |
||
) |
Constructor.
Definition at line 89 of file parsensitivityanalysis.cpp.
|
virtual |
Definition at line 69 of file parsensitivityanalysis.hpp.
void computeParInstrumentSensitivities | ( | const QuantLib::ext::shared_ptr< ore::analytics::ScenarioSimMarket > & | simMarket | ) |
Compute par instrument sensitivities.
Definition at line 154 of file parsensitivityanalysis.cpp.
const ParContainer & parSensitivities | ( | ) | const |
Return computed par sensitivities. Empty if they have not been computed yet.
Definition at line 75 of file parsensitivityanalysis.hpp.
void alignPillars | ( | ) |
align pillars in scenario simulation market parameters with those of the par instruments
Definition at line 482 of file parsensitivityanalysis.cpp.
|
static |
Returns true if risk factor type is applicable for par conversion.
Definition at line 538 of file parsensitivityanalysis.cpp.
const std::set< ore::analytics::RiskFactorKey > & relevantRiskFactors | ( | ) | const |
get / set the relevant scenarios (if empty, these are ignored)
Definition at line 84 of file parsensitivityanalysis.hpp.
std::set< ore::analytics::RiskFactorKey > & relevantRiskFactors | ( | ) |
Definition at line 85 of file parsensitivityanalysis.hpp.
std::map< ore::analytics::RiskFactorKey, std::pair< QuantLib::Real, QuantLib::Real > > shiftSizes | ( | ) | const |
Return the zero rate and par rate absolute shift size for each risk factor key.
Definition at line 88 of file parsensitivityanalysis.hpp.
void disable | ( | const std::set< ore::analytics::RiskFactorKey::KeyType > & | types | ) |
Disable par conversion for the given set of risk factor key types. May be called multiple times in order to add key types that should not be considered for par conversion.
Definition at line 540 of file parsensitivityanalysis.cpp.
const std::set< ore::analytics::RiskFactorKey::KeyType > & typesDisabled | ( | ) | const |
Return the set of key types disabled for this instance of ParSensitivityAnalysis.
Definition at line 98 of file parsensitivityanalysis.hpp.
const ParSensitivityInstrumentBuilder::Instruments & parInstruments | ( | ) | const |
Definition at line 100 of file parsensitivityanalysis.hpp.
|
private |
Augment relevant risk factors.
Definition at line 103 of file parsensitivityanalysis.cpp.
|
private |
Populate shiftSizes_
for key
given the implied fair par rate parRate
.
Definition at line 549 of file parsensitivityanalysis.cpp.
|
private |
As of date for the calculation of the par sensitivities.
Definition at line 111 of file parsensitivityanalysis.hpp.
|
private |
Simulation market parameters.
Definition at line 113 of file parsensitivityanalysis.hpp.
|
private |
Sensitivity data.
Definition at line 115 of file parsensitivityanalysis.hpp.
|
private |
sensitivity of par rates w.r.t. raw rate shifts (including optionlet/cap volatility)
Definition at line 117 of file parsensitivityanalysis.hpp.
|
private |
Definition at line 118 of file parsensitivityanalysis.hpp.
|
private |
Definition at line 120 of file parsensitivityanalysis.hpp.
|
private |
Definition at line 121 of file parsensitivityanalysis.hpp.
|
private |
Definition at line 122 of file parsensitivityanalysis.hpp.
|
staticprivate |
Definition at line 124 of file parsensitivityanalysis.hpp.
|
private |
Set of risk factor types disabled for this instance of ParSensitivityAnalysis.
Definition at line 127 of file parsensitivityanalysis.hpp.
|
private |
Store the zero rate and par rate absolute shift size for each risk factor key
The first element in the pair is the zero or raw rate absolute shift size. The second element in the pair is the corresponding par rate absolute shift size.
In the case of the zero rate shift being configured as Absolute
in sensitivityData_
, then the par rate absolute shift size is just equal to the configured zero rate shift size. In the case of the zero rate shift being configured as Relative
in sensitivityData_
, we take the fair implied par rate and multiply it by the configured relative zero rate shift size to give the par rate absolute shift size.
Definition at line 139 of file parsensitivityanalysis.hpp.