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

CPI cap floor helper. More...

#include <qle/models/cpicapfloorhelper.hpp>

+ Inheritance diagram for CpiCapFloorHelper:
+ Collaboration diagram for CpiCapFloorHelper:

Public Member Functions

 CpiCapFloorHelper (Option::Type type, Real baseCPI, const Date &maturity, const Calendar &fixCalendar, BusinessDayConvention fixConvention, const Calendar &payCalendar, BusinessDayConvention payConvention, Real strike, const Handle< ZeroInflationIndex > &infIndex, const Period &observationLag, Real marketPremium, CPI::InterpolationType observationInterpolation=CPI::AsIndex, BlackCalibrationHelper::CalibrationErrorType errorType=BlackCalibrationHelper::RelativePriceError)
 
Real modelValue () const override
 
Real blackPrice (Volatility volatility) const override
 
void addTimesTo (std::list< Time > &) const override
 
QuantLib::ext::shared_ptr< CPICapFloor > instrument () const
 

Private Attributes

QuantLib::ext::shared_ptr< CPICapFloor > instrument_
 

Detailed Description

CPI cap floor helper.

Definition at line 39 of file cpicapfloorhelper.hpp.

Constructor & Destructor Documentation

◆ CpiCapFloorHelper()

CpiCapFloorHelper ( Option::Type  type,
Real  baseCPI,
const Date &  maturity,
const Calendar &  fixCalendar,
BusinessDayConvention  fixConvention,
const Calendar &  payCalendar,
BusinessDayConvention  payConvention,
Real  strike,
const Handle< ZeroInflationIndex > &  infIndex,
const Period &  observationLag,
Real  marketPremium,
CPI::InterpolationType  observationInterpolation = CPI::AsIndex,
BlackCalibrationHelper::CalibrationErrorType  errorType = BlackCalibrationHelper::RelativePriceError 
)

Definition at line 27 of file cpicapfloorhelper.cpp.

33 : BlackCalibrationHelper(Handle<Quote>(QuantLib::ext::make_shared<SimpleQuote>(0.0)), errorType),
34 // start date does not really matter ?
35 instrument_(QuantLib::ext::shared_ptr<CPICapFloor>(new CPICapFloor(
36 type, 1.0, Settings::instance().evaluationDate(), baseCPI, maturity, fixCalendar, fixConvention, payCalendar,
37 payConvention, strike, infIndex.currentLink(), observationLag, observationInterpolation))) {
38 QL_REQUIRE(errorType == BlackCalibrationHelper::PriceError ||
39 errorType == BlackCalibrationHelper::RelativePriceError,
40 "CpiCapFloorHelper supports only PriceError and "
41 "RelativePriceError error types");
42 marketValue_ = marketPremium;
43}
QuantLib::ext::shared_ptr< CPICapFloor > instrument_

Member Function Documentation

◆ modelValue()

Real modelValue ( ) const
override

Definition at line 45 of file cpicapfloorhelper.cpp.

45 {
46 calculate();
47 instrument_->setPricingEngine(engine_);
48 return instrument_->NPV();
49}
QuantLib::ext::shared_ptr< PricingEngine > engine_
Definition: cdsoption.cpp:78

◆ blackPrice()

Real blackPrice ( Volatility  volatility) const
override

Definition at line 51 of file cpicapfloorhelper.cpp.

51 {
52 calculate();
53 return marketValue_;
54}

◆ addTimesTo()

void addTimesTo ( std::list< Time > &  ) const
override

Definition at line 50 of file cpicapfloorhelper.hpp.

50{}

◆ instrument()

QuantLib::ext::shared_ptr< CPICapFloor > instrument ( ) const

Definition at line 52 of file cpicapfloorhelper.hpp.

52{ return instrument_; }

Member Data Documentation

◆ instrument_

QuantLib::ext::shared_ptr<CPICapFloor> instrument_
private

Definition at line 55 of file cpicapfloorhelper.hpp.