QuantLib: CPICapFloor Class Reference

A free/open-source library for quantitative finance Reference manual - version 1.20

Public Member Functions | List of all members
CPICapFloor Class Reference

CPI cap or floor. More...

`#include <ql/instruments/cpicapfloor.hpp>`

Inheritance diagram for CPICapFloor:
[legend]

## Public Member Functions
| CPICapFloor (Option::Type type, Real nominal, const Date &startDate, Real baseCPI, const Date &maturity, const Calendar &fixCalendar, BusinessDayConvention fixConvention, const Calendar &payCalendar, BusinessDayConvention payConvention, Rate strike, const Handle< ZeroInflationIndex > &infIndex, const Period &observationLag, CPI::InterpolationType observationInterpolation=CPI::AsIndex)
Inspectors
Option::Type | type () const
Real | nominal () const
Rate | strike () const
| \( K \) in the above formula.
Date | fixingDate () const
Date | payDate () const
Handle< ZeroInflationIndex > | inflationIndex () const
Period | observationLag () const
Public Member Functions inherited from Instrument
Real | NPV () const
| returns the net present value of the instrument.
Real | errorEstimate () const
| returns the error estimate on the NPV when available.
const Date & | valuationDate () const
| returns the date the net present value refers to.
template<typename T >
T | result (const std::string &tag) const
| returns any additional result returned by the pricing engine.
const std::map< std::string, boost::any > & | additionalResults () const
| returns all additional result returned by the pricing engine.
void | setPricingEngine (const ext::shared_ptr< PricingEngine > &)
| set the pricing engine to be used. More...
Public Member Functions inherited from LazyObject
void | update ()
void | recalculate ()
void | freeze ()
void | unfreeze ()
void | alwaysForwardNotifications ()
Public Member Functions inherited from Observable
| Observable (const Observable &)
Observable & | operator= (const Observable &)
void | notifyObservers ()
Public Member Functions inherited from Observer
| Observer (const Observer &)
Observer & | operator= (const Observer &)
std::pair< iterator, bool > | registerWith (const ext::shared_ptr< Observable > &)
void | registerWithObservables (const ext::shared_ptr< Observer > &)
Size | unregisterWith (const ext::shared_ptr< Observable > &)
void | unregisterWithAll ()
virtual void | deepUpdate ()

## Instrument interface
Option::Type | type_
Real | nominal_
Date | startDate_
Date | fixDate_
Date | payDate_
Real | baseCPI_
Date | maturity_
Calendar | fixCalendar_
BusinessDayConvention | fixConvention_
Calendar | payCalendar_
BusinessDayConvention | payConvention_
Rate | strike_
Handle< ZeroInflationIndex > | infIndex_
Period | observationLag_
CPI::InterpolationType | observationInterpolation_
bool | isExpired () const
| returns whether the instrument might have value greater than zero.
void | setupArguments (PricingEngine::arguments *) const
void | fetchResults (const PricingEngine::results *r) const

## Additional Inherited Members
Public Types inherited from Observer
typedef boost::unordered_set< ext::shared_ptr< Observable > > | set_type
typedef set_type::iterator | iterator
Protected Member Functions inherited from Instrument
void | calculate () const
virtual void | setupExpired () const
virtual void | performCalculations () const
Protected Member Functions inherited from LazyObject
Protected Attributes inherited from Instrument
Real | NPV_
Real | errorEstimate_
Date | valuationDate_
std::map< std::string, boost::any > | additionalResults_
ext::shared_ptr< PricingEngine > | engine_
Protected Attributes inherited from LazyObject
bool | calculated_
bool | frozen_
bool | alwaysForward_

## Detailed Description

CPI cap or floor.

Quoted as a fixed strike rate \( K \). Payoff:

\[ P_n(0,T) \max(y (N [(1+K)^{T}-1] - N \left[ \frac{I(T)}{I(0)} -1 \right]), 0) \]

where \( T \) is the maturity time, \( P_n(0,t) \) is the nominal discount factor at time \( t \), \( N \) is the notional, and \( I(t) \) is the inflation index value at time \( t \).

Inflation is generally available on every day, including holidays and weekends. Hence there is a variable to state whether the observe/fix dates for inflation are adjusted or not. The default is not to adjust.

N.B. a cpi cap or floor is an option, not a cap or floor on a coupon. Thus this is very similar to a ZCIIS and has a single flow, this is as usual for cpi because it is cumulative up to option maturity from base date.

We do not inherit from Option, although this would be reasonable, because we do not have that degree of generality.

## Member Function Documentation

## ◆ setupArguments()

void setupArguments | ( | PricingEngine::arguments * |  | ) | const
| virtual

When a derived argument structure is defined for an instrument, this method should be overridden to fill it. This is mandatory in case a pricing engine is used.

Reimplemented from Instrument.

## ◆ fetchResults()

void fetchResults | ( | const PricingEngine::results * | r | ) | const
| virtual

When a derived result structure is defined for an instrument, this method should be overridden to read from it. This is mandatory in case a pricing engine is used.

Reimplemented from Instrument.