Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
creditmigrationcalculator.hpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2023 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/aggregation/creditmigrationcalculator.hpp
20 \brief Exposure calculator
21 \ingroup analytics
22*/
23
24#pragma once
25
28#include <orea/cube/npvcube.hpp>
30
31#include <ql/shared_ptr.hpp>
32
33namespace ore {
34namespace analytics {
35
36using namespace QuantLib;
37using namespace QuantExt;
38using namespace data;
39using namespace std;
40
41//! Credit Migration Calculator
43public:
44 CreditMigrationCalculator(const QuantLib::ext::shared_ptr<Portfolio>& portfolio,
45 const QuantLib::ext::shared_ptr<CreditSimulationParameters>& creditSimulationParameters,
46 const QuantLib::ext::shared_ptr<NPVCube>& cube,
47 const QuantLib::ext::shared_ptr<CubeInterpretation> cubeInterpretation,
48 const QuantLib::ext::shared_ptr<NPVCube>& nettedcube,
49 const QuantLib::ext::shared_ptr<AggregationScenarioData>& aggregationScenarioData,
50 const std::vector<Real>& creditMigrationDistributionGrid,
51 const std::vector<Size>& creditMigrationTimeSteps,
52 const Matrix& creditStateCorrelationMatrix, const std::string baseCurrency);
53
54 void build();
55
56 const std::vector<Real> upperBucketBounds() const { return upperBucketBounds_; }
57 const std::vector<std::vector<Real>> cdf() const { return cdf_; }
58 const std::vector<std::vector<Real>> pdf() const { return pdf_; }
59
60private:
61 QuantLib::ext::shared_ptr<Portfolio> portfolio_;
62 QuantLib::ext::shared_ptr<CreditSimulationParameters> creditSimulationParameters_;
63 QuantLib::ext::shared_ptr<NPVCube> cube_;
64 QuantLib::ext::shared_ptr<CubeInterpretation> cubeInterpretation_;
65 QuantLib::ext::shared_ptr<NPVCube> nettedCube_;
66 QuantLib::ext::shared_ptr<AggregationScenarioData> aggregationScenarioData_;
68 std::vector<Size> creditMigrationTimeSteps_;
70 std::string baseCurrency_;
71
72 std::vector<Real> upperBucketBounds_;
73 std::vector<std::vector<Real>> cdf_;
74 std::vector<std::vector<Real>> pdf_;
75};
76
77} // namespace analytics
78} // namespace ore
const std::vector< std::vector< Real > > cdf() const
QuantLib::ext::shared_ptr< NPVCube > nettedCube_
QuantLib::ext::shared_ptr< AggregationScenarioData > aggregationScenarioData_
QuantLib::ext::shared_ptr< Portfolio > portfolio_
const std::vector< Real > upperBucketBounds() const
QuantLib::ext::shared_ptr< CubeInterpretation > cubeInterpretation_
QuantLib::ext::shared_ptr< CreditSimulationParameters > creditSimulationParameters_
const std::vector< std::vector< Real > > pdf() const
QuantLib::ext::shared_ptr< NPVCube > cube_
Credit simulation parameter class.
class describing the layout of an npv cube and aggregation scenario data
data
The base NPV cube class.