Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
riskfilter.hpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2017 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 riskfilter.hpp
20 \brief risk class and type filter
21*/
22
23#pragma once
24
27
28#include <ql/types.hpp>
29
30#include <set>
31#include <string>
32#include <vector>
33
34namespace ore {
35namespace analytics {
36
38public:
40
41 /*! Risk class types in VaR plus an All type for convenience
42
43 \warning The ordering here matters. It is used in indexing in to
44 correlation matrices for the correlation between risk classes.
45
46 \warning Internal methods rely on the first element being 'All'
47 */
49
50 /*! Risk Type types in VaR plus an All type for convenience
51 \warning Internal methods rely on the first element being 'All'
52 */
54
55 //! Give back a set containing the RiskClass values optionally excluding 'All'
56 static std::set<RiskClass> riskClasses(bool includeAll = false);
57
58 //! Give back a set containing the RiskType values optionally excluding 'All'
59 static std::set<RiskType> riskTypes(bool includeAll = false);
60};
61
62std::ostream& operator<<(std::ostream& out, const MarketRiskConfiguration::RiskClass& rc);
63std::ostream& operator<<(std::ostream& out, const MarketRiskConfiguration::RiskType& rt);
64
67
68//! Risk Filter
69/*! The risk filter class groups risk factor keys w.r.t. a risk class (IR, FX, EQ...) and a risk type (delta-gamma,
70 * vega, ...). It can e.g. be used to break down a var report.
71 */
72class RiskFilter : public ScenarioFilter {
73public:
75 bool allow(const RiskFactorKey& t) const override;
76
77private:
78 std::set<RiskFactorKey::KeyType> allowed_;
79 bool neg_;
80};
81
82} // namespace analytics
83} // namespace ore
static std::set< RiskClass > riskClasses(bool includeAll=false)
Give back a set containing the RiskClass values optionally excluding 'All'.
Definition: riskfilter.cpp:83
static std::set< RiskType > riskTypes(bool includeAll=false)
Give back a set containing the RiskType values optionally excluding 'All'.
Definition: riskfilter.cpp:95
Data types stored in the scenario class.
Definition: scenario.hpp:48
std::set< RiskFactorKey::KeyType > allowed_
Definition: riskfilter.hpp:78
bool allow(const RiskFactorKey &t) const override
Allow this key to be updated.
Definition: riskfilter.cpp:213
A scenario filter can exclude certain key from updating the scenario.
std::ostream & operator<<(std::ostream &out, EquityReturnType t)
MarketRiskConfiguration::RiskClass parseVarRiskClass(const string &rc)
Definition: riskfilter.cpp:70
MarketRiskConfiguration::RiskType parseVarRiskType(const std::string &rt)
Scenario class.
A Market class that can be updated by Scenarios.