Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
sensitivityrunner.hpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2018 Quaternion Risk Management Ltd
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/app/sensitivityrunner.hpp
20 \brief A class to run the sensitivity analysis
21 \ingroup app
22*/
23#pragma once
24
25#include <boost/make_shared.hpp>
34
35namespace ore {
36namespace analytics {
37
39public:
40 SensitivityRunner(QuantLib::ext::shared_ptr<Parameters> params,
41 const QuantLib::ext::shared_ptr<ore::data::ReferenceDataManager>& referenceData = nullptr,
42 const IborFallbackConfig& iborFallbackConfig = IborFallbackConfig::defaultConfig(),
43 const bool continueOnError = false)
44 : params_(params), referenceData_(referenceData), iborFallbackConfig_(iborFallbackConfig),
45 continueOnError_(continueOnError) {}
46
47 virtual ~SensitivityRunner(){};
48
49 virtual void runSensitivityAnalysis(QuantLib::ext::shared_ptr<ore::data::Market> market,
50 const QuantLib::ext::shared_ptr<ore::data::CurveConfigurations>& curveConfigs,
51 const QuantLib::ext::shared_ptr<ore::data::TodaysMarketParameters>& todaysMarketParams);
52
53 //! Initialize input parameters to the sensitivities analysis
54 virtual void sensiInputInitialize(QuantLib::ext::shared_ptr<ScenarioSimMarketParameters>& simMarketData,
55 QuantLib::ext::shared_ptr<SensitivityScenarioData>& sensiData,
56 QuantLib::ext::shared_ptr<EngineData>& engineData,
57 QuantLib::ext::shared_ptr<Portfolio>& sensiPortfolio);
58
59 //! Write out some standard sensitivities reports
60 virtual void sensiOutputReports(const QuantLib::ext::shared_ptr<SensitivityAnalysis>& sensiAnalysis);
61
62 //! \name Inspectors
63 //@{
64 const QuantLib::ext::shared_ptr<ScenarioSimMarket>& simMarket() const { return simMarket_; }
65 const QuantLib::ext::shared_ptr<SensitivityScenarioData>& sensiData() const { return sensiData_; }
66 //@}
67
68protected:
69 QuantLib::ext::shared_ptr<Parameters> params_;
70 QuantLib::ext::shared_ptr<ore::data::ReferenceDataManager> referenceData_;
72 const bool continueOnError_;
73
74 //! Scenario simulation market that is bumped for the sensitivity run.
75 QuantLib::ext::shared_ptr<ScenarioSimMarket> simMarket_;
76
77 //! Sensitivity configuration data used for the sensitivity run.
78 QuantLib::ext::shared_ptr<SensitivityScenarioData> sensiData_;
79};
80
81} // namespace analytics
82} // namespace ore
QuantLib::ext::shared_ptr< SensitivityScenarioData > sensiData_
Sensitivity configuration data used for the sensitivity run.
const QuantLib::ext::shared_ptr< ScenarioSimMarket > & simMarket() const
QuantLib::ext::shared_ptr< ScenarioSimMarket > simMarket_
Scenario simulation market that is bumped for the sensitivity run.
SensitivityRunner(QuantLib::ext::shared_ptr< Parameters > params, const QuantLib::ext::shared_ptr< ore::data::ReferenceDataManager > &referenceData=nullptr, const IborFallbackConfig &iborFallbackConfig=IborFallbackConfig::defaultConfig(), const bool continueOnError=false)
QuantLib::ext::shared_ptr< Parameters > params_
virtual void sensiInputInitialize(QuantLib::ext::shared_ptr< ScenarioSimMarketParameters > &simMarketData, QuantLib::ext::shared_ptr< SensitivityScenarioData > &sensiData, QuantLib::ext::shared_ptr< EngineData > &engineData, QuantLib::ext::shared_ptr< Portfolio > &sensiPortfolio)
Initialize input parameters to the sensitivities analysis.
QuantLib::ext::shared_ptr< ore::data::ReferenceDataManager > referenceData_
virtual void runSensitivityAnalysis(QuantLib::ext::shared_ptr< ore::data::Market > market, const QuantLib::ext::shared_ptr< ore::data::CurveConfigurations > &curveConfigs, const QuantLib::ext::shared_ptr< ore::data::TodaysMarketParameters > &todaysMarketParams)
virtual void sensiOutputReports(const QuantLib::ext::shared_ptr< SensitivityAnalysis > &sensiAnalysis)
Write out some standard sensitivities reports.
const QuantLib::ext::shared_ptr< SensitivityScenarioData > & sensiData() const
static IborFallbackConfig defaultConfig()
Open Risk Engine setup and analytics choice.
A class to hold Scenario parameters for scenarioSimMarket.
Perform sensitivity analysis for a given portfolio.
A class to hold the parametrisation for building sensitivity scenarios.