Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
Public Types | Private Types | List of all members
PiecewiseZeroInflationCurve< Interpolator, Bootstrap, Traits > Class Template Reference

Piecewise zero-inflation term structure. More...

#include <qle/termstructures/inflation/piecewisezeroinflationcurve.hpp>

+ Inheritance diagram for PiecewiseZeroInflationCurve< Interpolator, Bootstrap, Traits >:
+ Collaboration diagram for PiecewiseZeroInflationCurve< Interpolator, Bootstrap, Traits >:

Public Types

typedef Traits traits_type
 
typedef Interpolator interpolator_type
 

Public Member Functions

Constructors
 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())
 
Inflation interface
QuantLib::Date baseDate () const override
 
QuantLib::Date maxDate () const override
 
void setSeasonality (const QuantLib::ext::shared_ptr< QuantLib::Seasonality > &seasonality=QuantLib::ext::shared_ptr< QuantLib::Seasonality >()) override
 
Inspectors
const std::vector< QuantLib::Time > & times () const
 
const std::vector< QuantLib::Date > & dates () const
 
const std::vector< QuantLib::Real > & data () const
 
std::vector< std::pair< QuantLib::Date, QuantLib::Real > > nodes () const
 
Observer interface
void update () override
 

Private Types

typedef QuantLib::InterpolatedZeroInflationCurve< Interpolator > base_curve
 
typedef QuantExt::PiecewiseZeroInflationCurve< Interpolator, Bootstrap, Traits > this_curve
 

Trait::BootstrapFirstDateInitializer interface

std::vector< QuantLib::ext::shared_ptr< typename Traits::helper > > instruments_
 
QuantLib::Real accuracy_
 
Bootstrap< this_curvebootstrap_
 
QuantLib::ext::shared_ptr< QuantLib::ZeroInflationIndex > index_
 
bool useLastAvailableFixingAsBaseDate_
 
class Bootstrap< this_curve >
 
class QuantLib::BootstrapError< this_curve >
 
QuantLib::Date initialDate () const override
 
void performCalculations () const override
 

Detailed Description

template<class Interpolator, template< class > class Bootstrap = QuantLib::IterativeBootstrap, class Traits = QuantExt::ZeroInflationTraits>
class QuantExt::PiecewiseZeroInflationCurve< Interpolator, Bootstrap, Traits >

Piecewise zero-inflation term structure.

Definition at line 38 of file piecewisezeroinflationcurve.hpp.

Member Typedef Documentation

◆ base_curve

typedef QuantLib::InterpolatedZeroInflationCurve<Interpolator> base_curve
private

Definition at line 42 of file piecewisezeroinflationcurve.hpp.

◆ this_curve

typedef QuantExt::PiecewiseZeroInflationCurve<Interpolator, Bootstrap, Traits> this_curve
private

Definition at line 43 of file piecewisezeroinflationcurve.hpp.

◆ traits_type

typedef Traits traits_type

Definition at line 46 of file piecewisezeroinflationcurve.hpp.

◆ interpolator_type

typedef Interpolator interpolator_type

Definition at line 47 of file piecewisezeroinflationcurve.hpp.

Constructor & Destructor Documentation

◆ PiecewiseZeroInflationCurve()

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() 
)

Definition at line 51 of file piecewisezeroinflationcurve.hpp.

58 : base_curve(referenceDate, calendar, dayCounter, lag, frequency, baseZeroRate, i),
59 instruments_(std::move(instruments)), accuracy_(accuracy), index_(index),
60 useLastAvailableFixingAsBaseDate_(useLastAvailableFixingAsBaseDate) {
61 bootstrap_.setup(this);
62 }
QuantLib::InterpolatedZeroInflationCurve< Interpolator > base_curve
std::vector< QuantLib::ext::shared_ptr< typename Traits::helper > > instruments_
QuantLib::ext::shared_ptr< QuantLib::ZeroInflationIndex > index_

Member Function Documentation

◆ baseDate()

QuantLib::Date baseDate
override

Definition at line 104 of file piecewisezeroinflationcurve.hpp.

104 {
105 this->calculate();
106 return base_curve::baseDate();
107}

◆ maxDate()

QuantLib::Date maxDate
override

Definition at line 110 of file piecewisezeroinflationcurve.hpp.

110 {
111 this->calculate();
112 return base_curve::maxDate();
113}

◆ setSeasonality()

void setSeasonality ( const QuantLib::ext::shared_ptr< QuantLib::Seasonality > &  seasonality = QuantLib::ext::shared_ptr<QuantLib::Seasonality>())
override

Definition at line 156 of file piecewisezeroinflationcurve.hpp.

156 {
157 // always reset, whether with null or new pointer
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");
162 }
163 update();
164}

◆ times()

const std::vector< QuantLib::Time > & times

Definition at line 116 of file piecewisezeroinflationcurve.hpp.

116 {
117 calculate();
118 return base_curve::times();
119}

◆ dates()

const std::vector< QuantLib::Date > & dates

Definition at line 122 of file piecewisezeroinflationcurve.hpp.

122 {
123 calculate();
124 return base_curve::dates();
125}

◆ data()

const std::vector< QuantLib::Real > & data

Definition at line 128 of file piecewisezeroinflationcurve.hpp.

128 {
129 calculate();
130 return base_curve::rates();
131}

◆ nodes()

std::vector< std::pair< QuantLib::Date, QuantLib::Real > > nodes

Definition at line 134 of file piecewisezeroinflationcurve.hpp.

134 {
135 calculate();
136 return base_curve::nodes();
137}

◆ update()

void update
override

Definition at line 144 of file piecewisezeroinflationcurve.hpp.

144 {
145 base_curve::update();
146 LazyObject::update();
147}

◆ initialDate()

QuantLib::Date initialDate
override

Definition at line 150 of file piecewisezeroinflationcurve.hpp.

150 {
151 return ZeroInflation::curveBaseDate(useLastAvailableFixingAsBaseDate_, base_curve::referenceDate(),
152 base_curve::observationLag(), base_curve::frequency(), index_);
153}
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
Definition: inflation.cpp:172
+ Here is the call graph for this function:

◆ performCalculations()

void performCalculations
overrideprivate

Definition at line 140 of file piecewisezeroinflationcurve.hpp.

140 {
141 bootstrap_.calculate();
142}

Friends And Related Function Documentation

◆ Bootstrap< this_curve >

friend class Bootstrap< this_curve >
friend

Definition at line 92 of file piecewisezeroinflationcurve.hpp.

◆ QuantLib::BootstrapError< this_curve >

friend class QuantLib::BootstrapError< this_curve >
friend

Definition at line 92 of file piecewisezeroinflationcurve.hpp.

Member Data Documentation

◆ instruments_

std::vector<QuantLib::ext::shared_ptr<typename Traits::helper> > instruments_
private

Definition at line 91 of file piecewisezeroinflationcurve.hpp.

◆ accuracy_

QuantLib::Real accuracy_
private

Definition at line 92 of file piecewisezeroinflationcurve.hpp.

◆ bootstrap_

Bootstrap<this_curve> bootstrap_
private

Definition at line 96 of file piecewisezeroinflationcurve.hpp.

◆ index_

QuantLib::ext::shared_ptr<QuantLib::ZeroInflationIndex> index_
private

Definition at line 97 of file piecewisezeroinflationcurve.hpp.

◆ useLastAvailableFixingAsBaseDate_

bool useLastAvailableFixingAsBaseDate_
private

Definition at line 98 of file piecewisezeroinflationcurve.hpp.