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

#include <qle/models/cirppimplieddefaulttermstructure.hpp>

+ Inheritance diagram for CirppImpliedDefaultTermStructure:
+ Collaboration diagram for CirppImpliedDefaultTermStructure:

Public Member Functions

 CirppImpliedDefaultTermStructure (const QuantLib::ext::shared_ptr< CrCirpp > &model, const Size index, const DayCounter &dc=DayCounter(), const bool purelyTimeBased=false)
 
Date maxDate () const override
 
Time maxTime () const override
 
const Date & referenceDate () const override
 
void referenceDate (const Date &d)
 
void referenceTime (const Time t)
 
void state (const Real y)
 
void move (const Date &d, const Real y)
 
void move (const Time t, const Real y)
 
void update () override
 

Protected Member Functions

Probability survivalProbabilityImpl (Time) const override
 

Protected Attributes

const QuantLib::ext::shared_ptr< CrCirppmodel_
 
const Size index_
 
const bool purelyTimeBased_
 
Date referenceDate_
 
Real relativeTime_
 
Real y_
 

Detailed Description

The termstructure has the reference date of the model's termstructure at construction, but you can vary this as well as the state. The purely time based variant is mainly there for performance reasons, note that it does not provide the full term structure interface and does not send notifications on reference time updates.

Definition at line 45 of file cirppimplieddefaulttermstructure.hpp.

Constructor & Destructor Documentation

◆ CirppImpliedDefaultTermStructure()

CirppImpliedDefaultTermStructure ( const QuantLib::ext::shared_ptr< CrCirpp > &  model,
const Size  index,
const DayCounter &  dc = DayCounter(),
const bool  purelyTimeBased = false 
)

Definition at line 23 of file cirppimplieddefaulttermstructure.cpp.

+ Here is the call graph for this function:

Member Function Documentation

◆ maxDate()

Date maxDate ( ) const
override

Definition at line 75 of file cirppimplieddefaulttermstructure.hpp.

75 {
76 // we don't care - let the underlying classes throw
77 // exceptions if applicable
78 return Date::maxDate();
79}

◆ maxTime()

Time maxTime ( ) const
override

Definition at line 81 of file cirppimplieddefaulttermstructure.hpp.

81 {
82 // see maxDate
83 return QL_MAX_REAL;
84}

◆ referenceDate() [1/2]

const Date & referenceDate ( ) const
override

Definition at line 86 of file cirppimplieddefaulttermstructure.hpp.

86 {
87 QL_REQUIRE(!purelyTimeBased_, "reference date not available for purely "
88 "time based term structure");
89 return referenceDate_;
90}
+ Here is the caller graph for this function:

◆ referenceDate() [2/2]

void referenceDate ( const Date &  d)

Definition at line 92 of file cirppimplieddefaulttermstructure.hpp.

92 {
93 QL_REQUIRE(!purelyTimeBased_, "reference date not available for purely "
94 "time based term structure");
96 update();
97}
+ Here is the call graph for this function:

◆ referenceTime()

void referenceTime ( const Time  t)

Definition at line 99 of file cirppimplieddefaulttermstructure.hpp.

99 {
100 QL_REQUIRE(purelyTimeBased_, "reference time can only be set for purely "
101 "time based term structure");
102 relativeTime_ = t;
103}
+ Here is the caller graph for this function:

◆ state()

void state ( const Real  y)

Definition at line 105 of file cirppimplieddefaulttermstructure.hpp.

105 {
106 y_ = y;
107}
+ Here is the caller graph for this function:

◆ move() [1/2]

void move ( const Date &  d,
const Real  y 
)

Definition at line 109 of file cirppimplieddefaulttermstructure.hpp.

+ Here is the call graph for this function:

◆ move() [2/2]

void move ( const Time  t,
const Real  y 
)

Definition at line 114 of file cirppimplieddefaulttermstructure.hpp.

+ Here is the call graph for this function:

◆ update()

void update ( )
override

Definition at line 119 of file cirppimplieddefaulttermstructure.hpp.

119 {
120 if (!purelyTimeBased_) {
121 relativeTime_ = dayCounter().yearFraction(model_->defaultCurve()->referenceDate(), referenceDate_);
122 }
123 notifyObservers();
124}
+ Here is the caller graph for this function:

◆ survivalProbabilityImpl()

Real survivalProbabilityImpl ( Time  t) const
overrideprotected

Definition at line 126 of file cirppimplieddefaulttermstructure.hpp.

126 {
127 QL_REQUIRE(t >= 0.0, "negative time (" << t << ") given");
128 if (QuantLib::close_enough(t, 0))
129 return 1.0;
130 return model_->survivalProbability(relativeTime_, relativeTime_+ t, y_);
131}

Member Data Documentation

◆ model_

const QuantLib::ext::shared_ptr<CrCirpp> model_
protected

Definition at line 66 of file cirppimplieddefaulttermstructure.hpp.

◆ index_

const Size index_
protected

Definition at line 67 of file cirppimplieddefaulttermstructure.hpp.

◆ purelyTimeBased_

const bool purelyTimeBased_
protected

Definition at line 68 of file cirppimplieddefaulttermstructure.hpp.

◆ referenceDate_

Date referenceDate_
protected

Definition at line 69 of file cirppimplieddefaulttermstructure.hpp.

◆ relativeTime_

Real relativeTime_
protected

Definition at line 70 of file cirppimplieddefaulttermstructure.hpp.

◆ y_

Real y_
protected

Definition at line 70 of file cirppimplieddefaulttermstructure.hpp.