Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
scenarioutilities.hpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2024 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 scenario/scenarioutilities.hpp
20 \brief Scenario utility functions
21 \ingroup scenario
22*/
23
24#pragma once
25
27
28#include <set>
29
30namespace ore {
31namespace analytics {
32
33Real getDifferenceScenario(const RiskFactorKey::KeyType keyType, const Real v1, const Real v2);
34
35QuantLib::ext::shared_ptr<Scenario> getDifferenceScenario(const QuantLib::ext::shared_ptr<Scenario>& s1,
36 const QuantLib::ext::shared_ptr<Scenario>& s2,
37 const Date& targetScenarioAsOf = Date(),
38 const Real targetScenarioNumeraire = 0.0);
39
40Real addDifferenceToScenario(const RiskFactorKey::KeyType keyType, const Real v, const Real d);
41
42QuantLib::ext::shared_ptr<Scenario> addDifferenceToScenario(const QuantLib::ext::shared_ptr<Scenario>& s,
43 const QuantLib::ext::shared_ptr<Scenario>& d,
44 const Date& targetScenarioAsOf = Date(),
45 const Real targetScenarioNumeraire = 0.0);
46
47QuantLib::ext::shared_ptr<Scenario> recastScenario(
48 const QuantLib::ext::shared_ptr<Scenario>& scenario,
49 const std::map<std::pair<RiskFactorKey::KeyType, std::string>, std::vector<std::vector<Real>>>& oldCoordinates,
50 const std::map<std::pair<RiskFactorKey::KeyType, std::string>, std::vector<std::vector<Real>>>& newCoordinates);
51
52QuantLib::ext::shared_ptr<Scenario> recastScenario(
53 const QuantLib::ext::shared_ptr<Scenario>& scenario,
54 const std::map<std::pair<RiskFactorKey::KeyType, std::string>, std::vector<std::vector<Real>>>& oldCoordinates,
55 const std::set<std::tuple<RiskFactorKey::KeyType, std::string, std::vector<std::vector<Real>>>>& newCoordinates);
56
57} // namespace analytics
58} // namespace ore
KeyType
Risk Factor types.
Definition: scenario.hpp:51
Real getDifferenceScenario(const RiskFactorKey::KeyType keyType, const Real v1, const Real v2)
QuantLib::ext::shared_ptr< Scenario > recastScenario(const QuantLib::ext::shared_ptr< Scenario > &scenario, const std::map< std::pair< RiskFactorKey::KeyType, std::string >, std::vector< std::vector< Real > > > &oldCoordinates, const std::map< std::pair< RiskFactorKey::KeyType, std::string >, std::vector< std::vector< Real > > > &newCoordinates)
Real addDifferenceToScenario(const RiskFactorKey::KeyType keyType, const Real v, const Real d)
Scenario class.