26#ifndef ql_inflation_bootstrap_traits_hpp
27#define ql_inflation_bootstrap_traits_hpp
47 if (
t->hasExplicitBaseDate())
50 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;
120 if (
t->hasExplicitBaseDate()) {
121 return t->baseDate();
122 }
else if (
t->indexIsInterpolated()) {
123 return t->referenceDate() -
t->observationLag();
126 t->frequency()).first;
132 return t->baseRate();
156 Rate r = *(std::min_element(c->data().begin(), c->data().end()));
157 return r<0.0 ?
Real(
r*2.0) :
r/2.0;
168 Rate r = *(std::max_element(c->data().begin(), c->data().end()));
169 return r<0.0 ?
Real(
r/2.0) :
r*2.0;
base helper class used for bootstrapping
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 *)
static Rate maxValueAfter(Size, const C *c, bool validData, Size)
std::size_t Size
size of a container
Inflation term structure based on the interpolation of year-on-year rates.
Inflation term structure based on the interpolation of zero rates.
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
ext::shared_ptr< YieldTermStructure > r