Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
gaussiancamcg.cpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2023 Quaternion Risk Management Ltd
3 All rights reserved.
4*/
5
11
12#include <ql/math/comparison.hpp>
13#include <ql/math/matrixutilities/pseudosqrt.hpp>
14#include <ql/quotes/simplequote.hpp>
19
20namespace ore {
21namespace data {
22
23using namespace QuantLib;
24using namespace QuantExt;
25
27 const Handle<CrossAssetModel>& cam, const Size paths, const std::vector<std::string>& currencies,
28 const std::vector<Handle<YieldTermStructure>>& curves, const std::vector<Handle<Quote>>& fxSpots,
29 const std::vector<std::pair<std::string, QuantLib::ext::shared_ptr<InterestRateIndex>>>& irIndices,
30 const std::vector<std::pair<std::string, QuantLib::ext::shared_ptr<ZeroInflationIndex>>>& infIndices,
31 const std::vector<std::string>& indices, const std::vector<std::string>& indexCurrencies,
32 const std::set<Date>& simulationDates, const Size timeStepsPerYear, const IborFallbackConfig& iborFallbackConfig,
33 const std::vector<Size>& projectedStateProcessIndices,
34 const std::vector<std::string>& conditionalExpectationModelStates, const bool sloppySimDates)
35 : ModelCGImpl(curves.front()->dayCounter(), paths, currencies, irIndices, infIndices, indices, indexCurrencies,
36 simulationDates, iborFallbackConfig),
37 cam_(cam), curves_(curves), fxSpots_(fxSpots), timeStepsPerYear_(timeStepsPerYear),
38 projectedStateProcessIndices_(projectedStateProcessIndices), sloppySimDates_(sloppySimDates) {
39
40 // check inputs
41
42 QL_REQUIRE(!cam_.empty(), "model is empty");
43
44 // check restrictions on cam model (ir-fx with hw, bs and Euler disc only at the moment)
45
46 QL_REQUIRE(cam_->discretization() == CrossAssetModel::Discretization::Euler,
47 "GaussianCamCG requires discretization 'Euler'.");
48
49 QL_REQUIRE(cam_->components(CrossAssetModel::AssetType::IR) > 0, "GaussianCamCG: no IR component given");
50 QL_REQUIRE(cam_->components(CrossAssetModel::AssetType::INF) == 0, "GaussianCamCG: asset type INF not supported");
51 QL_REQUIRE(cam_->components(CrossAssetModel::AssetType::CR) == 0, "GaussianCamCG: asset type CR not supported");
52 QL_REQUIRE(cam_->components(CrossAssetModel::AssetType::EQ) == 0, "GaussianCamCG: asset type EQ not supported");
53 QL_REQUIRE(cam_->components(CrossAssetModel::AssetType::COM) == 0, "GaussianCamCG: asset type COM not supported");
54
55 for (Size i = 0; i < cam_->components(CrossAssetModel::AssetType::IR); ++i) {
56 QL_REQUIRE(cam_->modelType(CrossAssetModel::AssetType::IR, i) == CrossAssetModel::ModelType::LGM1F,
57 "GaussianCamCG: IR model type LGM required.");
58 }
59 for (Size i = 0; i < cam_->components(CrossAssetModel::AssetType::FX); ++i) {
60 QL_REQUIRE(cam_->modelType(CrossAssetModel::AssetType::FX, i) == CrossAssetModel::ModelType::BS,
61 "GaussianCamCG: FX model type BS required.");
62 }
63
64 // register with observables
65
66 for (auto const& o : curves_)
67 registerWith(o);
68 for (auto const& o : fxSpots_)
69 registerWith(o);
70
71 registerWith(cam_);
72
73 // set conditional expectation model states
74
76 conditionalExpectationModelStates.empty() ||
77 std::find(conditionalExpectationModelStates.begin(), conditionalExpectationModelStates.end(), "IR") !=
78 conditionalExpectationModelStates.end();
80 conditionalExpectationModelStates.empty() ||
81 std::find(conditionalExpectationModelStates.begin(), conditionalExpectationModelStates.end(), "INF") !=
82 conditionalExpectationModelStates.end();
84 conditionalExpectationModelStates.empty() ||
85 std::find(conditionalExpectationModelStates.begin(), conditionalExpectationModelStates.end(), "Asset") !=
86 conditionalExpectationModelStates.end();
87
88} // GaussianCamCG ctor
89
90const Date& GaussianCamCG::referenceDate() const {
91 calculate();
92 return referenceDate_;
93}
94
95Size GaussianCamCG::size() const {
96 if (injectedPathTimes_ == nullptr)
97 return ModelCG::size();
98 else {
100 }
101}
102
104
105 // needed for base class performCalculations()
106
107 referenceDate_ = curves_.front()->referenceDate();
108
109 // update cg version if necessary (eval date changed)
110
112
113 // if cg version has changed => update time grid related members and clear paths, so that they
114 // are populated in derived classes
115
117
118 // set up eff sim dates and time grid
119
122 for (auto const& d : simulationDates_) {
123 if (d >= referenceDate())
125 }
126
127 std::vector<Real> times;
128 for (auto const& d : effectiveSimulationDates_) {
129 times.push_back(curves_.front()->timeFromReference(d));
130 }
131
132 Size steps = std::max(std::lround(timeStepsPerYear_ * times.back() + 0.5), 1l);
133 timeGrid_ = TimeGrid(times.begin(), times.end(), steps);
134
135 positionInTimeGrid_.resize(times.size());
136 for (Size i = 0; i < positionInTimeGrid_.size(); ++i)
137 positionInTimeGrid_[i] = timeGrid_.index(times[i]);
138
139 // clear underlying paths
140
141 underlyingPaths_.clear();
143 }
144
145 // noting to do if underlying paths are populated
146
147 if (!underlyingPaths_.empty())
148 return;
149
150 // exit if there are no future simulation dates (i.e. only the reference date)
151
152 if (effectiveSimulationDates_.size() == 1)
153 return;
154
155 // init underlying path where we map a date to a node representing the path value
156
157 for (auto const& d : effectiveSimulationDates_) {
158 underlyingPaths_[d] = std::vector<std::size_t>(indices_.size(), ComputationGraph::nan);
159 irStates_[d] = std::vector<std::size_t>(currencies_.size(), ComputationGraph::nan);
160 infStates_[d] = std::vector<std::pair<std::size_t, std::size_t>>(
162 }
163
164 // populate index mappings
165
168 for (Size i = 0; i < currencies_.size(); ++i) {
170 cam_->pIdx(CrossAssetModel::AssetType::IR, cam_->ccyIndex(parseCurrency(currencies_[i]))));
171 currencyPositionInCam_.push_back(
172 cam_->idx(CrossAssetModel::AssetType::IR, cam_->ccyIndex(parseCurrency(currencies_[i]))));
173 }
174
175 irIndexPositionInCam_.clear();
176 for (Size i = 0; i < irIndices_.size(); ++i) {
177 irIndexPositionInCam_.push_back(cam_->ccyIndex(irIndices_[i].second->currency()));
178 }
179
182 for (Size i = 0; i < infIndices_.size(); ++i) {
183 Size infIdx = cam_->infIndex(infIndices_[i].first.infName());
184 infIndexPositionInProcess_.push_back(cam_->pIdx(CrossAssetModel::AssetType::INF, infIdx));
185 infIndexPositionInCam_.push_back(infIdx);
186 }
187
189 for (Size i = 0; i < indices_.size(); ++i) {
190 if (indices_[i].isFx()) {
191 // FX
192 Size ccyIdx = cam_->ccyIndex(parseCurrency(indexCurrencies_[i]));
193 QL_REQUIRE(ccyIdx > 0, "fx index '" << indices_[i] << "' has unexpected for ccy = base ccy");
194 indexPositionInProcess_.push_back(cam_->pIdx(CrossAssetModel::AssetType::FX, ccyIdx - 1));
195 eqIndexInCam_.push_back(Null<Size>());
196 } else if (indices_[i].isEq()) {
197 // EQ
198 Size eqIdx = cam_->eqIndex(indices_[i].eq()->name());
199 indexPositionInProcess_.push_back(cam_->pIdx(CrossAssetModel::AssetType::EQ, eqIdx));
200 eqIndexInCam_.push_back(eqIdx);
201 } else {
202 QL_FAIL("index '" << indices_[i].name() << "' expected to be FX or EQ");
203 }
204 }
205
206 // set the required random variables to evolve the stochastic process
207
208 randomVariates_ = std::vector<std::vector<std::size_t>>(cam_->brownians() + cam_->auxBrownians(),
209 std::vector<std::size_t>(timeGrid_.size() - 1));
210 for (Size j = 0; j < cam_->brownians() + cam_->auxBrownians(); ++j) {
211 for (Size i = 0; i < timeGrid_.size() - 1; ++i) {
212 randomVariates_[j][i] = cg_insert(*g_);
213 }
214 }
215
216 // evolve the stochastic process, for now we only evolve IR LGM process #0 as a PoC (!)
217
218 auto cam(cam_);
219
220 QL_REQUIRE(timeGrid_.size() == effectiveSimulationDates_.size(),
221 "GaussianCamCG: time grid size ("
222 << timeGrid_.size() << ") does not match effective simulation dates size ("
224 << "), this is currently not supported. The parameter timeStepsPerYear (" << timeStepsPerYear_
225 << ") shoudl be 1");
226
227 // Hull White with zero mean reversion (!) for testing numerical stability
228
229 // std::vector<std::size_t> sigma(timeGrid_.size() - 1);
230 // for (Size i = 0; i < timeGrid_.size() - 1; ++i) {
231 // Real t = timeGrid_[i + 1];
232 // sigma[i] = addModelParameter("__hw_" + currencies_[0] + "_sigma_" + std::to_string(i),
233 // [cam, t] { return cam->irlgm1f(0)->hullWhiteSigma(t); });
234 // }
235
236 // std::size_t last_y = cg_const(*g_, 0.0);
237 // std::vector<std::size_t> y(timeGrid_.size() - 1);
238 // for (Size i = 0; i < timeGrid_.size() - 1; ++i) {
239 // Real t = timeGrid_[i + 1];
240 // Real t0 = timeGrid_[i];
241 // y[i] = cg_add(*g_, last_y, cg_mult(*g_, cg_const(*g_, t - t0), cg_mult(*g_, sigma[i], sigma[i])));
242 // g_->setVariable("__hw_" + currencies_[0] + "_y_" +
243 // ore::data::to_string(*std::next(effectiveSimulationDates_.begin(), i + 1)),
244 // y[i]);
245 // last_y = y[i];
246 // }
247
248 // std::size_t irState = cg_const(*g_, 0.0);
249 // std::size_t I = cg_const(*g_, 0.0);
250 // std::size_t dateIndex = 1;
251 // for (Size i = 0; i < timeGrid_.size() - 1; ++i) {
252 // Real t = timeGrid_[i + 1];
253 // Real t0 = timeGrid_[i];
254 // I = cg_add(*g_, I, cg_mult(*g_, cg_const(*g_, t - t0), irState));
255 // g_->setVariable("__hw_" + currencies_[0] + "_I_" +
256 // ore::data::to_string(*std::next(effectiveSimulationDates_.begin(), i + 1)),
257 // I);
258 // std::size_t drift = cg_mult(*g_, y[i], cg_const(*g_, t - t0));
259 // irState = cg_add(*g_, cg_add(*g_, irState, drift),
260 // cg_mult(*g_, cg_mult(*g_, cg_const(*g_, std::sqrt(t - t0)), sigma[i]), randomVariates_[0][i]));
261 // if (positionInTimeGrid_[dateIndex] == i + 1) {
262 // irStates_[*std::next(effectiveSimulationDates_.begin(), dateIndex)][0] = irState;
263 // ++dateIndex;
264 // }
265 // }
266 // QL_REQUIRE(dateIndex == effectiveSimulationDates_.size(),
267 // "GaussianCamCG:internal error, did not populate all irState time steps.");
268
269 // LGM
270
271 std::size_t lastZeta = cg_const(*g_, 0.0);
272 std::vector<std::size_t> diffusion(timeGrid_.size() - 1);
273 for (Size i = 0; i < timeGrid_.size() - 1; ++i) {
274 std::string id = "__lgm_" + currencies_[0] + "_zeta_" +
275 ore::data::to_string(*std::next(effectiveSimulationDates_.begin(), i + 1));
276 Real t = timeGrid_[i + 1];
277 std::size_t zeta = addModelParameter(id, [cam, t] { return cam->irlgm1f(0)->zeta(t); });
278 diffusion[i] = cg_sqrt(*g_, cg_subtract(*g_, zeta, lastZeta));
279 lastZeta = zeta;
280 }
281
282 std::string id = "__z_0";
283 std::size_t irState;
284 irState = addModelParameter(id, [cam] { return cam->stateProcess()->initialValues()[0]; });
285 irStates_[*effectiveSimulationDates_.begin()][0] = irState;
286
287 std::size_t dateIndex = 1;
288 for (Size i = 0; i < timeGrid_.size() - 1; ++i) {
289 irState = cg_add(*g_, irState, cg_mult(*g_, diffusion[i], randomVariates_[0][i]));
290 if (positionInTimeGrid_[dateIndex] == i + 1) {
291 irStates_[*std::next(effectiveSimulationDates_.begin(), dateIndex)][0] = irState;
292 ++dateIndex;
293 }
294 }
295 QL_REQUIRE(dateIndex == effectiveSimulationDates_.size(),
296 "GaussianCamCG:internal error, did not populate all irState time steps.");
297}
298
299std::size_t GaussianCamCG::getIndexValue(const Size indexNo, const Date& d, const Date& fwd) const {
300 QL_FAIL("GaussianCamCG::getIndexValue(): not implemented");
301}
302
303std::size_t GaussianCamCG::getIrIndexValue(const Size indexNo, const Date& d, const Date& fwd) const {
304 Date fixingDate = d;
305 if (fwd != Null<Date>())
306 fixingDate = fwd;
307 // ensure a valid fixing date
308 fixingDate = irIndices_[indexNo].second->fixingCalendar().adjust(fixingDate);
309 Size currencyIdx = irIndexPositionInCam_[indexNo];
310 auto cam(cam_);
312 LgmCG lgmcg(
313 currencies_[currencyIdx], *g_, [cam, currencyIdx] { return cam->irlgm1f(currencyIdx); }, modelParameters_,
315 return lgmcg.fixing(irIndices_[indexNo].second, fixingDate, sd, irStates_.at(sd).at(currencyIdx));
316 // HwCG hwcg(
317 // currencies_[currencyIdx], *g_, [cam, currencyIdx] { return cam->irlgm1f(currencyIdx); }, modelParameters_,
318 // sloppySimDates_, effectiveSimulationDates_);
319 // return hwcg.fixing(irIndices_[indexNo].second, fixingDate, sd, irStates_.at(sd).at(currencyIdx));
320}
321
322std::size_t GaussianCamCG::getInfIndexValue(const Size indexNo, const Date& d, const Date& fwd) const {
323 QL_FAIL("GaussianCamCG::getInfIndexValue(): not implemented");
324}
325
326std::size_t GaussianCamCG::fwdCompAvg(const bool isAvg, const std::string& indexInput, const Date& obsdate,
327 const Date& start, const Date& end, const Real spread, const Real gearing,
328 const Integer lookback, const Natural rateCutoff, const Natural fixingDays,
329 const bool includeSpread, const Real cap, const Real floor,
330 const bool nakedOption, const bool localCapFloor) const {
331 calculate();
332 QL_FAIL("GaussianCamCG::fwdCompAvg(): not implemented");
333}
334
335std::size_t GaussianCamCG::getDiscount(const Size idx, const Date& s, const Date& t) const {
336 auto cam(cam_);
337 Size cpidx = currencyPositionInCam_[idx];
339 LgmCG lgmcg(
340 currencies_[idx], *g_, [cam, cpidx] { return cam->irlgm1f(cpidx); }, modelParameters_, sloppySimDates_,
342 return lgmcg.discountBond(sd, t, irStates_.at(sd)[idx]);
343 // HwCG hwcg(
344 // currencies_[idx], *g_, [cam, cpidx] { return cam->irlgm1f(cpidx); }, modelParameters_, sloppySimDates_,
345 // effectiveSimulationDates_);
346 // return hwcg.discountBond(sd, t, irStates_.at(sd)[idx]);
347}
348
349std::size_t GaussianCamCG::getNumeraire(const Date& s) const {
350 auto cam(cam_);
351 Size cpidx = currencyPositionInCam_[0];
353 LgmCG lgmcg(
354 currencies_[0], *g_, [cam, cpidx] { return cam->irlgm1f(cpidx); }, modelParameters_, sloppySimDates_,
356 return lgmcg.numeraire(sd, irStates_.at(sd)[0]);
357 // HwCG hwcg(
358 // currencies_[0], *g_, [cam, cpidx] { return cam->irlgm1f(cpidx); }, modelParameters_, sloppySimDates_,
359 // effectiveSimulationDates_);
360 // return hwcg.numeraire(sd, irStates_.at(sd)[0]);
361}
362
363std::size_t GaussianCamCG::getFxSpot(const Size idx) const {
364 std::string id = "__fxspot_" + std::to_string(idx);
365 auto c = fxSpots_.at(idx);
366 return addModelParameter(id, [c] { return c->value(); });
367}
368
369Real GaussianCamCG::getDirectFxSpotT0(const std::string& forCcy, const std::string& domCcy) const {
370 auto c1 = std::find(currencies_.begin(), currencies_.end(), forCcy);
371 auto c2 = std::find(currencies_.begin(), currencies_.end(), domCcy);
372 QL_REQUIRE(c1 != currencies_.end(), "currency " << forCcy << " not handled");
373 QL_REQUIRE(c2 != currencies_.end(), "currency " << domCcy << " not handled");
374 Size cidx1 = std::distance(currencies_.begin(), c1);
375 Size cidx2 = std::distance(currencies_.begin(), c2);
376 Real fx = 1.0;
377 if (cidx1 > 0)
378 fx *= fxSpots_.at(cidx1 - 1)->value();
379 if (cidx2 > 0)
380 fx /= fxSpots_.at(cidx2 - 1)->value();
381 return fx;
382}
383
384Real GaussianCamCG::getDirectDiscountT0(const Date& paydate, const std::string& currency) const {
385 auto c = std::find(currencies_.begin(), currencies_.end(), currency);
386 QL_REQUIRE(c != currencies_.end(), "currency " << currency << " not handled");
387 Size cidx = std::distance(currencies_.begin(), c);
388 return curves_.at(cidx)->discount(paydate);
389}
390
391std::size_t GaussianCamCG::npv(const std::size_t amount, const Date& obsdate, const std::size_t filter,
392 const boost::optional<long>& memSlot, const std::size_t addRegressor1,
393 const std::size_t addRegressor2) const {
394
395 calculate();
396
397 QL_REQUIRE(!memSlot, "GuassiaCamCG::npv() with memSlot not yet supported!");
398
399 // if obsdate is today, take a plain expectation
400
401 if (obsdate == referenceDate()) {
402 return cg_conditionalExpectation(*g_, amount, {}, cg_const(*g_, 1.0));
403 }
404
405 // build the state
406
407 std::vector<std::size_t> state;
408
410 state.push_back(irStates_.at(sd).at(0));
411
412 if (addRegressor1 != ComputationGraph::nan)
413 state.push_back(addRegressor1);
414 if (addRegressor2 != ComputationGraph::nan)
415 state.push_back(addRegressor2);
416
417 // if the state is empty, return the plain expectation (no conditioning)
418
419 if (state.empty()) {
420 return cg_conditionalExpectation(*g_, amount, {}, cg_const(*g_, 1.0));
421 }
422
423 // if a memSlot is given and coefficients are stored, we use them
424 // TODO ...
425
426 // otherwise compute coefficients and store them if a memSlot is given
427 // TODO ...
428
429 // compute conditional expectation and return the result
430
431 return cg_conditionalExpectation(*g_, amount, state, filter);
432}
433
434} // namespace data
435} // namespace ore
static std::size_t nan
void performCalculations() const override
std::map< Date, std::vector< std::size_t > > underlyingPaths_
std::size_t npv(const std::size_t amount, const Date &obsdate, const std::size_t filter, const boost::optional< long > &memSlot, const std::size_t addRegressor1, const std::size_t addRegressor2) const override
QuantLib::Size size() const override
std::size_t underlyingPathsCgVersion_
std::vector< Size > infIndexPositionInCam_
std::vector< Size > infIndexPositionInProcess_
std::size_t getNumeraire(const Date &s) const override
std::vector< Size > indexPositionInProcess_
std::vector< Size > eqIndexInCam_
std::size_t getFxSpot(const Size idx) const override
Real getDirectFxSpotT0(const std::string &forCcy, const std::string &domCcy) const override
std::size_t getInfIndexValue(const Size indexNo, const Date &d, const Date &fwd=Null< Date >()) const override
const std::vector< QuantLib::Real > * injectedPathTimes_
const Date & referenceDate() const override
Real getDirectDiscountT0(const Date &paydate, const std::string &currency) const override
std::vector< Size > currencyPositionInProcess_
std::vector< Size > irIndexPositionInCam_
std::map< Date, std::vector< std::pair< std::size_t, std::size_t > > > infStates_
GaussianCamCG(const Handle< CrossAssetModel > &cam, const Size paths, const std::vector< std::string > &currencies, const std::vector< Handle< YieldTermStructure > > &curves, const std::vector< Handle< Quote > > &fxSpots, const std::vector< std::pair< std::string, QuantLib::ext::shared_ptr< InterestRateIndex > > > &irIndices, const std::vector< std::pair< std::string, QuantLib::ext::shared_ptr< ZeroInflationIndex > > > &infIndices, const std::vector< std::string > &indices, const std::vector< std::string > &indexCurrencies, const std::set< Date > &simulationDates, const Size timeStepsPerYear=1, const IborFallbackConfig &iborFallbackConfig=IborFallbackConfig::defaultConfig(), const std::vector< Size > &projectedStateProcessIndices={}, const std::vector< std::string > &conditionalExpectationModelStates={}, const bool sloppySimDates=false)
std::vector< Size > currencyPositionInCam_
const Handle< CrossAssetModel > cam_
std::set< Date > effectiveSimulationDates_
std::size_t getIrIndexValue(const Size indexNo, const Date &d, const Date &fwd=Null< Date >()) const override
std::map< Date, std::vector< std::size_t > > irStates_
const std::vector< Handle< Quote > > fxSpots_
std::size_t fwdCompAvg(const bool isAvg, const std::string &indexInput, const Date &obsdate, const Date &start, const Date &end, const Real spread, const Real gearing, const Integer lookback, const Natural rateCutoff, const Natural fixingDays, const bool includeSpread, const Real cap, const Real floor, const bool nakedOption, const bool localCapFloor) const override
std::size_t getDiscount(const Size idx, const Date &s, const Date &t) const override
std::size_t getIndexValue(const Size indexNo, const Date &d, const Date &fwd=Null< Date >()) const override
const std::vector< Handle< YieldTermStructure > > curves_
std::vector< Size > positionInTimeGrid_
std::size_t numeraire(const Date &d, const std::size_t x, const Handle< YieldTermStructure > &discountCurve=Handle< YieldTermStructure >(), const std::string &discountCurveId="default") const
Definition: lgmcg.cpp:34
std::size_t fixing(const QuantLib::ext::shared_ptr< InterestRateIndex > &index, const Date &fixingDate, const Date &t, const std::size_t x) const
Definition: lgmcg.cpp:105
std::size_t discountBond(const Date &d, const Date &e, const std::size_t x, const Handle< YieldTermStructure > &discountCurve=Handle< YieldTermStructure >(), const std::string &discountCurveId="default") const
Definition: lgmcg.cpp:60
QuantLib::ext::shared_ptr< QuantExt::ComputationGraph > g_
Definition: modelcg.hpp:149
void calculate() const override
Definition: modelcg.hpp:142
virtual QuantLib::Size size() const
Definition: modelcg.hpp:62
std::size_t addModelParameter(const std::string &id, std::function< double(void)> f) const
void performCalculations() const override
const std::vector< std::string > currencies_
std::vector< std::vector< size_t > > randomVariates_
std::size_t cgVersion() const override
std::vector< std::pair< std::size_t, std::function< double(void)> > > modelParameters_
std::vector< std::pair< IndexInfo, QuantLib::ext::shared_ptr< ZeroInflationIndex > > > infIndices_
std::vector< IndexInfo > indices_
std::vector< std::pair< IndexInfo, QuantLib::ext::shared_ptr< InterestRateIndex > > > irIndices_
const std::vector< std::string > indexCurrencies_
const std::set< Date > simulationDates_
SafeStack< Filter > filter
Gaussian CAM model.
Currency parseCurrency(const string &s)
Convert text to QuantLib::Currency.
Definition: parsers.cpp:290
Map text representations to QuantLib/QuantExt types.
computation graph based lgm model calculations
@ data
Definition: log.hpp:77
QuantLib::Date fixingDate(const QuantLib::Date &d, const QuantLib::Period obsLag, const QuantLib::Frequency freq, bool interpolated)
std::size_t cg_const(ComputationGraph &g, const double value)
std::size_t cg_subtract(ComputationGraph &g, const std::size_t a, const std::size_t b, const std::string &label)
std::size_t cg_mult(ComputationGraph &g, const std::size_t a, const std::size_t b, const std::string &label)
std::size_t cg_add(ComputationGraph &g, const std::size_t a, const std::size_t b, const std::string &label)
std::size_t cg_conditionalExpectation(ComputationGraph &g, const std::size_t regressand, const std::vector< std::size_t > &regressor, const std::size_t filter, const std::string &label)
std::size_t cg_sqrt(ComputationGraph &g, const std::size_t a, const std::string &label)
std::string to_string(const LocationInfo &l)
Definition: ast.cpp:28
Date getSloppyDate(const Date &d, const bool sloppyDates, const std::set< Date > &dates)
Serializable Credit Default Swap.
Definition: namespaces.docs:23
std::vector< Size > steps
string conversion utilities
string name