Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
parstressconverter.hpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2024 AcadiaSoft Inc.
3 All rights reserved.
4
5 This file is part of ORE, a free-software/open-source library
6 for transparent pricing and risk analysis - http://opensourcerisk.org
7
8 ORE is free software: you can redistribute it and/or modify it
9 under the terms of the Modified BSD License. You should have received a
10 copy of the license along with this program.
11 The license is also available online at <http://opensourcerisk.org>
12
13 This program is distributed on the basis that it will form a useful
14 contribution to risk analytics and model standardisation, but WITHOUT
15 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
16 FITNESS FOR A PARTICULAR PURPOSE. See the license for more details.
17*/
18
19/*! \file orea/engine/parstressconverter.hpp
20 \brief Convert all par shifts in a stress test to a zero shifts
21 \ingroup engine
22*/
23
24#pragma once
35
36namespace ore {
37namespace analytics {
38
40public:
42 const QuantLib::Date& asof, QuantLib::ext::shared_ptr<ore::data::TodaysMarketParameters>& todaysMarketParams,
43 const QuantLib::ext::shared_ptr<ore::analytics::ScenarioSimMarketParameters>& simMarketParams,
44 const QuantLib::ext::shared_ptr<ore::analytics::SensitivityScenarioData>& sensiScenarioData,
45 const QuantLib::ext::shared_ptr<ore::data::CurveConfigurations>& curveConfigs,
46 const QuantLib::ext::shared_ptr<ore::data::Market>& todaysMarket,
47 const QuantLib::ext::shared_ptr<ore::data::IborFallbackConfig>& iborFallbackConfig);
48
49 //! Convert all par shifts to zero shifts for all scenarios defined in the stresstest
50 QuantLib::ext::shared_ptr<ore::analytics::StressTestScenarioData> convertStressScenarioData(
51 const QuantLib::ext::shared_ptr<ore::analytics::StressTestScenarioData>& scenarioData) const;
52
53 //! Creates a SimMarket, aligns the pillars and strikes of sim and sensitivity scenario market, computes par
54 //! sensitivites
55 std::pair<QuantLib::ext::shared_ptr<ScenarioSimMarket>, QuantLib::ext::shared_ptr<ParSensitivityAnalysis>>
56 computeParSensitivity(const std::set<RiskFactorKey::KeyType>& typesDisabled) const;
57
58private:
59 //! get a set of risk factors which will be interpreted as zero rate shifts
60 std::set<RiskFactorKey::KeyType> zeroRateRiskFactors(bool irCurveParRates, bool irCapFloorParRates,
61 bool creditParRates) const;
62
63 QuantLib::Date asof_;
64 QuantLib::ext::shared_ptr<ore::data::TodaysMarketParameters> todaysMarketParams_;
65 QuantLib::ext::shared_ptr<ore::analytics::ScenarioSimMarketParameters> simMarketParams_;
66 QuantLib::ext::shared_ptr<ore::analytics::SensitivityScenarioData> sensiScenarioData_;
67 QuantLib::ext::shared_ptr<ore::data::CurveConfigurations> curveConfigs_;
68 QuantLib::ext::shared_ptr<ore::data::Market> todaysMarket_;
69 QuantLib::ext::shared_ptr<ore::data::IborFallbackConfig> iborFallbackConfig_;
70};
71
72} // namespace analytics
73} // namespace ore
QuantLib::ext::shared_ptr< ore::data::CurveConfigurations > curveConfigs_
QuantLib::ext::shared_ptr< ore::data::TodaysMarketParameters > todaysMarketParams_
QuantLib::ext::shared_ptr< ore::data::Market > todaysMarket_
QuantLib::ext::shared_ptr< ore::analytics::ScenarioSimMarketParameters > simMarketParams_
std::pair< QuantLib::ext::shared_ptr< ScenarioSimMarket >, QuantLib::ext::shared_ptr< ParSensitivityAnalysis > > computeParSensitivity(const std::set< RiskFactorKey::KeyType > &typesDisabled) const
QuantLib::ext::shared_ptr< ore::data::IborFallbackConfig > iborFallbackConfig_
QuantLib::ext::shared_ptr< ore::analytics::SensitivityScenarioData > sensiScenarioData_
std::set< RiskFactorKey::KeyType > zeroRateRiskFactors(bool irCurveParRates, bool irCapFloorParRates, bool creditParRates) const
get a set of risk factors which will be interpreted as zero rate shifts
QuantLib::ext::shared_ptr< ore::analytics::StressTestScenarioData > convertStressScenarioData(const QuantLib::ext::shared_ptr< ore::analytics::StressTestScenarioData > &scenarioData) const
Convert all par shifts to zero shifts for all scenarios defined in the stresstest.
Perfrom sensitivity analysis for a given portfolio.
Scenario class.
A Market class that can be updated by Scenarios.
A class to hold Scenario parameters for scenarioSimMarket.
A class to hold the parametrisation for building sensitivity scenarios.
A class to hold the parametrisation for building sensitivity scenarios.
vector< string > curveConfigs
Date asof(14, Jun, 2018)