26#include <ql/indexes/inflationindex.hpp>
27#include <ql/patterns/lazyobject.hpp>
28#include <ql/termstructures/iterativebootstrap.hpp>
36template <
class Interpolator,
template <
class>
class Bootstrap = QuantLib::IterativeBootstrap,
39 public QuantLib::LazyObject,
40 public Traits::BootstrapFirstDateInitializer {
42 typedef QuantLib::InterpolatedZeroInflationCurve<Interpolator>
base_curve;
52 const QuantLib::DayCounter& dayCounter,
const QuantLib::Period& lag,
53 QuantLib::Frequency frequency, QuantLib::Rate baseZeroRate,
54 std::vector<QuantLib::ext::shared_ptr<typename Traits::helper>> instruments,
55 QuantLib::Real accuracy = 1.0e-12,
56 QuantLib::ext::shared_ptr<QuantLib::ZeroInflationIndex> index =
nullptr,
57 bool useLastAvailableFixingAsBaseDate =
false,
const Interpolator& i = Interpolator())
58 :
base_curve(referenceDate, calendar, dayCounter, lag, frequency, baseZeroRate, i),
67 QuantLib::Date
baseDate()
const override;
68 QuantLib::Date
maxDate()
const override;
69 void setSeasonality(
const QuantLib::ext::shared_ptr<QuantLib::Seasonality>& seasonality =
70 QuantLib::ext::shared_ptr<QuantLib::Seasonality>())
override;
74 const std::vector<QuantLib::Time>&
times()
const;
75 const std::vector<QuantLib::Date>&
dates()
const;
76 const std::vector<QuantLib::Real>&
data()
const;
77 std::vector<std::pair<QuantLib::Date, QuantLib::Real>>
nodes()
const;
91 std::vector<QuantLib::ext::shared_ptr<typename Traits::helper>>
instruments_;
95 friend class QuantLib::BootstrapError<
this_curve>;
97 QuantLib::ext::shared_ptr<QuantLib::ZeroInflationIndex>
index_;
103template <
class I,
template <
class>
class B,
class T>
106 return base_curve::baseDate();
109template <
class I,
template <
class>
class B,
class T>
112 return base_curve::maxDate();
115template <
class I,
template <
class>
class B,
class T>
118 return base_curve::times();
121template <
class I,
template <
class>
class B,
class T>
124 return base_curve::dates();
127template <
class I,
template <
class>
class B,
class T>
130 return base_curve::rates();
133template <
class I,
template <
class>
class B,
class T>
136 return base_curve::nodes();
139template <
class I,
template <
class>
class B,
class T>
141 bootstrap_.calculate();
145 base_curve::update();
146 LazyObject::update();
149template <
class I,
template <
class>
class B,
class T>
152 base_curve::observationLag(), base_curve::frequency(), index_);
155template <
class I,
template <
class>
class B,
class T>
158 base_curve::seasonality_ = seasonality;
159 if (base_curve::seasonality_ !=
nullptr) {
160 QL_REQUIRE(base_curve::seasonality_->isConsistent(*
this),
"Seasonality inconsistent with "
161 "inflation term structure");
Piecewise zero-inflation term structure.
void performCalculations() const override
void setSeasonality(const QuantLib::ext::shared_ptr< QuantLib::Seasonality > &seasonality=QuantLib::ext::shared_ptr< QuantLib::Seasonality >()) override
Bootstrap< this_curve > bootstrap_
QuantExt::PiecewiseZeroInflationCurve< Interpolator, Bootstrap, Traits > this_curve
QuantLib::Date initialDate() const override
QuantLib::InterpolatedZeroInflationCurve< Interpolator > base_curve
const std::vector< QuantLib::Time > & times() const
const std::vector< QuantLib::Real > & data() const
PiecewiseZeroInflationCurve(const QuantLib::Date &referenceDate, const QuantLib::Calendar &calendar, const QuantLib::DayCounter &dayCounter, const QuantLib::Period &lag, QuantLib::Frequency frequency, QuantLib::Rate baseZeroRate, std::vector< QuantLib::ext::shared_ptr< typename Traits::helper > > instruments, QuantLib::Real accuracy=1.0e-12, QuantLib::ext::shared_ptr< QuantLib::ZeroInflationIndex > index=nullptr, bool useLastAvailableFixingAsBaseDate=false, const Interpolator &i=Interpolator())
Interpolator interpolator_type
std::vector< QuantLib::ext::shared_ptr< typename Traits::helper > > instruments_
QuantLib::Date maxDate() const override
QuantLib::Date baseDate() const override
QuantLib::ext::shared_ptr< QuantLib::ZeroInflationIndex > index_
const std::vector< QuantLib::Date > & dates() const
std::vector< std::pair< QuantLib::Date, QuantLib::Real > > nodes() const
friend class Bootstrap< this_curve >
bool useLastAvailableFixingAsBaseDate_
Bootstrap traits to use for PiecewiseZeroInflationCurve.
some inflation related utilities.
interpolated correlation term structure
QuantLib::Date curveBaseDate(const bool baseDateLastKnownFixing, const QuantLib::Date &refDate, const QuantLib::Period obsLagCurve, const QuantLib::Frequency curveFreq, const QuantLib::ext::shared_ptr< QuantLib::ZeroInflationIndex > &index)
derives the zero inflation curve base date based on the useLastKnownFixing rule