Logo
Reference manual - version qle_version
Public Member Functions | List of all members
DiscountRatioModifiedCurve Class Reference

#include <qle/termstructures/discountratiomodifiedcurve.hpp>

+ Inheritance diagram for DiscountRatioModifiedCurve:

Public Member Functions

 DiscountRatioModifiedCurve (const QuantLib::Handle< QuantLib::YieldTermStructure > &baseCurve, const QuantLib::Handle< QuantLib::YieldTermStructure > &numCurve, const QuantLib::Handle< QuantLib::YieldTermStructure > &denCurve)
 Constructor providing the three underlying yield curves.
 
Inspectors
const QuantLib::Handle< QuantLib::YieldTermStructure > & baseCurve () const
 Return the base curve.
 
const QuantLib::Handle< QuantLib::YieldTermStructure > & numeratorCurve () const
 Return the numerator curve.
 
const QuantLib::Handle< QuantLib::YieldTermStructure > & denominatorCurve () const
 Return the denominator curve.
 
Observer interface
void update () override
 

YieldTermStructure interface

QuantLib::DayCounter dayCounter () const override
 Returns the day counter from the base curve.
 
QuantLib::Calendar calendar () const override
 Returns the calendar from the base curve.
 
QuantLib::Natural settlementDays () const override
 Returns the settlement days from the base curve.
 
const QuantLib::Date & referenceDate () const override
 Returns the reference date from the base curve.
 
QuantLib::Date maxDate () const override
 All range checks happen in the underlying curves.
 
QuantLib::DiscountFactor discountImpl (QuantLib::Time t) const override
 Perform the discount factor calculation using the three yield curves.
 

Detailed Description

The DiscountRatioModifiedCurve depends on three other yield curves. The dependency is via the discount factor. In particular, the discount factor \(P(0, t)\) at time \(t\) is given by:

\[ P(0, t) = P_b(0, t) \frac{P_n(0, t)}{P_d(0, t)} \]

where \(P_b(0, t)\) is the base curve discount factor, \(P_n(0, t)\) is the numerator curve discount factor and \(P_d(0, t)\) is the denominator curve discount factor.

A use case for this type of discount curve is where we need to discount cashflows denominated in a currency, call it currency 1, and collateralised in a different currency, call it currency 2. Let \(P_{1, 2}(0, t)\) denote the discount factor on this curve at time \(t\). Assume that we have curves for discounting cashflows denominated in currency 1 and currency 2 and collaterised in a common reference currency. Let \(P_{1, ref}(0, t)\) and \(P_{2, ref}(0, t)\) denote the discount factors on these two curves respectively. Assume also that we have a curve for discounting cashflows denominated and collateralised in currency 2. Let \(P_{2, 2}(0, t)\) denote the discount factor on this curve at time \(t\). Then, by using DiscountRatioModifiedCurve we can set up the following relation:

\[ P_{1, 2}(0, t) = P_{2, 2}(0, t) \frac{P_{1, ref}(0, t)}{P_{2, ref}(0, t)} \]

The assumption here is that forward FX rates remain the same if the FX forward's collateral currency is switched from the reference currency to currency 2.

Warning:
One must be careful about mixing floating reference date and fixed reference date curves together as the underlying curves in this yield curve and then moving Settings::instance().evaluationDate(). This is alluded to in the corresponding unit tests. If the moving_ member variable of TermStructure had an inspector method, then we could enforce that all underlying curves here are either floating or fixed reference date curves.