#include <qle/termstructures/discountratiomodifiedcurve.hpp>
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. More... | |
Inspectors | |
const QuantLib::Handle< QuantLib::YieldTermStructure > & | baseCurve () const |
Return the base curve. More... | |
const QuantLib::Handle< QuantLib::YieldTermStructure > & | numeratorCurve () const |
Return the numerator curve. More... | |
const QuantLib::Handle< QuantLib::YieldTermStructure > & | denominatorCurve () const |
Return the denominator curve. More... | |
Observer interface | |
void | update () override |
YieldTermStructure interface | |
QuantLib::Handle< YieldTermStructure > | baseCurve_ |
QuantLib::Handle< YieldTermStructure > | numCurve_ |
QuantLib::Handle< YieldTermStructure > | denCurve_ |
QuantLib::DayCounter | dayCounter () const override |
Returns the day counter from the base curve. More... | |
QuantLib::Calendar | calendar () const override |
Returns the calendar from the base curve. More... | |
QuantLib::Natural | settlementDays () const override |
Returns the settlement days from the base curve. More... | |
const QuantLib::Date & | referenceDate () const override |
Returns the reference date from the base curve. More... | |
QuantLib::Date | maxDate () const override |
All range checks happen in the underlying curves. More... | |
QuantLib::DiscountFactor | discountImpl (QuantLib::Time t) const override |
Perform the discount factor calculation using the three yield curves. More... | |
void | check () const |
Check that none of the underlying term structures are empty. More... | |
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.
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. Definition at line 58 of file discountratiomodifiedcurve.hpp.
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.
Definition at line 32 of file discountratiomodifiedcurve.cpp.
const QuantLib::Handle< QuantLib::YieldTermStructure > & baseCurve | ( | ) | const |
const QuantLib::Handle< QuantLib::YieldTermStructure > & numeratorCurve | ( | ) | const |
const QuantLib::Handle< QuantLib::YieldTermStructure > & denominatorCurve | ( | ) | const |
|
override |
Returns the day counter from the base curve.
Definition at line 49 of file discountratiomodifiedcurve.cpp.
|
override |
Returns the calendar from the base curve.
Definition at line 51 of file discountratiomodifiedcurve.cpp.
|
override |
Returns the settlement days from the base curve.
Definition at line 53 of file discountratiomodifiedcurve.cpp.
|
override |
Returns the reference date from the base curve.
Definition at line 55 of file discountratiomodifiedcurve.cpp.
|
override |
All range checks happen in the underlying curves.
Definition at line 86 of file discountratiomodifiedcurve.hpp.
|
override |
Definition at line 57 of file discountratiomodifiedcurve.cpp.
|
overrideprotected |
Perform the discount factor calculation using the three yield curves.
Definition at line 64 of file discountratiomodifiedcurve.cpp.
|
private |
Check that none of the underlying term structures are empty.
Definition at line 68 of file discountratiomodifiedcurve.cpp.
|
private |
Definition at line 102 of file discountratiomodifiedcurve.hpp.
|
private |
Definition at line 103 of file discountratiomodifiedcurve.hpp.
|
private |
Definition at line 104 of file discountratiomodifiedcurve.hpp.