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

#include <qle/termstructures/piecewiseoptionletcurve.hpp>

+ Inheritance diagram for PiecewiseOptionletCurve< Interpolator, Bootstrap >:
+ Collaboration diagram for PiecewiseOptionletCurve< Interpolator, Bootstrap >:

Public Types

typedef PiecewiseOptionletCurve< Interpolator, Bootstrap > this_curve
 
typedef QuantLib::BootstrapHelper< QuantLib::OptionletVolatilityStructure > helper
 
typedef OptionletTraits traits_type
 Bootstrap needs these typedefs. More...
 
typedef Interpolator interpolator_type
 

Public Member Functions

Constructors
 PiecewiseOptionletCurve (const QuantLib::Date &referenceDate, const std::vector< QuantLib::ext::shared_ptr< helper > > &instruments, const QuantLib::Calendar &calendar, QuantLib::BusinessDayConvention bdc, const QuantLib::DayCounter &dayCounter, QuantLib::VolatilityType volatilityType=QuantLib::Normal, QuantLib::Real displacement=0.0, bool flatFirstPeriod=true, const Interpolator &i=Interpolator(), const Bootstrap< this_curve > &bootstrap=Bootstrap< this_curve >())
 
 PiecewiseOptionletCurve (QuantLib::Natural settlementDays, const std::vector< QuantLib::ext::shared_ptr< helper > > &instruments, const QuantLib::Calendar &calendar, QuantLib::BusinessDayConvention bdc, const QuantLib::DayCounter &dayCounter, QuantLib::VolatilityType volatilityType=QuantLib::Normal, QuantLib::Real displacement=0.0, bool flatFirstPeriod=true, const Interpolator &i=Interpolator(), const Bootstrap< this_curve > &bootstrap=Bootstrap< this_curve >())
 
TermStructure interface
QuantLib::Date maxDate () const override
 
InterpolatedOptionletCurve interface
const std::vector< QuantLib::Time > & times () const
 
const std::vector< QuantLib::Date > & dates () const
 
const std::vector< QuantLib::Real > & volatilities () const
 
std::vector< std::pair< QuantLib::Date, QuantLib::Real > > nodes () const
 
- Public Member Functions inherited from InterpolatedOptionletCurve< Interpolator >
 InterpolatedOptionletCurve (const std::vector< QuantLib::Date > &dates, const std::vector< QuantLib::Real > &volatilities, QuantLib::BusinessDayConvention bdc, const QuantLib::DayCounter &dayCounter, const QuantLib::Calendar &calendar=QuantLib::Calendar(), QuantLib::VolatilityType volatilityType=QuantLib::Normal, QuantLib::Real displacement=0.0, bool flatFirstPeriod=true, const Interpolator &interpolator=Interpolator())
 
QuantLib::Date maxDate () const override
 
QuantLib::Rate minStrike () const override
 
QuantLib::Rate maxStrike () const override
 
QuantLib::VolatilityType volatilityType () const override
 
QuantLib::Real displacement () const override
 
const std::vector< QuantLib::Time > & times () const
 
const std::vector< QuantLib::Date > & dates () const
 
const std::vector< QuantLib::Real > & volatilities () const
 
const std::vector< QuantLib::Real > & data () const
 
std::vector< std::pair< QuantLib::Date, QuantLib::Real > > nodes () const
 

Private Member Functions

LazyObject interface
void performCalculations () const override
 

Observer interface

typedef InterpolatedOptionletCurve< Interpolator > base_curve
 
void update () override
 

OptionletVolatilityStructure interface

std::vector< QuantLib::ext::shared_ptr< helper > > instruments_
 Vector of helper instruments to be matched. More...
 
QuantLib::Real accuracy_
 Accuracy of the match. More...
 
Bootstrap< this_curvebootstrap_
 
class Bootstrap< this_curve >
 
class BootstrapError< this_curve >
 
class PenaltyFunction< this_curve >
 
QuantLib::Real volatilityImpl (QuantLib::Time optionTime, QuantLib::Rate strike) const override
 

Additional Inherited Members

- Protected Member Functions inherited from InterpolatedOptionletCurve< Interpolator >
QuantLib::ext::shared_ptr< QuantLib::SmileSection > smileSectionImpl (QuantLib::Time optionTime) const override
 
QuantLib::Real volatilityImpl (QuantLib::Time optionTime, QuantLib::Rate strike) const override
 
 InterpolatedOptionletCurve (QuantLib::BusinessDayConvention bdc, const QuantLib::DayCounter &dayCounter, QuantLib::VolatilityType volatilityType=QuantLib::Normal, QuantLib::Real displacement=0.0, bool flatFirstPeriod=true, const Interpolator &interpolator=Interpolator())
 
 InterpolatedOptionletCurve (const QuantLib::Date &referenceDate, const QuantLib::Calendar &calendar, QuantLib::BusinessDayConvention bdc, const QuantLib::DayCounter &dayCounter, QuantLib::VolatilityType volatilityType=QuantLib::Normal, QuantLib::Real displacement=0.0, bool flatFirstPeriod=true, const Interpolator &interpolator=Interpolator())
 
 InterpolatedOptionletCurve (QuantLib::Natural settlementDays, const QuantLib::Calendar &calendar, QuantLib::BusinessDayConvention bdc, const QuantLib::DayCounter &dayCounter, QuantLib::VolatilityType volatilityType=QuantLib::Normal, QuantLib::Real displacement=0.0, bool flatFirstPeriod=true, const Interpolator &interpolator=Interpolator())
 
- Protected Attributes inherited from InterpolatedOptionletCurve< Interpolator >
std::vector< QuantLib::Date > dates_
 The fixing dates of the index underlying the optionlets. More...
 

Detailed Description

template<class Interpolator, template< class > class Bootstrap = QuantExt::IterativeBootstrap>
class QuantExt::PiecewiseOptionletCurve< Interpolator, Bootstrap >

Definition at line 101 of file piecewiseoptionletcurve.hpp.

Member Typedef Documentation

◆ this_curve

typedef PiecewiseOptionletCurve<Interpolator, Bootstrap> this_curve

Definition at line 104 of file piecewiseoptionletcurve.hpp.

◆ helper

typedef QuantLib::BootstrapHelper<QuantLib::OptionletVolatilityStructure> helper

Definition at line 105 of file piecewiseoptionletcurve.hpp.

◆ traits_type

Bootstrap needs these typedefs.

Definition at line 108 of file piecewiseoptionletcurve.hpp.

◆ interpolator_type

typedef Interpolator interpolator_type

Definition at line 109 of file piecewiseoptionletcurve.hpp.

◆ base_curve

typedef InterpolatedOptionletCurve<Interpolator> base_curve
private

Definition at line 151 of file piecewiseoptionletcurve.hpp.

Constructor & Destructor Documentation

◆ PiecewiseOptionletCurve() [1/2]

PiecewiseOptionletCurve ( const QuantLib::Date &  referenceDate,
const std::vector< QuantLib::ext::shared_ptr< helper > > &  instruments,
const QuantLib::Calendar &  calendar,
QuantLib::BusinessDayConvention  bdc,
const QuantLib::DayCounter &  dayCounter,
QuantLib::VolatilityType  volatilityType = QuantLib::Normal,
QuantLib::Real  displacement = 0.0,
bool  flatFirstPeriod = true,
const Interpolator &  i = Interpolator(),
const Bootstrap< this_curve > &  bootstrap = Bootstrap<this_curve>() 
)

Definition at line 178 of file piecewiseoptionletcurve.hpp.

183 : base_curve(referenceDate, calendar, bdc, dayCounter, volatilityType, displacement, flatFirstPeriod, i),
184 instruments_(instruments), accuracy_(1e-12), bootstrap_(bootstrap) {
185 bootstrap_.setup(this);
186}
QuantLib::Real displacement() const override
QuantLib::VolatilityType volatilityType() const override
InterpolatedOptionletCurve< Interpolator > base_curve
QuantLib::Real accuracy_
Accuracy of the match.
std::vector< QuantLib::ext::shared_ptr< helper > > instruments_
Vector of helper instruments to be matched.

◆ PiecewiseOptionletCurve() [2/2]

PiecewiseOptionletCurve ( QuantLib::Natural  settlementDays,
const std::vector< QuantLib::ext::shared_ptr< helper > > &  instruments,
const QuantLib::Calendar &  calendar,
QuantLib::BusinessDayConvention  bdc,
const QuantLib::DayCounter &  dayCounter,
QuantLib::VolatilityType  volatilityType = QuantLib::Normal,
QuantLib::Real  displacement = 0.0,
bool  flatFirstPeriod = true,
const Interpolator &  i = Interpolator(),
const Bootstrap< this_curve > &  bootstrap = Bootstrap<this_curve>() 
)

Definition at line 189 of file piecewiseoptionletcurve.hpp.

194 : base_curve(settlementDays, calendar, bdc, dayCounter, volatilityType, displacement, flatFirstPeriod, i),
195 instruments_(instruments), accuracy_(1e-12), bootstrap_(bootstrap) {
196 bootstrap_.setup(this);
197}

Member Function Documentation

◆ maxDate()

QuantLib::Date maxDate
override

Definition at line 200 of file piecewiseoptionletcurve.hpp.

200 {
201 calculate();
202 return base_curve::maxDate();
203}
QuantLib::Date maxDate() const override

◆ times()

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

Definition at line 206 of file piecewiseoptionletcurve.hpp.

206 {
207 calculate();
208 return base_curve::times();
209}
const std::vector< QuantLib::Time > & times() const

◆ dates()

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

Definition at line 212 of file piecewiseoptionletcurve.hpp.

212 {
213 calculate();
214 return base_curve::dates();
215}
const std::vector< QuantLib::Date > & dates() const

◆ volatilities()

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

Definition at line 218 of file piecewiseoptionletcurve.hpp.

218 {
219 calculate();
221}
const std::vector< QuantLib::Real > & volatilities() const

◆ nodes()

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

Definition at line 225 of file piecewiseoptionletcurve.hpp.

225 {
226 calculate();
227 return base_curve::nodes();
228}
std::vector< std::pair< QuantLib::Date, QuantLib::Real > > nodes() const

◆ update()

void update
override

Definition at line 231 of file piecewiseoptionletcurve.hpp.

231 {
232
233 // Derives from InterpolatedOptionletCurve and LazyObject, both of which are Observers and have their own
234 // implementation of the virtual update() method.
235
236 // Call LazyObject::update() to notify Observers but only when this PiecewiseOptionletCurve has been "calculated"
237 // and it has not been "frozen"
238 LazyObject::update();
239
240 // Do not want to call TermStructure::update() here because it will notify all Observers regardless of whether
241 // this PiecewiseOptionletCurve's "calculated" or "frozen" status i.e. defeating the purpose of LazyObject
242
243 // We do not want to miss changes in Settings::instance().evaluationDate() if this TermStructure has a floating
244 // reference date so we make sure that TermStructure::updated_ is set to false.
245 if (this->moving_)
246 this->updated_ = false;
247}

◆ performCalculations()

void performCalculations
overrideprivate

Definition at line 257 of file piecewiseoptionletcurve.hpp.

257 {
258 // Perform the bootstrap
259 bootstrap_.calculate();
260}

◆ volatilityImpl()

QuantLib::Real volatilityImpl ( QuantLib::Time  optionTime,
QuantLib::Rate  strike 
) const
overrideprivate

Definition at line 250 of file piecewiseoptionletcurve.hpp.

251 {
252 calculate();
253 return base_curve::volatilityImpl(optionTime, strike);
254}
QuantLib::Real volatilityImpl(QuantLib::Time optionTime, QuantLib::Rate strike) const override

Friends And Related Function Documentation

◆ Bootstrap< this_curve >

friend class Bootstrap< this_curve >
friend

Definition at line 167 of file piecewiseoptionletcurve.hpp.

◆ BootstrapError< this_curve >

friend class BootstrapError< this_curve >
friend

Definition at line 167 of file piecewiseoptionletcurve.hpp.

◆ PenaltyFunction< this_curve >

friend class PenaltyFunction< this_curve >
friend

Definition at line 167 of file piecewiseoptionletcurve.hpp.

Member Data Documentation

◆ instruments_

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

Vector of helper instruments to be matched.

Definition at line 164 of file piecewiseoptionletcurve.hpp.

◆ accuracy_

QuantLib::Real accuracy_
private

Accuracy of the match.

Definition at line 167 of file piecewiseoptionletcurve.hpp.

◆ bootstrap_

Bootstrap<this_curve> bootstrap_
private

Definition at line 174 of file piecewiseoptionletcurve.hpp.