Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
varanalytic.hpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2022 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/analytic.hpp
20 \brief ORE Analytics Manager
21*/
22
23#pragma once
24
25#include <orea/app/analytic.hpp>
28
29namespace ore {
30namespace analytics {
31
33public:
34 VarAnalyticImpl(const QuantLib::ext::shared_ptr<InputParameters>& inputs, const string& label)
35 : Analytic::Impl(inputs) {
37 }
38 virtual void runAnalytic(const QuantLib::ext::shared_ptr<ore::data::InMemoryLoader>& loader,
39 const std::set<std::string>& runTypes = {}) override;
40 virtual void setUpConfigurations() override;
41
42protected:
43 QuantLib::ext::shared_ptr<VarReport> varReport_;
44
45 virtual void setVarReport(const QuantLib::ext::shared_ptr<ore::data::InMemoryLoader>& loader){};
46};
47
48class VarAnalytic : public Analytic {
49public:
50 VarAnalytic(std::unique_ptr<Analytic::Impl> impl, const std::set<std::string>& analyticTypes,
51 const QuantLib::ext::shared_ptr<InputParameters>& inputs, bool simulationConfig = false,
52 bool sensitivityConfig = false)
53 : Analytic(std::move(impl), analyticTypes, inputs, simulationConfig, sensitivityConfig, false, false) {}
54};
55
57public:
58 static constexpr const char* LABEL = "PARAMETRIC_VAR";
59
60 ParametricVarAnalyticImpl(const QuantLib::ext::shared_ptr<InputParameters>& inputs)
61 : VarAnalyticImpl(inputs, LABEL) {};
62
63 virtual void setUpConfigurations() override;
64 virtual QuantLib::ext::shared_ptr<SensitivityStream>
65 sensiStream(const QuantLib::ext::shared_ptr<ore::data::InMemoryLoader>& loader) {
66 return inputs_->sensitivityStream();
67 };
68
69protected:
70 void setVarReport(const QuantLib::ext::shared_ptr<ore::data::InMemoryLoader>& loader) override;
71};
72
74public:
75 ParametricVarAnalytic(const QuantLib::ext::shared_ptr<InputParameters>& inputs)
76 : VarAnalytic(std::make_unique<ParametricVarAnalyticImpl>(inputs), {"PARAMETRIC_VAR"}, inputs) {}
77
78};
79
81public:
82 static constexpr const char* LABEL = "HISTSIM_VAR";
83
84 HistoricalSimulationVarAnalyticImpl(const QuantLib::ext::shared_ptr<InputParameters>& inputs)
85 : VarAnalyticImpl(inputs, LABEL) {}
86 void setUpConfigurations() override;
87
88protected:
89 void setVarReport(const QuantLib::ext::shared_ptr<ore::data::InMemoryLoader>& loader) override;
90};
91
93public:
94 HistoricalSimulationVarAnalytic(const QuantLib::ext::shared_ptr<InputParameters>& inputs)
95 : VarAnalytic(std::make_unique<HistoricalSimulationVarAnalyticImpl>(inputs), {"HISTSIM_VAR"}, inputs, true) {}
96};
97
98} // namespace analytics
99} // namespace oreplus
ORE Analytics Manager.
void setLabel(const string &label)
Definition: analytic.hpp:189
const std::string & label() const
Definition: analytic.hpp:190
QuantLib::ext::shared_ptr< InputParameters > inputs_
Definition: analytic.hpp:216
const std::unique_ptr< Impl > & impl()
Definition: analytic.hpp:142
const QuantLib::ext::shared_ptr< InputParameters > & inputs() const
Definition: analytic.hpp:116
const std::set< std::string > & analyticTypes() const
Definition: analytic.hpp:115
HistoricalSimulationVarAnalytic(const QuantLib::ext::shared_ptr< InputParameters > &inputs)
Definition: varanalytic.hpp:94
void setVarReport(const QuantLib::ext::shared_ptr< ore::data::InMemoryLoader > &loader) override
HistoricalSimulationVarAnalyticImpl(const QuantLib::ext::shared_ptr< InputParameters > &inputs)
Definition: varanalytic.hpp:84
ParametricVarAnalytic(const QuantLib::ext::shared_ptr< InputParameters > &inputs)
Definition: varanalytic.hpp:75
virtual void setUpConfigurations() override
Definition: varanalytic.cpp:78
virtual QuantLib::ext::shared_ptr< SensitivityStream > sensiStream(const QuantLib::ext::shared_ptr< ore::data::InMemoryLoader > &loader)
Definition: varanalytic.hpp:65
ParametricVarAnalyticImpl(const QuantLib::ext::shared_ptr< InputParameters > &inputs)
Definition: varanalytic.hpp:60
void setVarReport(const QuantLib::ext::shared_ptr< ore::data::InMemoryLoader > &loader) override
Definition: varanalytic.cpp:86
static constexpr const char * LABEL
Definition: varanalytic.hpp:58
VarAnalytic(std::unique_ptr< Analytic::Impl > impl, const std::set< std::string > &analyticTypes, const QuantLib::ext::shared_ptr< InputParameters > &inputs, bool simulationConfig=false, bool sensitivityConfig=false)
Definition: varanalytic.hpp:50
virtual void setUpConfigurations() override
Definition: varanalytic.cpp:39
virtual void runAnalytic(const QuantLib::ext::shared_ptr< ore::data::InMemoryLoader > &loader, const std::set< std::string > &runTypes={}) override
Definition: varanalytic.cpp:43
VarAnalyticImpl(const QuantLib::ext::shared_ptr< InputParameters > &inputs, const string &label)
Definition: varanalytic.hpp:34
virtual void setVarReport(const QuantLib::ext::shared_ptr< ore::data::InMemoryLoader > &loader)
Definition: varanalytic.hpp:45
QuantLib::ext::shared_ptr< VarReport > varReport_
Definition: varanalytic.hpp:43
Base class for a var calculation.