Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
Public Member Functions | List of all members
NonStandardYoYInflationCoupon Class Reference

Coupon paying a YoY-inflation type index More...

#include <qle/cashflows/nonstandardyoyinflationcoupon.hpp>

+ Inheritance diagram for NonStandardYoYInflationCoupon:
+ Collaboration diagram for NonStandardYoYInflationCoupon:

Public Member Functions

 NonStandardYoYInflationCoupon (const Date &paymentDate, Real nominal, const Date &startDate, const Date &endDate, Natural fixingDays, const ext::shared_ptr< ZeroInflationIndex > &index, const Period &observationLag, const DayCounter &dayCounter, Real gearing=1.0, Spread spread=0.0, const Date &refPeriodStart=Date(), const Date &refPeriodEnd=Date(), bool addInflationNotional=false, QuantLib::CPI::InterpolationType interpolation=QuantLib::CPI::InterpolationType::Flat)
 
Inspectors
Real gearing () const
 index gearing, i.e. multiplicative coefficient for the index More...
 
Spread spread () const
 spread paid over the fixing of the underlying index More...
 
Rate adjustedFixing () const
 

Visitability

Date fixingDateNumerator_
 
Date fixingDateDenumerator_
 
Real gearing_
 
Spread spread_
 
bool addInflationNotional_
 
QuantLib::CPI::InterpolationType interpolationType_
 
virtual void accept (AcyclicVisitor &) override
 
virtual Date fixingDateNumerator () const
 
virtual Date fixingDateDenumerator () const
 
virtual ext::shared_ptr< ZeroInflationIndex > cpiIndex () const
 
virtual Rate indexFixing () const override
 
virtual Date fixingDate () const override
 
virtual Rate rate () const override
 
bool addInflationNotional () const
 
bool isInterpolated () const
 
QuantLib::CPI::InterpolationType interpolationType () const
 
bool checkPricerImpl (const ext::shared_ptr< InflationCouponPricer > &) const override
 
void setFixingDates (const Date &denumatorDate, const Date &numeratorDate, const Period &observationLag)
 

Detailed Description

Coupon paying a YoY-inflation type index

Definition at line 39 of file nonstandardyoyinflationcoupon.hpp.

Constructor & Destructor Documentation

◆ NonStandardYoYInflationCoupon()

NonStandardYoYInflationCoupon ( const Date &  paymentDate,
Real  nominal,
const Date &  startDate,
const Date &  endDate,
Natural  fixingDays,
const ext::shared_ptr< ZeroInflationIndex > &  index,
const Period &  observationLag,
const DayCounter &  dayCounter,
Real  gearing = 1.0,
Spread  spread = 0.0,
const Date &  refPeriodStart = Date(),
const Date &  refPeriodEnd = Date(),
bool  addInflationNotional = false,
QuantLib::CPI::InterpolationType  interpolation = QuantLib::CPI::InterpolationType::Flat 
)

Definition at line 54 of file nonstandardyoyinflationcoupon.cpp.

58 : QuantLib::InflationCoupon(paymentDate, nominal, startDate, endDate, fixingDays, index, observationLag, dayCounter,
59 refPeriodStart, refPeriodEnd),
61 interpolationType_(interpolation) {
62 setFixingDates(refPeriodStart, refPeriodEnd, observationLag);
63}
void setFixingDates(const Date &denumatorDate, const Date &numeratorDate, const Period &observationLag)
Real gearing() const
index gearing, i.e. multiplicative coefficient for the index
Spread spread() const
spread paid over the fixing of the underlying index
+ Here is the call graph for this function:

Member Function Documentation

◆ gearing()

Real gearing ( ) const

index gearing, i.e. multiplicative coefficient for the index

Definition at line 53 of file nonstandardyoyinflationcoupon.hpp.

53{ return gearing_; }
+ Here is the caller graph for this function:

◆ spread()

Spread spread ( ) const

spread paid over the fixing of the underlying index

Definition at line 55 of file nonstandardyoyinflationcoupon.hpp.

55{ return spread_; }
+ Here is the caller graph for this function:

◆ adjustedFixing()

Rate adjustedFixing ( ) const

Definition at line 87 of file nonstandardyoyinflationcoupon.cpp.

87{ return (rate() - spread()) / gearing(); }
+ Here is the call graph for this function:

◆ accept()

void accept ( AcyclicVisitor &  v)
overridevirtual

Reimplemented in NonStandardCappedFlooredYoYInflationCoupon.

Definition at line 65 of file nonstandardyoyinflationcoupon.cpp.

65 {
66 Visitor<NonStandardYoYInflationCoupon>* v1 = dynamic_cast<Visitor<NonStandardYoYInflationCoupon>*>(&v);
67 if (v1 != 0)
68 v1->visit(*this);
69 else
70 InflationCoupon::accept(v);
71}
+ Here is the caller graph for this function:

◆ fixingDateNumerator()

Date fixingDateNumerator ( ) const
virtual

Definition at line 77 of file nonstandardyoyinflationcoupon.cpp.

+ Here is the caller graph for this function:

◆ fixingDateDenumerator()

Date fixingDateDenumerator ( ) const
virtual

Definition at line 78 of file nonstandardyoyinflationcoupon.cpp.

+ Here is the caller graph for this function:

◆ cpiIndex()

ext::shared_ptr< ZeroInflationIndex > cpiIndex ( ) const
virtual

Definition at line 101 of file nonstandardyoyinflationcoupon.cpp.

101 {
102 return ext::dynamic_pointer_cast<ZeroInflationIndex>(index_);
103}

◆ indexFixing()

Rate indexFixing ( ) const
overridevirtual

Definition at line 80 of file nonstandardyoyinflationcoupon.cpp.

80 {
81 auto zii = QuantLib::ext::dynamic_pointer_cast<QuantLib::ZeroInflationIndex>(index_);
82 Real I_t = CPI::laggedFixing(zii, fixingDateNumerator() + observationLag_, observationLag_, interpolationType_);
83 Real I_s = CPI::laggedFixing(zii, fixingDateDenumerator() + observationLag_, observationLag_, interpolationType_);
84 return I_t / I_s - 1.0;
85}
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fixingDate()

Date fixingDate ( ) const
overridevirtual

Definition at line 89 of file nonstandardyoyinflationcoupon.cpp.

89{ return fixingDateNumerator_; };
+ Here is the caller graph for this function:

◆ rate()

Rate rate ( ) const
overridevirtual

Reimplemented in NonStandardCappedFlooredYoYInflationCoupon.

Definition at line 91 of file nonstandardyoyinflationcoupon.cpp.

91 {
92 Rate r = InflationCoupon::rate();
94 r = gearing() * ((r - spread()) / gearing() + 1) + spread();
95 }
96 return r;
97}
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addInflationNotional()

bool addInflationNotional ( ) const

Definition at line 99 of file nonstandardyoyinflationcoupon.cpp.

99{ return addInflationNotional_; };

◆ isInterpolated()

bool isInterpolated ( ) const

Definition at line 74 of file nonstandardyoyinflationcoupon.hpp.

74{ return interpolationType() == CPI::Linear; }
QuantLib::CPI::InterpolationType interpolationType() const
+ Here is the call graph for this function:

◆ interpolationType()

QuantLib::CPI::InterpolationType interpolationType ( ) const

Definition at line 75 of file nonstandardyoyinflationcoupon.hpp.

75{ return interpolationType_; }
+ Here is the caller graph for this function:

◆ checkPricerImpl()

bool checkPricerImpl ( const ext::shared_ptr< InflationCouponPricer > &  pricer) const
overrideprotected

Definition at line 73 of file nonstandardyoyinflationcoupon.cpp.

73 {
74 return static_cast<bool>(ext::dynamic_pointer_cast<NonStandardYoYInflationCouponPricer>(pricer));
75}

◆ setFixingDates()

void setFixingDates ( const Date &  denumatorDate,
const Date &  numeratorDate,
const Period &  observationLag 
)
private

Definition at line 44 of file nonstandardyoyinflationcoupon.cpp.

45 {
46
47 fixingDateDenumerator_ = index_->fixingCalendar().advance(
48 denumatorDate - observationLag_, -static_cast<Integer>(fixingDays_), Days, ModifiedPreceding);
49
50 fixingDateNumerator_ = index_->fixingCalendar().advance(
51 numeratorDate - observationLag_, -static_cast<Integer>(fixingDays_), Days, ModifiedPreceding);
52}
+ Here is the caller graph for this function:

Member Data Documentation

◆ fixingDateNumerator_

Date fixingDateNumerator_
protected

Definition at line 78 of file nonstandardyoyinflationcoupon.hpp.

◆ fixingDateDenumerator_

Date fixingDateDenumerator_
protected

Definition at line 79 of file nonstandardyoyinflationcoupon.hpp.

◆ gearing_

Real gearing_
protected

Definition at line 80 of file nonstandardyoyinflationcoupon.hpp.

◆ spread_

Spread spread_
protected

Definition at line 81 of file nonstandardyoyinflationcoupon.hpp.

◆ addInflationNotional_

bool addInflationNotional_
protected

Definition at line 82 of file nonstandardyoyinflationcoupon.hpp.

◆ interpolationType_

QuantLib::CPI::InterpolationType interpolationType_
protected

Definition at line 83 of file nonstandardyoyinflationcoupon.hpp.