26#ifndef ql_inflation_bootstrap_traits_hpp
27#define ql_inflation_bootstrap_traits_hpp
29#include <ql/termstructures/inflation/interpolatedzeroinflationcurve.hpp>
30#include <ql/termstructures/inflation/interpolatedyoyinflationcurve.hpp>
31#include <ql/termstructures/bootstraphelper.hpp>
47 return inflationPeriod(t->referenceDate() - t->observationLag(), t->frequency()).first;
79 Rate r = *(std::min_element(c->data().begin(), c->data().end()));
80 return r<0.0 ?
Real(r*2.0) : r/2.0;
91 Rate r = *(std::max_element(c->data().begin(), c->data().end()));
92 return r<0.0 ?
Real(r/2.0) : r*2.0;
118 if (t->indexIsInterpolated()) {
119 return t->referenceDate() - t->observationLag();
122 t->frequency()).first;
127 return t->baseRate();
155 Rate r = *(std::min_element(c->data().begin(), c->data().end()));
156 return r<0.0 ?
Real(r*2.0) : r/2.0;
167 Rate r = *(std::max_element(c->data().begin(), c->data().end()));
168 return r<0.0 ?
Real(r/2.0) : r*2.0;
Base helper class for bootstrapping.
Base class for year-on-year inflation term structures.
Bootstrap traits to use for PiecewiseZeroInflationCurve.
static Date initialDate(const YoYInflationTermStructure *t)
static Rate minValueAfter(Size, const C *c, bool validData, Size)
static Rate guess(Size i, const C *c, bool validData, Size)
static Rate initialValue(const YoYInflationTermStructure *t)
BootstrapHelper< YoYInflationTermStructure > helper
static Size maxIterations()
static void updateGuess(std::vector< Rate > &data, Rate level, Size i)
static Rate maxValueAfter(Size, const C *c, bool validData, Size)
Interface for zero inflation term structures.
Bootstrap traits to use for PiecewiseZeroInflationCurve.
static Rate minValueAfter(Size, const C *c, bool validData, Size)
static Date initialDate(const ZeroInflationTermStructure *t)
static Rate guess(Size i, const C *c, bool validData, Size)
BootstrapHelper< ZeroInflationTermStructure > helper
static Size maxIterations()
static void updateGuess(std::vector< Rate > &data, Rate level, Size i)
static Rate initialValue(const ZeroInflationTermStructure *t)
static Rate maxValueAfter(Size, const C *c, bool validData, Size)
std::size_t Size
size of a container
constexpr double maxInflation
constexpr double avgInflation
std::pair< Date, Date > inflationPeriod(const Date &d, Frequency frequency)
utility function giving the inflation period for a given date