Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | List of all members
IborFallbackCurve Class Reference

#include <qle/termstructures/iborfallbackcurve.hpp>

+ Inheritance diagram for IborFallbackCurve:
+ Collaboration diagram for IborFallbackCurve:

Public Member Functions

 IborFallbackCurve (const QuantLib::ext::shared_ptr< IborIndex > &originalIndex, const QuantLib::ext::shared_ptr< OvernightIndex > &rfrIndex, const Real spread, const Date &switchDate)
 
QuantLib::ext::shared_ptr< IborIndex > originalIndex () const
 
QuantLib::ext::shared_ptr< OvernightIndex > rfrIndex () const
 
Real spread () const
 
const Date & switchDate () const
 
const Date & referenceDate () const override
 
Date maxDate () const override
 
Calendar calendar () const override
 
Natural settlementDays () const override
 

Private Member Functions

Real discountImpl (QuantLib::Time t) const override
 

Private Attributes

QuantLib::ext::shared_ptr< IborIndex > originalIndex_
 
QuantLib::ext::shared_ptr< OvernightIndex > rfrIndex_
 
Real spread_
 
Date switchDate_
 

Detailed Description

Definition at line 31 of file iborfallbackcurve.hpp.

Constructor & Destructor Documentation

◆ IborFallbackCurve()

IborFallbackCurve ( const QuantLib::ext::shared_ptr< IborIndex > &  originalIndex,
const QuantLib::ext::shared_ptr< OvernightIndex > &  rfrIndex,
const Real  spread,
const Date &  switchDate 
)

Definition at line 29 of file iborfallbackcurve.cpp.

32 : YieldTermStructure(originalIndex->forwardingTermStructure()->dayCounter()), originalIndex_(originalIndex),
34 registerWith(originalIndex->forwardingTermStructure());
35 registerWith(rfrIndex->forwardingTermStructure());
36 // Always enable extrapolation: The original and rfr index forwarding curves might have different settings
37 // so we do not want to make things overly complicated here.
38 enableExtrapolation();
39}
QuantLib::ext::shared_ptr< IborIndex > originalIndex_
QuantLib::ext::shared_ptr< OvernightIndex > rfrIndex_
QuantLib::ext::shared_ptr< OvernightIndex > rfrIndex() const
const Date & switchDate() const
QuantLib::ext::shared_ptr< IborIndex > originalIndex() const
+ Here is the call graph for this function:

Member Function Documentation

◆ originalIndex()

QuantLib::ext::shared_ptr< IborIndex > originalIndex ( ) const

Definition at line 41 of file iborfallbackcurve.cpp.

41{ return originalIndex_; }
+ Here is the caller graph for this function:

◆ rfrIndex()

QuantLib::ext::shared_ptr< OvernightIndex > rfrIndex ( ) const

Definition at line 43 of file iborfallbackcurve.cpp.

43{ return rfrIndex_; }
+ Here is the caller graph for this function:

◆ spread()

Real spread ( ) const

Definition at line 45 of file iborfallbackcurve.cpp.

45{ return spread_; }

◆ switchDate()

const Date & switchDate ( ) const

Definition at line 47 of file iborfallbackcurve.cpp.

47{ return switchDate_; }

◆ referenceDate()

const Date & referenceDate ( ) const
override

Definition at line 49 of file iborfallbackcurve.cpp.

49 {
50 return originalIndex_->forwardingTermStructure()->referenceDate();
51}

◆ maxDate()

Date maxDate ( ) const
override

Definition at line 53 of file iborfallbackcurve.cpp.

53{ return originalIndex_->forwardingTermStructure()->maxDate(); }

◆ calendar()

Calendar calendar ( ) const
override

Definition at line 55 of file iborfallbackcurve.cpp.

55{ return originalIndex_->forwardingTermStructure()->calendar(); }

◆ settlementDays()

Natural settlementDays ( ) const
override

Definition at line 57 of file iborfallbackcurve.cpp.

57 {
58 return originalIndex_->forwardingTermStructure()->settlementDays();
59}

◆ discountImpl()

Real discountImpl ( QuantLib::Time  t) const
overrideprivate

Definition at line 61 of file iborfallbackcurve.cpp.

61 {
62 Date today = Settings::instance().evaluationDate();
63 if (today < switchDate_) {
64 return originalIndex_->forwardingTermStructure()->discount(t);
65 }
66 Date endDate = today + originalIndex_->tenor();
67 Real couponTime = rfrIndex_->dayCounter().yearFraction(today, endDate);
68 Real curveTime = timeFromReference(endDate);
69 Real s = std::log(1.0 + couponTime * spread_) / curveTime;
70 return rfrIndex_->forwardingTermStructure()->discount(t) * std::exp(-s * t);
71}

Member Data Documentation

◆ originalIndex_

QuantLib::ext::shared_ptr<IborIndex> originalIndex_
private

Definition at line 49 of file iborfallbackcurve.hpp.

◆ rfrIndex_

QuantLib::ext::shared_ptr<OvernightIndex> rfrIndex_
private

Definition at line 50 of file iborfallbackcurve.hpp.

◆ spread_

Real spread_
private

Definition at line 51 of file iborfallbackcurve.hpp.

◆ switchDate_

Date switchDate_
private

Definition at line 52 of file iborfallbackcurve.hpp.