Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
Public Member Functions | Static Public Attributes | List of all members
ParStressConversionAnalyticImpl Class Reference

#include <orea/app/analytics/parstressconversionanalytic.hpp>

+ Inheritance diagram for ParStressConversionAnalyticImpl:
+ Collaboration diagram for ParStressConversionAnalyticImpl:

Public Member Functions

 ParStressConversionAnalyticImpl (const boost::shared_ptr< InputParameters > &inputs)
 
void runAnalytic (const boost::shared_ptr< ore::data::InMemoryLoader > &loader, const std::set< std::string > &runTypes={}) override
 
void setUpConfigurations () override
 
- Public Member Functions inherited from Analytic::Impl
 Impl ()
 
 Impl (const QuantLib::ext::shared_ptr< InputParameters > &inputs)
 
virtual ~Impl ()
 
virtual void runAnalytic (const QuantLib::ext::shared_ptr< ore::data::InMemoryLoader > &loader, const std::set< std::string > &runTypes={})=0
 
virtual void setUpConfigurations ()
 
virtual QuantLib::ext::shared_ptr< ore::data::EngineFactoryengineFactory ()
 build an engine factory More...
 
void setLabel (const string &label)
 
const std::string & label () const
 
void setAnalytic (Analytic *analytic)
 
Analyticanalytic () const
 
void setInputs (const QuantLib::ext::shared_ptr< InputParameters > &inputs)
 
bool generateAdditionalResults () const
 
void setGenerateAdditionalResults (const bool generateAdditionalResults)
 
bool hasDependentAnalytic (const std::string &key)
 
template<class T >
QuantLib::ext::shared_ptr< T > dependentAnalytic (const std::string &key) const
 
QuantLib::ext::shared_ptr< AnalyticdependentAnalytic (const std::string &key) const
 
const std::map< std::string, QuantLib::ext::shared_ptr< Analytic > > & dependentAnalytics () const
 
void addDependentAnalytic (const std::string &key, const QuantLib::ext::shared_ptr< Analytic > &analytic)
 
std::vector< QuantLib::ext::shared_ptr< Analytic > > allDependentAnalytics () const
 
virtual std::vector< QuantLib::Date > additionalMarketDates () const
 

Static Public Attributes

static constexpr const char * LABEL = "PARSTRESSCONVERSION"
 

Additional Inherited Members

- Protected Attributes inherited from Analytic::Impl
QuantLib::ext::shared_ptr< InputParametersinputs_
 
std::string label_
 label for logging purposes primarily More...
 
std::map< std::string, QuantLib::ext::shared_ptr< Analytic > > dependentAnalytics_
 

Detailed Description

Definition at line 28 of file parstressconversionanalytic.hpp.

Constructor & Destructor Documentation

◆ ParStressConversionAnalyticImpl()

ParStressConversionAnalyticImpl ( const boost::shared_ptr< InputParameters > &  inputs)

Definition at line 32 of file parstressconversionanalytic.hpp.

32 : Analytic::Impl(inputs) {
34 }
void setLabel(const string &label)
Definition: analytic.hpp:189
+ Here is the call graph for this function:

Member Function Documentation

◆ runAnalytic()

void runAnalytic ( const boost::shared_ptr< ore::data::InMemoryLoader > &  loader,
const std::set< std::string > &  runTypes = {} 
)
override

Definition at line 39 of file parstressconversionanalytic.cpp.

40 {
41 if (!analytic()->match(runTypes))
42 return;
43
44 LOG("ParStressConversionAnalytic::runAnalytic called");
45
46 Settings::instance().evaluationDate() = inputs_->asof();
47 ObservationMode::instance().setMode(inputs_->observationModel());
48
49 CONSOLEW("ParStressConversionAnalytic: Build Market");
50 analytic()->buildMarket(loader);
51 CONSOLE("OK");
52
53 CONSOLEW("ParStressConversionAnalytic: Convert ParStressScenario");
54 LOG("Par Stress Conversion Analysis called");
55 QuantLib::ext::shared_ptr<StressTestScenarioData> scenarioData = inputs_->parStressScenarioData();
56 if (scenarioData != nullptr && scenarioData->hasScenarioWithParShifts()) {
57 ParStressTestConverter converter(
58 inputs_->asof(), analytic()->configurations().todaysMarketParams,
59 analytic()->configurations().simMarketParams, analytic()->configurations().sensiScenarioData,
60 analytic()->configurations().curveConfig, analytic()->market(), inputs_->iborFallbackConfig());
61 scenarioData = converter.convertStressScenarioData(scenarioData);
62 analytic()->stressTests()[label()]["parStress_ZeroStressData"] = scenarioData;
63 LOG("Finished par to zero scenarios conversion");
64 }
65 CONSOLE("OK");
66}
Analytic * analytic() const
Definition: analytic.hpp:193
const std::string & label() const
Definition: analytic.hpp:190
QuantLib::ext::shared_ptr< InputParameters > inputs_
Definition: analytic.hpp:216
analytic_stresstests & stressTests()
Definition: analytic.hpp:134
virtual void buildMarket(const QuantLib::ext::shared_ptr< ore::data::InMemoryLoader > &loader, const bool marketRequired=true)
Definition: analytic.cpp:178
#define LOG(text)
#define CONSOLEW(text)
#define CONSOLE(text)
+ Here is the call graph for this function:

◆ setUpConfigurations()

void setUpConfigurations ( )
overridevirtual

Reimplemented from Analytic::Impl.

Definition at line 29 of file parstressconversionanalytic.cpp.

29 {
30 const auto stressData = inputs_->parStressScenarioData();
33 analytic()->configurations().todaysMarketParams = inputs_->todaysMarketParams();
34 analytic()->configurations().simMarketParams = inputs_->parStressSimMarketParams();
35 analytic()->configurations().sensiScenarioData = inputs_->parStressSensitivityScenarioData();
37}
void setGenerateAdditionalResults(const bool generateAdditionalResults)
Definition: analytic.hpp:197
Configurations & configurations()
Definition: analytic.hpp:128
QuantLib::ext::shared_ptr< ore::analytics::SensitivityScenarioData > sensiScenarioData
Definition: analytic.hpp:70
QuantLib::ext::shared_ptr< ore::data::TodaysMarketParameters > todaysMarketParams
Definition: analytic.hpp:68
bool simulationConfigRequired
Booleans to determine if these configs are needed.
Definition: analytic.hpp:64
QuantLib::ext::shared_ptr< ore::analytics::ScenarioSimMarketParameters > simMarketParams
Definition: analytic.hpp:69
+ Here is the call graph for this function:

Member Data Documentation

◆ LABEL

constexpr const char* LABEL = "PARSTRESSCONVERSION"
staticconstexpr

Definition at line 30 of file parstressconversionanalytic.hpp.