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

CMS spread - coupon pricer. More...

#include <lognormalcmsspreadpricer.hpp>

+ Inheritance diagram for LognormalCmsSpreadPricer:
+ Collaboration diagram for LognormalCmsSpreadPricer:

Public Member Functions

 LognormalCmsSpreadPricer (const ext::shared_ptr< CmsCouponPricer > &cmsPricer, const Handle< Quote > &correlation, Handle< YieldTermStructure > couponDiscountCurve=Handle< YieldTermStructure >(), Size IntegrationPoints=16, const ext::optional< VolatilityType > &volatilityType=ext::nullopt, Real shift1=Null< Real >(), Real shift2=Null< Real >())
 
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
 
- Public Member Functions inherited from CmsSpreadCouponPricer
 CmsSpreadCouponPricer (Handle< Quote > correlation=Handle< Quote >())
 
Handle< Quotecorrelation () const
 
void setCorrelation (const Handle< Quote > &correlation=Handle< Quote >())
 
- 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 ()
 

Private Member Functions

void initialize (const FloatingRateCoupon &coupon) override
 
Real optionletPrice (Option::Type optionType, Real strike) const
 
Real integrand (Real) const
 
Real integrand_normal (Real) const
 

Private Attributes

ext::shared_ptr< CmsCouponPricercmsPricer_
 
Handle< YieldTermStructurecouponDiscountCurve_
 
const CmsSpreadCouponcoupon_
 
Date today_
 
Date fixingDate_
 
Date paymentDate_
 
Real fixingTime_
 
Real gearing_
 
Real spread_
 
Real spreadLegValue_
 
Real discount_
 
ext::shared_ptr< SwapSpreadIndexindex_
 
ext::shared_ptr< CumulativeNormalDistributioncnd_
 
ext::shared_ptr< GaussianQuadratureintegrator_
 
Real swapRate1_
 
Real swapRate2_
 
Real gearing1_
 
Real gearing2_
 
Real adjustedRate1_
 
Real adjustedRate2_
 
Real vol1_
 
Real vol2_
 
Real mu1_
 
Real mu2_
 
Real rho_
 
bool inheritedVolatilityType_
 
VolatilityType volType_
 
Real shift1_
 
Real shift2_
 
Real phi_
 
Real a_
 
Real b_
 
Real s1_
 
Real s2_
 
Real m1_
 
Real m2_
 
Real v1_
 
Real v2_
 
Real k_
 
Real alpha_
 
Real psi_
 
Option::Type optionType_
 
ext::shared_ptr< CmsCouponc1_
 
ext::shared_ptr< CmsCouponc2_
 

Additional Inherited Members

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

Detailed Description

CMS spread - coupon pricer.

The swap rate adjustments are computed using the given volatility structures for the underlyings in every case (w.r.t. volatility type and shift).

For the bivariate spread model, the volatility type and the shifts can be inherited (default), or explicitly specified. In the latter case the type, and (if lognormal) the shifts must be given (or are defaulted to zero, if not given).

References:

Brigo, Mercurio: Interst Rate Models - Theory and Practice, 2nd Edition, Springer, 2006, chapter 13.6.2

http://ssrn.com/abstract=2686998

Definition at line 60 of file lognormalcmsspreadpricer.hpp.

Constructor & Destructor Documentation

◆ LognormalCmsSpreadPricer()

LognormalCmsSpreadPricer ( const ext::shared_ptr< CmsCouponPricer > &  cmsPricer,
const Handle< Quote > &  correlation,
Handle< YieldTermStructure couponDiscountCurve = Handle<YieldTermStructure>(),
Size  IntegrationPoints = 16,
const ext::optional< VolatilityType > &  volatilityType = ext::nullopt,
Real  shift1 = Null<Real>(),
Real  shift2 = Null<Real>() 
)

Definition at line 45 of file lognormalcmsspreadpricer.cpp.

+ Here is the call graph for this function:

Member Function Documentation

◆ swapletPrice()

Real swapletPrice ( ) const
overridevirtual

Implements FloatingRateCouponPricer.

Definition at line 341 of file lognormalcmsspreadpricer.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 299 of file lognormalcmsspreadpricer.cpp.

+ Here is the call graph for this function:

◆ capletPrice()

Real capletPrice ( Rate  effectiveCap) const
overridevirtual

Implements FloatingRateCouponPricer.

Definition at line 303 of file lognormalcmsspreadpricer.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 317 of file lognormalcmsspreadpricer.cpp.

+ Here is the call graph for this function:

◆ floorletPrice()

Real floorletPrice ( Rate  effectiveFloor) const
overridevirtual

Implements FloatingRateCouponPricer.

Definition at line 322 of file lognormalcmsspreadpricer.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 336 of file lognormalcmsspreadpricer.cpp.

+ Here is the call graph for this function:

◆ initialize()

void initialize ( const FloatingRateCoupon coupon)
overrideprivatevirtual

Implements FloatingRateCouponPricer.

Definition at line 132 of file lognormalcmsspreadpricer.cpp.

+ Here is the call graph for this function:

◆ optionletPrice()

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

Definition at line 251 of file lognormalcmsspreadpricer.cpp.

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

◆ integrand()

Real integrand ( Real  x) const
private

Definition at line 83 of file lognormalcmsspreadpricer.cpp.

◆ integrand_normal()

Real integrand_normal ( Real  x) const
private

Definition at line 111 of file lognormalcmsspreadpricer.cpp.

+ Here is the call graph for this function:

Member Data Documentation

◆ cmsPricer_

ext::shared_ptr<CmsCouponPricer> cmsPricer_
private

Definition at line 89 of file lognormalcmsspreadpricer.hpp.

◆ couponDiscountCurve_

Handle<YieldTermStructure> couponDiscountCurve_
private

Definition at line 91 of file lognormalcmsspreadpricer.hpp.

◆ coupon_

const CmsSpreadCoupon* coupon_
private

Definition at line 93 of file lognormalcmsspreadpricer.hpp.

◆ today_

Date today_
private

Definition at line 95 of file lognormalcmsspreadpricer.hpp.

◆ fixingDate_

Date fixingDate_
private

Definition at line 95 of file lognormalcmsspreadpricer.hpp.

◆ paymentDate_

Date paymentDate_
private

Definition at line 95 of file lognormalcmsspreadpricer.hpp.

◆ fixingTime_

Real fixingTime_
private

Definition at line 97 of file lognormalcmsspreadpricer.hpp.

◆ gearing_

Real gearing_
private

Definition at line 99 of file lognormalcmsspreadpricer.hpp.

◆ spread_

Real spread_
private

Definition at line 99 of file lognormalcmsspreadpricer.hpp.

◆ spreadLegValue_

Real spreadLegValue_
private

Definition at line 100 of file lognormalcmsspreadpricer.hpp.

◆ discount_

Real discount_
private

Definition at line 101 of file lognormalcmsspreadpricer.hpp.

◆ index_

ext::shared_ptr<SwapSpreadIndex> index_
private

Definition at line 103 of file lognormalcmsspreadpricer.hpp.

◆ cnd_

ext::shared_ptr<CumulativeNormalDistribution> cnd_
private

Definition at line 105 of file lognormalcmsspreadpricer.hpp.

◆ integrator_

ext::shared_ptr<GaussianQuadrature> integrator_
private

Definition at line 106 of file lognormalcmsspreadpricer.hpp.

◆ swapRate1_

Real swapRate1_
private

Definition at line 108 of file lognormalcmsspreadpricer.hpp.

◆ swapRate2_

Real swapRate2_
private

Definition at line 108 of file lognormalcmsspreadpricer.hpp.

◆ gearing1_

Real gearing1_
private

Definition at line 108 of file lognormalcmsspreadpricer.hpp.

◆ gearing2_

Real gearing2_
private

Definition at line 108 of file lognormalcmsspreadpricer.hpp.

◆ adjustedRate1_

Real adjustedRate1_
private

Definition at line 109 of file lognormalcmsspreadpricer.hpp.

◆ adjustedRate2_

Real adjustedRate2_
private

Definition at line 109 of file lognormalcmsspreadpricer.hpp.

◆ vol1_

Real vol1_
private

Definition at line 110 of file lognormalcmsspreadpricer.hpp.

◆ vol2_

Real vol2_
private

Definition at line 110 of file lognormalcmsspreadpricer.hpp.

◆ mu1_

Real mu1_
private

Definition at line 111 of file lognormalcmsspreadpricer.hpp.

◆ mu2_

Real mu2_
private

Definition at line 111 of file lognormalcmsspreadpricer.hpp.

◆ rho_

Real rho_
private

Definition at line 112 of file lognormalcmsspreadpricer.hpp.

◆ inheritedVolatilityType_

bool inheritedVolatilityType_
private

Definition at line 114 of file lognormalcmsspreadpricer.hpp.

◆ volType_

VolatilityType volType_
private

Definition at line 115 of file lognormalcmsspreadpricer.hpp.

◆ shift1_

Real shift1_
private

Definition at line 116 of file lognormalcmsspreadpricer.hpp.

◆ shift2_

Real shift2_
private

Definition at line 116 of file lognormalcmsspreadpricer.hpp.

◆ phi_

Real phi_
mutableprivate

Definition at line 118 of file lognormalcmsspreadpricer.hpp.

◆ a_

Real a_
private

Definition at line 118 of file lognormalcmsspreadpricer.hpp.

◆ b_

Real b_
private

Definition at line 118 of file lognormalcmsspreadpricer.hpp.

◆ s1_

Real s1_
private

Definition at line 118 of file lognormalcmsspreadpricer.hpp.

◆ s2_

Real s2_
private

Definition at line 118 of file lognormalcmsspreadpricer.hpp.

◆ m1_

Real m1_
private

Definition at line 118 of file lognormalcmsspreadpricer.hpp.

◆ m2_

Real m2_
private

Definition at line 118 of file lognormalcmsspreadpricer.hpp.

◆ v1_

Real v1_
private

Definition at line 118 of file lognormalcmsspreadpricer.hpp.

◆ v2_

Real v2_
private

Definition at line 118 of file lognormalcmsspreadpricer.hpp.

◆ k_

Real k_
private

Definition at line 118 of file lognormalcmsspreadpricer.hpp.

◆ alpha_

Real alpha_
mutableprivate

Definition at line 119 of file lognormalcmsspreadpricer.hpp.

◆ psi_

Real psi_
private

Definition at line 119 of file lognormalcmsspreadpricer.hpp.

◆ optionType_

Option::Type optionType_
mutableprivate

Definition at line 120 of file lognormalcmsspreadpricer.hpp.

◆ c1_

ext::shared_ptr<CmsCoupon> c1_
private

Definition at line 122 of file lognormalcmsspreadpricer.hpp.

◆ c2_

ext::shared_ptr<CmsCoupon> c2_
private

Definition at line 122 of file lognormalcmsspreadpricer.hpp.