Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
todaysmarketcalibrationinfo.hpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2021 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 marketdata/todaysmarketcalibrationinfo.hpp
20 \brief a container holding information on calibration results during the t0 market build
21 \ingroup marketdata
22*/
23
24#pragma once
25
26#include <ql/math/array.hpp>
27#include <ql/time/date.hpp>
28#include <ql/time/period.hpp>
29#include <ql/utilities/null.hpp>
30
31#include <map>
32#include <string>
33#include <vector>
34
35namespace ore {
36namespace data {
37
38// yield curves
39
42
43 // default periods to determine pillarDates relative to asof
44 const static std::vector<QuantLib::Period> defaultPeriods;
45
46 std::string dayCounter;
47 std::string currency;
48
49 std::vector<QuantLib::Date> pillarDates;
50 std::vector<double> zeroRates;
51 std::vector<double> discountFactors;
52 std::vector<double> times;
53};
54
56 // ... add instrument types?
57};
58
60 std::string fittingMethod;
61 std::vector<double> solution;
62 int iterations = 0;
63 double costValue = QuantLib::Null<QuantLib::Real>();
64 double tolerance = QuantLib::Null<QuantLib::Real>();
65 std::vector<std::string> securities;
66 std::vector<QuantLib::Date> securityMaturityDates;
67 std::vector<double> marketPrices;
68 std::vector<double> modelPrices;
69 std::vector<double> marketYields;
70 std::vector<double> modelYields;
71};
72
73// inflation curves
74
77 std::string dayCounter;
78 std::string calendar;
79 QuantLib::Date baseDate;
80 std::vector<QuantLib::Date> pillarDates;
81 std::vector<double> times;
82};
83
85 double baseCpi = 0.0;
86 std::vector<double> zeroRates;
87 std::vector<double> forwardCpis;
88};
89
91 std::vector<double> yoyRates;
92};
93
94// commodity curves
95
97 virtual ~CommodityCurveCalibrationInfo() = default;
98 std::string dayCounter;
99 std::string calendar;
100 std::string currency;
102 std::vector<QuantLib::Date> pillarDates;
103 std::vector<QuantLib::Real> futurePrices;
104 std::vector<QuantLib::Real> times;
105};
106
107// fx, eq vols
108
111 std::string dayCounter;
112 std::string calendar;
113 std::string atmType;
114 std::string deltaType;
115 std::string longTermAtmType;
116 std::string longTermDeltaType;
117 std::string switchTenor;
119 std::string butterflyStyle;
121 std::vector<QuantLib::Date> expiryDates;
122 std::vector<double> times;
123 std::vector<std::string> deltas;
124 std::vector<double> moneyness;
125 std::vector<double> forwards;
126 std::vector<std::vector<double>> moneynessGridStrikes;
127 std::vector<std::vector<double>> moneynessGridProb;
128 std::vector<std::vector<double>> moneynessGridImpliedVolatility;
129 std::vector<std::vector<double>> deltaGridStrikes;
130 std::vector<std::vector<double>> deltaGridProb;
131 std::vector<std::vector<double>> deltaGridImpliedVolatility;
132 std::vector<std::vector<double>> deltaCallPrices;
133 std::vector<std::vector<double>> deltaPutPrices;
134 std::vector<std::vector<double>> moneynessCallPrices;
135 std::vector<std::vector<double>> moneynessPutPrices;
136 std::vector<std::vector<bool>> moneynessGridCallSpreadArbitrage;
137 std::vector<std::vector<bool>> moneynessGridButterflyArbitrage;
138 std::vector<std::vector<bool>> moneynessGridCalendarArbitrage;
139 std::vector<std::vector<bool>> deltaGridCallSpreadArbitrage;
140 std::vector<std::vector<bool>> deltaGridButterflyArbitrage;
141 std::vector<std::string> messages;
142};
143
144// ir vols
145
148 std::string dayCounter;
149 std::string calendar;
151 std::vector<QuantLib::Date> expiryDates;
152 std::vector<QuantLib::Period> underlyingTenors;
153 std::string volatilityType;
154 std::vector<double> times;
155 std::vector<double> strikeSpreads;
156 std::vector<double> strikes;
157 std::vector<std::vector<double>> forwards;
158 std::vector<std::vector<std::vector<double>>> strikeSpreadGridStrikes;
159 std::vector<std::vector<std::vector<double>>> strikeSpreadGridProb;
160 std::vector<std::vector<std::vector<double>>> strikeSpreadGridImpliedVolatility;
161 std::vector<std::vector<std::vector<double>>> strikeGridStrikes;
162 std::vector<std::vector<std::vector<double>>> strikeGridProb;
163 std::vector<std::vector<std::vector<double>>> strikeGridImpliedVolatility;
164 std::vector<std::vector<std::vector<bool>>> strikeSpreadGridCallSpreadArbitrage;
165 std::vector<std::vector<std::vector<bool>>> strikeSpreadGridButterflyArbitrage;
166 std::vector<std::vector<std::vector<bool>>> strikeGridCallSpreadArbitrage;
167 std::vector<std::vector<std::vector<bool>>> strikeGridButterflyArbitrage;
168 std::vector<std::string> messages;
169};
170
171// main container
172
174 QuantLib::Date asof;
175 // discount, index and yield curves
176 std::map<std::string, QuantLib::ext::shared_ptr<YieldCurveCalibrationInfo>> yieldCurveCalibrationInfo;
177 // equity dividend yield curves
178 std::map<std::string, QuantLib::ext::shared_ptr<YieldCurveCalibrationInfo>> dividendCurveCalibrationInfo;
179 // inflation curves
180 std::map<std::string, QuantLib::ext::shared_ptr<InflationCurveCalibrationInfo>> inflationCurveCalibrationInfo;
181 // commodity curves
182 std::map<std::string, QuantLib::ext::shared_ptr<CommodityCurveCalibrationInfo>> commodityCurveCalibrationInfo;
183 // fx vols
184 std::map<std::string, QuantLib::ext::shared_ptr<FxEqCommVolCalibrationInfo>> fxVolCalibrationInfo;
185 // eq vols
186 std::map<std::string, QuantLib::ext::shared_ptr<FxEqCommVolCalibrationInfo>> eqVolCalibrationInfo;
187 // ir vols (swaption, capfloor)
188 std::map<std::string, QuantLib::ext::shared_ptr<IrVolCalibrationInfo>> irVolCalibrationInfo;
189 // comm vols
190 std::map<std::string, QuantLib::ext::shared_ptr<FxEqCommVolCalibrationInfo>> commVolCalibrationInfo;
191};
192
193} // namespace data
194} // namespace ore
@ data
Definition: log.hpp:77
Serializable Credit Default Swap.
Definition: namespaces.docs:23
virtual ~CommodityCurveCalibrationInfo()=default
std::vector< std::vector< double > > moneynessGridProb
std::vector< std::vector< double > > deltaGridProb
std::vector< std::vector< bool > > deltaGridButterflyArbitrage
std::vector< std::vector< double > > deltaCallPrices
std::vector< std::vector< double > > deltaGridImpliedVolatility
std::vector< std::vector< bool > > moneynessGridCallSpreadArbitrage
std::vector< std::vector< double > > deltaPutPrices
std::vector< std::vector< double > > deltaGridStrikes
std::vector< std::vector< bool > > moneynessGridCalendarArbitrage
std::vector< std::vector< double > > moneynessGridImpliedVolatility
std::vector< std::vector< double > > moneynessCallPrices
std::vector< std::vector< double > > moneynessGridStrikes
std::vector< std::vector< bool > > moneynessGridButterflyArbitrage
std::vector< std::vector< double > > moneynessPutPrices
std::vector< std::vector< bool > > deltaGridCallSpreadArbitrage
std::vector< std::vector< std::vector< bool > > > strikeSpreadGridCallSpreadArbitrage
std::vector< QuantLib::Period > underlyingTenors
std::vector< std::vector< std::vector< double > > > strikeGridProb
std::vector< std::vector< std::vector< bool > > > strikeSpreadGridButterflyArbitrage
std::vector< std::vector< std::vector< double > > > strikeSpreadGridStrikes
std::vector< std::vector< std::vector< bool > > > strikeGridCallSpreadArbitrage
std::vector< std::vector< std::vector< bool > > > strikeGridButterflyArbitrage
std::vector< std::vector< std::vector< double > > > strikeSpreadGridImpliedVolatility
std::vector< std::vector< std::vector< double > > > strikeGridImpliedVolatility
std::vector< std::vector< std::vector< double > > > strikeGridStrikes
std::vector< std::vector< std::vector< double > > > strikeSpreadGridProb
std::vector< std::vector< double > > forwards
std::vector< QuantLib::Date > expiryDates
std::map< std::string, QuantLib::ext::shared_ptr< FxEqCommVolCalibrationInfo > > eqVolCalibrationInfo
std::map< std::string, QuantLib::ext::shared_ptr< YieldCurveCalibrationInfo > > yieldCurveCalibrationInfo
std::map< std::string, QuantLib::ext::shared_ptr< FxEqCommVolCalibrationInfo > > commVolCalibrationInfo
std::map< std::string, QuantLib::ext::shared_ptr< FxEqCommVolCalibrationInfo > > fxVolCalibrationInfo
std::map< std::string, QuantLib::ext::shared_ptr< InflationCurveCalibrationInfo > > inflationCurveCalibrationInfo
std::map< std::string, QuantLib::ext::shared_ptr< YieldCurveCalibrationInfo > > dividendCurveCalibrationInfo
std::map< std::string, QuantLib::ext::shared_ptr< IrVolCalibrationInfo > > irVolCalibrationInfo
std::map< std::string, QuantLib::ext::shared_ptr< CommodityCurveCalibrationInfo > > commodityCurveCalibrationInfo
static const std::vector< QuantLib::Period > defaultPeriods