QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
yoycapfloortermpricesurface.hpp
Go to the documentation of this file.
1/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
3/*
4 Copyright (C) 2009 Chris Kenyon
5 Copyright (C) 2009 Bernd Engelmann
6
7 This file is part of QuantLib, a free-software/open-source library
8 for financial quantitative analysts and developers - http://quantlib.org/
9
10 QuantLib is free software: you can redistribute it and/or modify it
11 under the terms of the QuantLib license. You should have received a
12 copy of the license along with this program; if not, please email
13 <quantlib-dev@lists.sf.net>. The license is also available online at
14 <http://quantlib.org/license.shtml>.
15
16 This program is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
18 FOR A PARTICULAR PURPOSE. See the license for more details.
19*/
20
21/*! \file yoycapfloortermpricesurface.hpp
22 \brief yoy inflation cap and floor term-price structure
23*/
24
25#ifndef quantlib_yoy_capfloor_term_price_surface_hpp
26#define quantlib_yoy_capfloor_term_price_surface_hpp
27
32#include <cmath>
33
34namespace QuantLib {
35
36 //! Abstract base class, inheriting from InflationTermStructure
37 /*! Since this can create a yoy term structure it does take
38 a YoY index.
39
40 \todo deal with index interpolation.
41 */
43 public:
45 const Period& yyLag,
46 const ext::shared_ptr<YoYInflationIndex>& yii,
47 Rate baseRate,
49 const DayCounter& dc,
50 const Calendar& cal,
51 const BusinessDayConvention& bdc,
52 const std::vector<Rate>& cStrikes,
53 const std::vector<Rate>& fStrikes,
54 const std::vector<Period>& cfMaturities,
55 const Matrix& cPrice,
56 const Matrix& fPrice);
57
58 bool indexIsInterpolated() const;
59 virtual Period observationLag() const;
60 virtual Frequency frequency() const;
61
62 //! atm yoy swaps from put-call parity on cap/floor data
63 /*! uses interpolation (on surface price data), yearly maturities. */
64 virtual std::pair<std::vector<Time>, std::vector<Rate> >
66 virtual std::pair<std::vector<Date>, std::vector<Rate> >
68
69 //! derived from yoy swap rates
70 virtual ext::shared_ptr<YoYInflationTermStructure> YoYTS() const = 0;
71 //! index yoy is based on
72 ext::shared_ptr<YoYInflationIndex> yoyIndex() const { return yoyIndex_; }
73
74 //! inspectors
75 /*! \note you don't know if price() is a cap or a floor
76 without checking the YoYSwapATM level.
77 \note atm cap/floor prices are generally
78 inaccurate because they are from extrapolation
79 and intersection.
80 */
81 //@{
83 virtual Natural fixingDays() const {return fixingDays_;}
84 virtual Date baseDate() const = 0;
85 virtual Real price(const Date& d, Rate k) const = 0;
86 virtual Real capPrice(const Date& d, Rate k) const = 0;
87 virtual Real floorPrice(const Date& d, Rate k) const = 0;
88 virtual Rate atmYoYSwapRate(const Date &d,
89 bool extrapolate = true) const = 0;
90 virtual Rate atmYoYRate(const Date &d,
91 const Period &obsLag = Period(-1,Days),
92 bool extrapolate = true) const = 0;
93
94 virtual Real price(const Period& d, Rate k) const;
95 virtual Real capPrice(const Period& d, Rate k) const;
96 virtual Real floorPrice(const Period& d, Rate k) const;
97 virtual Rate atmYoYSwapRate(const Period &d,
98 bool extrapolate = true) const;
99 virtual Rate atmYoYRate(const Period &d,
100 const Period &obsLag = Period(-1,Days),
101 bool extrapolate = true) const;
102
103 virtual std::vector<Rate> strikes() const {return cfStrikes_;}
104 virtual std::vector<Rate> capStrikes() const {return cStrikes_;}
105 virtual std::vector<Rate> floorStrikes() const {return fStrikes_;}
106 virtual std::vector<Period> maturities() const {return cfMaturities_;}
107 virtual Rate minStrike() const {return cfStrikes_.front();};
108 virtual Rate maxStrike() const {return cfStrikes_.back();};
109 virtual Date minMaturity() const {return referenceDate()+cfMaturities_.front();}// \TODO deal with index interpolation
110 virtual Date maxMaturity() const {return referenceDate()+cfMaturities_.back();}
111 //@}
112
113 virtual Date yoyOptionDateFromTenor(const Period& p) const;
114
115 protected:
116 virtual bool checkStrike(Rate K) {
117 return ( minStrike() <= K && K <= maxStrike() );
118 }
119 virtual bool checkMaturity(const Date& d) {
120 return ( minMaturity() <= d && d <= maxMaturity() );
121 }
122
123 // defaults, mostly used for building yoy-fwd curve from put-call parity
124 // ext::shared_ptr<YieldTermStructure> nominal_;
125 // Period lag_;
126 // Calendar cal_;
129 ext::shared_ptr<YoYInflationIndex> yoyIndex_;
132 // data
133 std::vector<Rate> cStrikes_;
134 std::vector<Rate> fStrikes_;
135 std::vector<Period> cfMaturities_;
136 mutable std::vector<Real> cfMaturityTimes_;
140 // constructed
141 mutable std::vector<Rate> cfStrikes_;
142 mutable ext::shared_ptr<YoYInflationTermStructure> yoy_;
143 mutable std::pair<std::vector<Time>, std::vector<Rate> > atmYoYSwapTimeRates_;
144 mutable std::pair<std::vector<Date>, std::vector<Rate> > atmYoYSwapDateRates_;
145 };
146
147
148 template<class Interpolator2D, class Interpolator1D>
151 public:
154 const Period &yyLag, // observation lag
155 const ext::shared_ptr<YoYInflationIndex>& yii,
156 Rate baseRate,
157 const Handle<YieldTermStructure> &nominal,
158 const DayCounter &dc,
159 const Calendar &cal,
160 const BusinessDayConvention &bdc,
161 const std::vector<Rate> &cStrikes,
162 const std::vector<Rate> &fStrikes,
163 const std::vector<Period> &cfMaturities,
164 const Matrix &cPrice,
165 const Matrix &fPrice,
166 const Interpolator2D &interpolator2d = Interpolator2D(),
167 const Interpolator1D &interpolator1d = Interpolator1D());
168
169 //! inflation term structure interface
170 //@{
171 Date maxDate() const override { return yoy_->maxDate(); }
172 Date baseDate() const override { return yoy_->baseDate(); }
173 //@}
174 Natural fixingDays() const override { return fixingDays_; }
175
176 //! \name YoYCapFloorTermPriceSurface interface
177 //@{
178 std::pair<std::vector<Time>, std::vector<Rate> > atmYoYSwapTimeRates() const override {
180 }
181 std::pair<std::vector<Date>, std::vector<Rate> > atmYoYSwapDateRates() const override {
183 }
184 ext::shared_ptr<YoYInflationTermStructure> YoYTS() const override { return yoy_; }
185 Rate price(const Date& d, Rate k) const override;
186 Real floorPrice(const Date& d, Rate k) const override;
187 Real capPrice(const Date& d, Rate k) const override;
188 Rate atmYoYSwapRate(const Date& d, bool extrapolate = true) const override {
189 return atmYoYSwapRateCurve_(timeFromReference(d),extrapolate);
190 }
192 const Period& obsLag = Period(-1, Days),
193 bool extrapolate = true) const override {
194 // work in terms of maturity-of-instruments
195 // so ask for rate with observation lag
196 Period p = (obsLag == Period(-1, Days)) ? observationLag() : obsLag;
197 // Third parameter = force linear interpolation of yoy
198 return yoy_->yoyRate(d, p, false, extrapolate);
199 }
200 //@}
201
202 //! \name LazyObject interface
203 //@{
204 void update() override;
205 void performCalculations() const;
206 //@}
207
208 protected:
209 //! intersection of cap and floor price surfaces at given strikes
210 void intersect() const;
212 public:
214 Real operator()(Rate guess) const;
215 protected:
216 const Time t_;
217 const Interpolation2D &a_, &b_; // work on references
218 };
219
220 //! mess of making it, i.e. create instruments from quotes and bootstrap
221 void calculateYoYTermStructure() const;
222
223 // data for surfaces and curve
224 mutable std::vector<Rate> cStrikesB_;
225 mutable std::vector<Rate> fStrikesB_;
230 mutable Interpolator2D interpolator2d_;
233 };
234
235
236 // inline definitions
237
240 }
241
243 return observationLag_;
244 }
245
247 return yoyIndex_->frequency();
248 }
249
250 // template definitions
251
252 #ifndef __DOXYGEN__
253
254 template<class I2D, class I1D>
257 Natural fixingDays,
258 const Period &yyLag,
259 const ext::shared_ptr<YoYInflationIndex>& yii,
260 Rate baseRate,
261 const Handle<YieldTermStructure> &nominal,
262 const DayCounter &dc,
263 const Calendar &cal,
264 const BusinessDayConvention &bdc,
265 const std::vector<Rate> &cStrikes,
266 const std::vector<Rate> &fStrikes,
267 const std::vector<Period> &cfMaturities,
268 const Matrix &cPrice,
269 const Matrix &fPrice,
270 const I2D &interpolator2d,
271 const I1D &interpolator1d)
272 : YoYCapFloorTermPriceSurface(fixingDays, yyLag, yii,
273 baseRate, nominal, dc, cal, bdc,
274 cStrikes, fStrikes, cfMaturities,
275 cPrice, fPrice),
276 interpolator2d_(interpolator2d), interpolator1d_(interpolator1d) {
277 performCalculations();
278 }
279
280 #endif
281
282 template<class I2D, class I1D>
284 update() {
285 notifyObservers();
286 }
287
288
289 template<class I2D, class I1D>
291 performCalculations() const {
292 // calculate all the useful things
293 // ... first the intersection of the cap and floor surfs
294 intersect();
295
296 // ... then the yoy term structure, which requires instruments
297 // and a bootstrap
298 calculateYoYTermStructure();
299 }
300
301
302 template<class I2D, class I1D>
305 const Interpolation2D &a,
306 const Interpolation2D &b)
307 : t_(t), a_(a), b_(b) {
308 // do nothing more
309 }
310
311
312 template<class I2D, class I1D>
314 price(const Date &d, const Rate k) const {
315 Rate atm = atmYoYSwapRate(d);
316 return k > atm ? capPrice(d,k): floorPrice(d,k);
317 }
318
319
320 template<class I2D, class I1D>
322 capPrice(const Date &d, const Rate k) const {
324 return capPrice_(t,k);
325 }
326
327
328 template<class I2D, class I1D>
330 floorPrice(const Date &d, const Rate k) const {
332 return floorPrice_(t,k);
333 }
334
335
336 template<class I2D, class I1D>
338 operator()(Rate guess) const {
339 // allow extrapolation because the overlap is typically insufficient
340 // looking for a zero
341 return ( a_(t_,guess,true) - b_(t_,guess,true) );
342 }
343
344
345 template<class I2D, class I1D>
347 intersect() const {
348
349
350 // TODO: define the constants outside the code
351 const Real maxSearchRange = 0.0201;
352 const Real maxExtrapolationMaturity = 5.01;
353 const Real searchStep = 0.0050;
354 const Real intrinsicValueAddOn = 0.001;
355
356 std::vector<bool> validMaturity(cfMaturities_.size(),false);
357
358 cfMaturityTimes_.clear();
359 for (Size i=0; i<cfMaturities_.size();i++) {
362 }
363
364 capPrice_ = interpolator2d_.interpolate(
366 cStrikes_.begin(), cStrikes_.end(),
367 cPrice_
368 );
370
371 floorPrice_ = interpolator2d_.interpolate(
373 fStrikes_.begin(), fStrikes_.end(),
374 fPrice_
375 );
377
378 atmYoYSwapDateRates_.first.clear();
379 atmYoYSwapDateRates_.second.clear();
380 atmYoYSwapTimeRates_.first.clear();
381 atmYoYSwapTimeRates_.second.clear();
382 Brent solver;
383 Real solverTolerance_ = 1e-7;
384 Real lo,hi,guess;
385 std::vector<Real> minSwapRateIntersection(cfMaturityTimes_.size());
386 std::vector<Real> maxSwapRateIntersection(cfMaturityTimes_.size());
387 std::vector<Time> tmpSwapMaturities;
388 std::vector<Rate> tmpSwapRates;
389 for (Size i = 0; i < cfMaturities_.size(); i++) {
391 // determine the sum of discount factors
392 Size numYears = (Size)std::lround(t);
393 Real sumDiscount = 0.0;
394 for (Size j=0; j<numYears; ++j)
395 sumDiscount += nominalTS_->discount(j + 1.0);
396 // determine the minimum value of the ATM swap point
397 Real tmpMinSwapRateIntersection = -1.e10;
398 Real tmpMaxSwapRateIntersection = 1.e10;
399 for (Size j=0; j<fStrikes_.size(); ++j) {
401 Real minSwapRate = fStrikes_[j] - price / (sumDiscount * 10000);
402 if (minSwapRate > tmpMinSwapRateIntersection)
403 tmpMinSwapRateIntersection = minSwapRate;
404 }
405 for (Size j=0; j<cStrikes_.size(); ++j) {
407 Real maxSwapRate = cStrikes_[j] + price / (sumDiscount * 10000);
408 if (maxSwapRate < tmpMaxSwapRateIntersection)
409 tmpMaxSwapRateIntersection = maxSwapRate;
410 }
411 maxSwapRateIntersection[i] = tmpMaxSwapRateIntersection;
412 minSwapRateIntersection[i] = tmpMinSwapRateIntersection;
413
414 // find the interval where the intersection lies
415 bool trialsExceeded = false;
416 int numTrials = (int)(maxSearchRange / searchStep);
417 if ( floorPrice_(t,fStrikes_.back()) > capPrice_(t,fStrikes_.back()) ) {
418 int counter = 1;
419 bool stop = false;
420 Real strike = 0.0;
421 while (!stop) {
422 strike = fStrikes_.back() - counter * searchStep;
423 if (floorPrice_(t, strike) < capPrice_(t, strike))
424 stop = true;
425 counter++;
426 if (counter == numTrials + 1) {
427 if (!stop) {
428 stop = true;
429 trialsExceeded = true;
430 }
431 }
432 }
433 lo = strike;
434 hi = strike + searchStep;
435 } else {
436 int counter = 1;
437 bool stop = false;
438 Real strike = 0.0;
439 while (!stop) {
440 strike = fStrikes_.back() + counter * searchStep;
441 if (floorPrice_(t, strike) > capPrice_(t, strike))
442 stop = true;
443 counter++;
444 if (counter == numTrials + 1) {
445 if (!stop) {
446 stop = true;
447 trialsExceeded = true;
448 }
449 }
450 }
451 lo = strike - searchStep;
452 hi = strike;
453 }
454
455 guess = (hi+lo)/2.0;
456 Rate kI = -999.999;
457
458 if (!trialsExceeded) {
459 try{
460 kI = solver.solve( ObjectiveFunction(t, capPrice_, floorPrice_), solverTolerance_, guess, lo, hi );
461 } catch( std::exception &e) {
462 QL_FAIL("cap/floor intersection finding failed at t = " << t << ", error msg: "<< e.what());
463 }
464 // error message if kI is economically nonsensical (only if t is large)
465 if (kI <= minSwapRateIntersection[i]) {
466 if (t > maxExtrapolationMaturity)
467 QL_FAIL("cap/floor intersection finding failed at t = " << t <<
468 ", error msg: intersection value is below the arbitrage free lower bound "
469 << minSwapRateIntersection[i]);
470 }
471 else
472 {
473 tmpSwapMaturities.push_back(t);
474 tmpSwapRates.push_back(kI);
475 validMaturity[i] = true;
476 }
477 }
478 else
479 {
480 // error message if t is too large
481 if (t > maxExtrapolationMaturity)
482 QL_FAIL("cap/floor intersection finding failed at t = " << t <<
483 ", error msg: no interection found inside the admissible range");
484 }
485 }
486
487 // extrapolation of swap rates if necessary
488 //Polynomial2D tmpInterpol;
489 //Interpolation interpol = tmpInterpol.interpolate(tmpSwapMaturities.begin(), tmpSwapMaturities.end(), tmpSwapRates.begin());
490 //interpol.enableExtrapolation();
491 int counter = 0;
492 for (Size i=0; i<cfMaturities_.size(); ++i) {
493 if ( !validMaturity[i] ) {
496 // atmYoYSwapRates_->second.push_back(interpol((*cfMaturities_)[i]));
497 // Heuristic: overwrite the the swap rate with a value that guarantees that the
498 // intrinsic value of all options is lower than the price
499 Real newSwapRate = minSwapRateIntersection[i] + intrinsicValueAddOn;
500 if (newSwapRate > maxSwapRateIntersection[i])
501 newSwapRate = 0.5 * (minSwapRateIntersection[i] + maxSwapRateIntersection[i]);
502 atmYoYSwapTimeRates_.second.push_back(newSwapRate);
503 atmYoYSwapDateRates_.second.push_back(newSwapRate);
504 } else {
505 atmYoYSwapTimeRates_.first.push_back(tmpSwapMaturities[counter]);
506 atmYoYSwapTimeRates_.second.push_back(tmpSwapRates[counter]);
507 atmYoYSwapDateRates_.first.push_back(
509 atmYoYSwapDateRates_.second.push_back(tmpSwapRates[counter]);
510 counter++;
511 }
512 }
513
514 // create the swap curve using the factory
516 interpolator1d_.interpolate(atmYoYSwapTimeRates_.first.begin(),
517 atmYoYSwapTimeRates_.first.end(),
518 atmYoYSwapTimeRates_.second.begin());
519 }
520
521
522 template<class I2D, class I1D>
525
526 // which yoy-swap points to use in building the yoy-fwd curve?
527 // for now pick every year
528 Size nYears = (Size)std::lround(timeFromReference(referenceDate()+cfMaturities_.back()));
529
530 std::vector<ext::shared_ptr<BootstrapHelper<YoYInflationTermStructure> > > YYhelpers;
531 for (Size i=1; i<=nYears; i++) {
532 Date maturity = nominalTS_->referenceDate() + Period(i,Years);
533 Handle<Quote> quote(ext::shared_ptr<Quote>(
534 new SimpleQuote( atmYoYSwapRate( maturity ) )));//!
535 ext::shared_ptr<BootstrapHelper<YoYInflationTermStructure> >
536 anInstrument(
538 quote, observationLag(), maturity,
540 yoyIndex(), nominalTS_));
541 YYhelpers.push_back (anInstrument);
542 }
543
544 Date baseDate =
545 yoyIndex()->interpolated() ?
546 nominalTS_->referenceDate() - observationLag() :
547 inflationPeriod(nominalTS_->referenceDate() - observationLag(),
548 yoyIndex()->frequency()).first;
549 // usually this base rate is known
550 // however for the data to be self-consistent
551 // we pick this as the end of the curve
552 Rate baseYoYRate = atmYoYSwapRate( referenceDate() );//!
553
554 // Linear is OK because we have every year
555 auto pYITS =
556 ext::make_shared<PiecewiseYoYInflationCurve<Linear>>(
557 nominalTS_->referenceDate(), baseDate, baseYoYRate,
558 yoyIndex()->frequency(), yoyIndex()->interpolated(),
559 dayCounter(), YYhelpers);
560 pYITS->recalculate();
561 yoy_ = pYITS; // store
562
563 // check that helpers are repriced
564 const Real eps = 1e-5;
565 for (Size i=0; i<YYhelpers.size(); i++) {
567 QL_REQUIRE(fabs(YYhelpers[i]->impliedQuote() - original) <eps,
568 "could not reprice helper "<< i
569 << ", data " << original
570 << ", implied quote " << YYhelpers[i]->impliedQuote()
571 );
572 }
573 }
574
575}
576
577
578#endif
Brent 1-D solver
Definition: brent.hpp:37
calendar class
Definition: calendar.hpp:61
Concrete date class.
Definition: date.hpp:125
day counter class
Definition: daycounter.hpp:44
void enableExtrapolation(bool b=true)
enable extrapolation in subsequent calls
Shared handle to an observable.
Definition: handle.hpp:41
ObjectiveFunction(Time t, const Interpolation2D &, const Interpolation2D &)
Rate atmYoYRate(const Date &d, const Period &obsLag=Period(-1, Days), bool extrapolate=true) const override
Real capPrice(const Date &d, Rate k) const override
Real floorPrice(const Date &d, Rate k) const override
std::pair< std::vector< Date >, std::vector< Rate > > atmYoYSwapDateRates() const override
Rate atmYoYSwapRate(const Date &d, bool extrapolate=true) const override
ext::shared_ptr< YoYInflationTermStructure > YoYTS() const override
derived from yoy swap rates
std::pair< std::vector< Time >, std::vector< Rate > > atmYoYSwapTimeRates() const override
atm yoy swaps from put-call parity on cap/floor data
InterpolatedYoYCapFloorTermPriceSurface(Natural fixingDays, const Period &yyLag, const ext::shared_ptr< YoYInflationIndex > &yii, Rate baseRate, const Handle< YieldTermStructure > &nominal, const DayCounter &dc, const Calendar &cal, const BusinessDayConvention &bdc, const std::vector< Rate > &cStrikes, const std::vector< Rate > &fStrikes, const std::vector< Period > &cfMaturities, const Matrix &cPrice, const Matrix &fPrice, const Interpolator2D &interpolator2d=Interpolator2D(), const Interpolator1D &interpolator1d=Interpolator1D())
Date maxDate() const override
inflation term structure interface
void intersect() const
intersection of cap and floor price surfaces at given strikes
void calculateYoYTermStructure() const
mess of making it, i.e. create instruments from quotes and bootstrap
base class for 2-D interpolations.
base class for 1-D interpolations.
Matrix used in linear algebra.
Definition: matrix.hpp:41
market element returning a stored value
Definition: simplequote.hpp:33
Real solve(const F &f, Real accuracy, Real guess, Real step) const
Definition: solver1d.hpp:84
Basic term-structure functionality.
virtual const Date & referenceDate() const
the date at which discount = 1.0 and/or variance = 0.0
virtual Calendar calendar() const
the calendar used for reference and/or option date calculation
Time timeFromReference(const Date &date) const
date/time conversion
virtual DayCounter dayCounter() const
the day counter used for date/time conversion
Year-on-year inflation-swap bootstrap helper.
Abstract base class, inheriting from InflationTermStructure.
virtual Real price(const Date &d, Rate k) const =0
virtual std::vector< Rate > strikes() const
virtual Rate atmYoYRate(const Date &d, const Period &obsLag=Period(-1, Days), bool extrapolate=true) const =0
virtual std::vector< Rate > floorStrikes() const
virtual ext::shared_ptr< YoYInflationTermStructure > YoYTS() const =0
derived from yoy swap rates
virtual Real capPrice(const Date &d, Rate k) const =0
ext::shared_ptr< YoYInflationIndex > yoyIndex() const
index yoy is based on
std::pair< std::vector< Time >, std::vector< Rate > > atmYoYSwapTimeRates_
virtual BusinessDayConvention businessDayConvention() const
inspectors
virtual std::vector< Period > maturities() const
std::pair< std::vector< Date >, std::vector< Rate > > atmYoYSwapDateRates_
virtual Rate atmYoYSwapRate(const Date &d, bool extrapolate=true) const =0
ext::shared_ptr< YoYInflationTermStructure > yoy_
virtual Real floorPrice(const Date &d, Rate k) const =0
virtual std::pair< std::vector< Date >, std::vector< Rate > > atmYoYSwapDateRates() const =0
virtual std::vector< Rate > capStrikes() const
ext::shared_ptr< YoYInflationIndex > yoyIndex_
virtual std::pair< std::vector< Time >, std::vector< Rate > > atmYoYSwapTimeRates() const =0
atm yoy swaps from put-call parity on cap/floor data
virtual Date yoyOptionDateFromTenor(const Period &p) const
virtual Date baseDate() const =0
Real a_
const DefaultType & t
#define QL_REQUIRE(condition, message)
throw an error if the given pre-condition is not verified
Definition: errors.hpp:117
#define QL_FAIL(message)
throw an error (possibly with file and line information)
Definition: errors.hpp:92
Date d
ext::function< Real(Real)> b
Frequency
Frequency of events.
Definition: frequency.hpp:37
BusinessDayConvention
Business Day conventions.
Real Time
continuous quantity with 1-year units
Definition: types.hpp:62
QL_REAL Real
real number
Definition: types.hpp:50
unsigned QL_INTEGER Natural
positive integer
Definition: types.hpp:43
Real Rate
interest rates
Definition: types.hpp:70
std::size_t Size
size of a container
Definition: types.hpp:58
Bootstrap helpers for inflation term structures.
base classes for inflation indexes
const VF_R b_
Definition: any.hpp:35
std::pair< Date, Date > inflationPeriod(const Date &d, Frequency frequency)
utility function giving the inflation period for a given date
Piecewise year-on-year inflation term structure.
polynomial interpolation in the y-direction, spline interpolation x-direction