QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
Classes | Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
LinearTsrPricer Class Reference

CMS-coupon pricer. More...

#include <lineartsrpricer.hpp>

+ Inheritance diagram for LinearTsrPricer:
+ Collaboration diagram for LinearTsrPricer:

Classes

class  PriceHelper
 
struct  Settings
 
class  VegaRatioHelper
 

Public Member Functions

 LinearTsrPricer (const Handle< SwaptionVolatilityStructure > &swaptionVol, Handle< Quote > meanReversion, Handle< YieldTermStructure > couponDiscountCurve=Handle< YieldTermStructure >(), const Settings &settings=Settings(), ext::shared_ptr< Integrator > integrator=ext::shared_ptr< Integrator >())
 
Real swapletPrice () const override
 
Rate swapletRate () const override
 
Real capletPrice (Rate effectiveCap) const override
 
Rate capletRate (Rate effectiveCap) const override
 
Real floorletPrice (Rate effectiveFloor) const override
 
Rate floorletRate (Rate effectiveFloor) const override
 
Real meanReversion () const override
 
void setMeanReversion (const Handle< Quote > &meanReversion) override
 
- Public Member Functions inherited from CmsCouponPricer
 CmsCouponPricer (Handle< SwaptionVolatilityStructure > v=Handle< SwaptionVolatilityStructure >())
 
Handle< SwaptionVolatilityStructureswaptionVolatility () const
 
void setSwaptionVolatility (const Handle< SwaptionVolatilityStructure > &v=Handle< SwaptionVolatilityStructure >())
 
- Public Member Functions inherited from FloatingRateCouponPricer
 ~FloatingRateCouponPricer () override=default
 
void update () override
 
- Public Member Functions inherited from Observer
 Observer ()=default
 
 Observer (const Observer &)
 
Observeroperator= (const Observer &)
 
virtual ~Observer ()
 
std::pair< iterator, boolregisterWith (const ext::shared_ptr< Observable > &)
 
void registerWithObservables (const ext::shared_ptr< Observer > &)
 
Size unregisterWith (const ext::shared_ptr< Observable > &)
 
void unregisterWithAll ()
 
virtual void update ()=0
 
virtual void deepUpdate ()
 
- Public Member Functions inherited from Observable
 Observable ()
 
 Observable (const Observable &)
 
Observableoperator= (const Observable &)
 
 Observable (Observable &&)=delete
 
Observableoperator= (Observable &&)=delete
 
virtual ~Observable ()=default
 
void notifyObservers ()
 
- Public Member Functions inherited from MeanRevertingPricer
virtual Real meanReversion () const =0
 
virtual void setMeanReversion (const Handle< Quote > &)=0
 
virtual ~MeanRevertingPricer ()=default
 

Private Member Functions

Real GsrG (const Date &d) const
 
Real singularTerms (Option::Type type, Real strike) const
 
Real integrand (Real strike) const
 
void initialize (const FloatingRateCoupon &coupon) override
 
Real optionletPrice (Option::Type optionType, Real strike) const
 
Real strikeFromVegaRatio (Real ratio, Option::Type optionType, Real referenceStrike) const
 
Real strikeFromPrice (Real price, Option::Type optionType, Real referenceStrike) const
 

Private Attributes

Real a_
 
Real b_
 
Handle< QuotemeanReversion_
 
Handle< YieldTermStructureforwardCurve_
 
Handle< YieldTermStructurediscountCurve_
 
Handle< YieldTermStructurecouponDiscountCurve_
 
const CmsCouponcoupon_
 
Date today_
 
Date paymentDate_
 
Date fixingDate_
 
Real gearing_
 
Real spread_
 
Period swapTenor_
 
Real spreadLegValue_
 
Real swapRateValue_
 
Real couponDiscountRatio_
 
Real discountCurvePaymentDiscount_
 
Real annuity_
 
ext::shared_ptr< SwapIndexswapIndex_
 
ext::shared_ptr< FixedVsFloatingSwapswap_
 
ext::shared_ptr< SmileSectionsmileSection_
 
Settings settings_
 
DayCounter volDayCounter_
 
ext::shared_ptr< Integratorintegrator_
 
Real adjustedLowerBound_
 
Real adjustedUpperBound_
 

Static Private Attributes

static const Real defaultLowerBound = 0.0001
 
static const Real defaultUpperBound = 2.0000
 

Additional Inherited Members

- Public Types inherited from Observer
typedef set_type::iterator iterator
 

Detailed Description

CMS-coupon pricer.

Prices a cms coupon using a linear terminal swap rate model The slope parameter is linked to a gaussian short rate model. Reference: Andersen, Piterbarg, Interest Rate Modeling, 16.3.2

The cut off point for integration can be set

Definition at line 64 of file lineartsrpricer.hpp.

Constructor & Destructor Documentation

◆ LinearTsrPricer()

LinearTsrPricer ( const Handle< SwaptionVolatilityStructure > &  swaptionVol,
Handle< Quote meanReversion,
Handle< YieldTermStructure couponDiscountCurve = Handle<YieldTermStructure>(),
const Settings settings = Settings(),
ext::shared_ptr< Integrator integrator = ext::shared_ptr<Integrator>() 
)

Definition at line 54 of file lineartsrpricer.cpp.

+ Here is the call graph for this function:

Member Function Documentation

◆ swapletPrice()

Real swapletPrice ( ) const
overridevirtual

Implements FloatingRateCouponPricer.

Definition at line 420 of file lineartsrpricer.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ swapletRate()

Rate swapletRate ( ) const
overridevirtual

Implements FloatingRateCouponPricer.

Definition at line 375 of file lineartsrpricer.cpp.

+ Here is the call graph for this function:

◆ capletPrice()

Real capletPrice ( Rate  effectiveCap) const
overridevirtual

Implements FloatingRateCouponPricer.

Definition at line 380 of file lineartsrpricer.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ capletRate()

Rate capletRate ( Rate  effectiveCap) const
overridevirtual

Implements FloatingRateCouponPricer.

Definition at line 395 of file lineartsrpricer.cpp.

+ Here is the call graph for this function:

◆ floorletPrice()

Real floorletPrice ( Rate  effectiveFloor) const
overridevirtual

Implements FloatingRateCouponPricer.

Definition at line 400 of file lineartsrpricer.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ floorletRate()

Rate floorletRate ( Rate  effectiveFloor) const
overridevirtual

Implements FloatingRateCouponPricer.

Definition at line 415 of file lineartsrpricer.cpp.

+ Here is the call graph for this function:

◆ meanReversion()

Real meanReversion ( ) const
overridevirtual

Implements MeanRevertingPricer.

Definition at line 373 of file lineartsrpricer.cpp.

+ Here is the caller graph for this function:

◆ setMeanReversion()

void setMeanReversion ( const Handle< Quote > &  meanReversion)
overridevirtual

Implements MeanRevertingPricer.

Definition at line 177 of file lineartsrpricer.hpp.

+ Here is the call graph for this function:

◆ GsrG()

Real GsrG ( const Date d) const
private

Definition at line 71 of file lineartsrpricer.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ singularTerms()

Real singularTerms ( Option::Type  type,
Real  strike 
) const
private

Definition at line 81 of file lineartsrpricer.cpp.

+ Here is the caller graph for this function:

◆ integrand()

Real integrand ( Real  strike) const
private

Definition at line 94 of file lineartsrpricer.cpp.

◆ initialize()

void initialize ( const FloatingRateCoupon coupon)
overrideprivatevirtual

Implements FloatingRateCouponPricer.

Definition at line 100 of file lineartsrpricer.cpp.

+ Here is the call graph for this function:

◆ optionletPrice()

Real optionletPrice ( Option::Type  optionType,
Real  strike 
) const
private

Definition at line 272 of file lineartsrpricer.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ strikeFromVegaRatio()

Real strikeFromVegaRatio ( Real  ratio,
Option::Type  optionType,
Real  referenceStrike 
) const
private

Definition at line 208 of file lineartsrpricer.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ strikeFromPrice()

Real strikeFromPrice ( Real  price,
Option::Type  optionType,
Real  referenceStrike 
) const
private

Definition at line 241 of file lineartsrpricer.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ defaultLowerBound

const Real defaultLowerBound = 0.0001
staticprivate

Definition at line 67 of file lineartsrpricer.hpp.

◆ defaultUpperBound

const Real defaultUpperBound = 2.0000
staticprivate

Definition at line 68 of file lineartsrpricer.hpp.

◆ a_

Real a_
private

Definition at line 190 of file lineartsrpricer.hpp.

◆ b_

Real b_
private

Definition at line 190 of file lineartsrpricer.hpp.

◆ meanReversion_

Handle<Quote> meanReversion_
private

Definition at line 225 of file lineartsrpricer.hpp.

◆ forwardCurve_

Handle<YieldTermStructure> forwardCurve_
private

Definition at line 227 of file lineartsrpricer.hpp.

◆ discountCurve_

Handle<YieldTermStructure> discountCurve_
private

Definition at line 227 of file lineartsrpricer.hpp.

◆ couponDiscountCurve_

Handle<YieldTermStructure> couponDiscountCurve_
private

Definition at line 228 of file lineartsrpricer.hpp.

◆ coupon_

const CmsCoupon* coupon_
private

Definition at line 230 of file lineartsrpricer.hpp.

◆ today_

Date today_
private

Definition at line 232 of file lineartsrpricer.hpp.

◆ paymentDate_

Date paymentDate_
private

Definition at line 232 of file lineartsrpricer.hpp.

◆ fixingDate_

Date fixingDate_
private

Definition at line 232 of file lineartsrpricer.hpp.

◆ gearing_

Real gearing_
private

Definition at line 234 of file lineartsrpricer.hpp.

◆ spread_

Real spread_
private

Definition at line 234 of file lineartsrpricer.hpp.

◆ swapTenor_

Period swapTenor_
private

Definition at line 236 of file lineartsrpricer.hpp.

◆ spreadLegValue_

Real spreadLegValue_
private

Definition at line 237 of file lineartsrpricer.hpp.

◆ swapRateValue_

Real swapRateValue_
private

Definition at line 237 of file lineartsrpricer.hpp.

◆ couponDiscountRatio_

Real couponDiscountRatio_
private

Definition at line 237 of file lineartsrpricer.hpp.

◆ discountCurvePaymentDiscount_

Real discountCurvePaymentDiscount_
private

Definition at line 237 of file lineartsrpricer.hpp.

◆ annuity_

Real annuity_
private

Definition at line 238 of file lineartsrpricer.hpp.

◆ swapIndex_

ext::shared_ptr<SwapIndex> swapIndex_
private

Definition at line 240 of file lineartsrpricer.hpp.

◆ swap_

ext::shared_ptr<FixedVsFloatingSwap> swap_
private

Definition at line 241 of file lineartsrpricer.hpp.

◆ smileSection_

ext::shared_ptr<SmileSection> smileSection_
private

Definition at line 242 of file lineartsrpricer.hpp.

◆ settings_

Settings settings_
private

Definition at line 244 of file lineartsrpricer.hpp.

◆ volDayCounter_

DayCounter volDayCounter_
private

Definition at line 245 of file lineartsrpricer.hpp.

◆ integrator_

ext::shared_ptr<Integrator> integrator_
private

Definition at line 246 of file lineartsrpricer.hpp.

◆ adjustedLowerBound_

Real adjustedLowerBound_
private

Definition at line 248 of file lineartsrpricer.hpp.

◆ adjustedUpperBound_

Real adjustedUpperBound_
private

Definition at line 248 of file lineartsrpricer.hpp.