#include <orea/scenario/scenarioshiftcalculator.hpp>
Public Member Functions | |
ScenarioShiftCalculator (const QuantLib::ext::shared_ptr< ore::analytics::SensitivityScenarioData > &sensitivityConfig, const QuantLib::ext::shared_ptr< ore::analytics::ScenarioSimMarketParameters > &simMarketConfig, const QuantLib::ext::shared_ptr< ore::analytics::ScenarioSimMarket > &simMarket=QuantLib::ext::shared_ptr< ore::analytics::ScenarioSimMarket >()) | |
QuantLib::Real | shift (const ore::analytics::RiskFactorKey &key, const ore::analytics::Scenario &s_1, const ore::analytics::Scenario &s_2) const |
Private Member Functions | |
QuantLib::Real | transform (const ore::analytics::RiskFactorKey &key, QuantLib::Real value, const QuantLib::Date &asof) const |
Private Attributes | |
QuantLib::ext::shared_ptr< ore::analytics::SensitivityScenarioData > | sensitivityConfig_ |
QuantLib::ext::shared_ptr< ore::analytics::ScenarioSimMarketParameters > | simMarketConfig_ |
QuantLib::ext::shared_ptr< ore::analytics::ScenarioSimMarket > | simMarket_ |
Class for calculating the shift multiple between two scenarios for a given risk factor key.
The shift value returned is a value that is consistent with the SensitivityScenarioData and ScenarioSimMarketParameters passed in during construction. In other words, multiplying the result of the shift method with sensitivities generated using the SensitivityScenarioData configuration will give a valid estimate of the P&L move associated with moving from one scenario to another.
Definition at line 41 of file scenarioshiftcalculator.hpp.
ScenarioShiftCalculator | ( | const QuantLib::ext::shared_ptr< ore::analytics::SensitivityScenarioData > & | sensitivityConfig, |
const QuantLib::ext::shared_ptr< ore::analytics::ScenarioSimMarketParameters > & | simMarketConfig, | ||
const QuantLib::ext::shared_ptr< ore::analytics::ScenarioSimMarket > & | simMarket = QuantLib::ext::shared_ptr<ore::analytics::ScenarioSimMarket>() |
||
) |
Constructor
sensitivityConfig | sensitivity configuration that will determine the result returned by the shift method |
simMarketConfig | simulation market configuration for the scenarios that will be fed to the shift method |
simMarket | simulation market that will be used if provided |
Definition at line 44 of file scenarioshiftcalculator.cpp.
Real shift | ( | const ore::analytics::RiskFactorKey & | key, |
const ore::analytics::Scenario & | s_1, | ||
const ore::analytics::Scenario & | s_2 | ||
) | const |
Calculate the shift in the risk factor key
implied by going from scenario s_1
to scenario s_2
.
Definition at line 49 of file scenarioshiftcalculator.cpp.
|
private |
For some risk factors, the sensitivty is understood to be to a transform of the quantity that appears in the scenario and this transform can generally require the time to expiry of the factor.
For example, the SensitivityScenarioData expresses shifts for IR in terms of zero rates and the scenarios hold discount factors so to convert the scenario value from \(df_t\) to \(z_t\), you need to know the year fraction until maturity i.e. \(\tau(0, t)\) and then the transformed value is:
\[ z_t = - \frac{\ln(df_t)}{\tau(0, t)} \]
Definition at line 93 of file scenarioshiftcalculator.cpp.
|
private |
Definition at line 61 of file scenarioshiftcalculator.hpp.
|
private |
Definition at line 62 of file scenarioshiftcalculator.hpp.
|
private |
Definition at line 63 of file scenarioshiftcalculator.hpp.