25 const std::vector<Time>& times,
26 const std::vector<Handle<Quote>>& quotes)
27 : ZeroInflationTermStructure(referenceCurve->dayCounter(), referenceCurve->baseRate(),
28 referenceCurve->observationLag(), referenceCurve->frequency(),
29 referenceCurve->seasonality()),
30 referenceCurve_(referenceCurve), times_(times), quotes_(quotes), data_(times_.size(), 1.0) {
31 QL_REQUIRE(
times_.size() > 1,
"SpreadedZeroInflationCurve: at least two times required");
32 QL_REQUIRE(
times_.size() == quotes.size(),
33 "SpreadedZeroInflationCurve: size of time and quote vectors do not match");
34 for (Size i = 0; i < quotes.size(); ++i) {
38 QuantLib::ext::make_shared<LinearInterpolation>(
times_.begin(),
times_.end(),
data_.begin()));
49 TermStructure::update();
59 for (Size i = 0; i <
times_.size(); ++i) {
60 QL_REQUIRE(!
quotes_[i].empty(),
"SpreadedZeroInflationCurve: quote at index " << i <<
" is empty");
72 const std::vector<Time>& times,
73 const std::vector<Handle<Quote>>& quotes)
74 : YoYInflationTermStructure(referenceCurve->dayCounter(), referenceCurve->baseRate(),
75 referenceCurve->observationLag(), referenceCurve->frequency(),
76 referenceCurve->indexIsInterpolated(), referenceCurve->seasonality()),
77 referenceCurve_(referenceCurve), times_(times), quotes_(quotes), data_(times_.size(), 1.0) {
78 QL_REQUIRE(
times_.size() > 1,
"SpreadedZeroInflationCurve: at least two times required");
79 QL_REQUIRE(
times_.size() == quotes.size(),
80 "SpreadedZeroInflationCurve: size of time and quote vectors do not match");
81 for (Size i = 0; i < quotes.size(); ++i) {
85 QuantLib::ext::make_shared<LinearInterpolation>(
times_.begin(),
times_.end(),
data_.begin()));
96 TermStructure::update();
106 for (Size i = 0; i <
times_.size(); ++i) {
107 QL_REQUIRE(!
quotes_[i].empty(),
"SpreadedYoYInflationCurve: quote at index " << i <<
" is empty");
void performCalculations() const override
Calendar calendar() const override
Date baseDate() const override
const Date & referenceDate() const override
std::vector< Time > times_
Handle< YoYInflationTermStructure > referenceCurve_
Natural settlementDays() const override
Rate yoyRateImpl(Time t) const override
Date maxDate() const override
SpreadedYoYInflationCurve(const Handle< YoYInflationTermStructure > &referenceCurve, const std::vector< Time > ×, const std::vector< Handle< Quote > > "es)
times should be consistent with reference ts day counter
std::vector< Handle< Quote > > quotes_
QuantLib::ext::shared_ptr< Interpolation > interpolation_
std::vector< Real > data_
void performCalculations() const override
Calendar calendar() const override
SpreadedZeroInflationCurve(const Handle< ZeroInflationTermStructure > &referenceCurve, const std::vector< Time > ×, const std::vector< Handle< Quote > > "es)
times should be consistent with reference ts day counter
Date baseDate() const override
Rate zeroRateImpl(Time t) const override
const Date & referenceDate() const override
std::vector< Time > times_
Natural settlementDays() const override
Date maxDate() const override
std::vector< Handle< Quote > > quotes_
Handle< ZeroInflationTermStructure > referenceCurve_
QuantLib::ext::shared_ptr< Interpolation > interpolation_
std::vector< Real > data_
spreaded inflation term structure