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
LgmImpliedDefaultTermStructure Class Reference

Lgm Implied Default Term Structure. More...

#include <qle/models/lgmimplieddefaulttermstructure.hpp>

+ Inheritance diagram for LgmImpliedDefaultTermStructure:
+ Collaboration diagram for LgmImpliedDefaultTermStructure:

Public Member Functions

 LgmImpliedDefaultTermStructure (const QuantLib::ext::shared_ptr< CrossAssetModel > &model, const Size index, const Size currency, 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 z, const Real y)
 
void move (const Date &d, const Real z, const Real y)
 
void move (const Time t, const Real z, const Real y)
 
void update () override
 

Protected Member Functions

Probability survivalProbabilityImpl (Time) const override
 

Protected Attributes

const QuantLib::ext::shared_ptr< CrossAssetModelmodel_
 
const Size index_
 
const Size currency_
 
const bool purelyTimeBased_
 
Date referenceDate_
 
Real relativeTime_
 
Real z_
 
Real y_
 

Detailed Description

Lgm Implied Default Term Structure.

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 46 of file lgmimplieddefaulttermstructure.hpp.

Constructor & Destructor Documentation

◆ LgmImpliedDefaultTermStructure()

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

Definition at line 23 of file lgmimplieddefaulttermstructure.cpp.

26 : SurvivalProbabilityStructure(dc == DayCounter() ? model->irlgm1f(0)->termStructure()->dayCounter() : dc),
27 model_(model), index_(index), currency_(currency), purelyTimeBased_(purelyTimeBased),
28 referenceDate_(purelyTimeBased ? Null<Date>() : model_->irlgm1f(0)->termStructure()->referenceDate()), z_(0.0),
29 y_(0.0) {
30 registerWith(model_);
31 update();
32}
const QuantLib::ext::shared_ptr< CrossAssetModel > model_
+ Here is the call graph for this function:

Member Function Documentation

◆ maxDate()

Date maxDate ( ) const
override

Definition at line 77 of file lgmimplieddefaulttermstructure.hpp.

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

◆ maxTime()

Time maxTime ( ) const
override

Definition at line 83 of file lgmimplieddefaulttermstructure.hpp.

83 {
84 // see maxDate
85 return QL_MAX_REAL;
86}

◆ referenceDate() [1/2]

const Date & referenceDate ( ) const
override

Definition at line 88 of file lgmimplieddefaulttermstructure.hpp.

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

◆ referenceDate() [2/2]

void referenceDate ( const Date &  d)

Definition at line 94 of file lgmimplieddefaulttermstructure.hpp.

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

◆ referenceTime()

void referenceTime ( const Time  t)

Definition at line 101 of file lgmimplieddefaulttermstructure.hpp.

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

◆ state()

void state ( const Real  z,
const Real  y 
)

Definition at line 107 of file lgmimplieddefaulttermstructure.hpp.

107 {
108 z_ = z;
109 y_ = y;
110}
+ Here is the caller graph for this function:

◆ move() [1/2]

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

Definition at line 112 of file lgmimplieddefaulttermstructure.hpp.

112 {
113 state(z, y);
114 referenceDate(d);
115}
+ Here is the call graph for this function:

◆ move() [2/2]

void move ( const Time  t,
const Real  z,
const Real  y 
)

Definition at line 117 of file lgmimplieddefaulttermstructure.hpp.

117 {
118 state(z, y);
119 referenceTime(t);
120}
+ Here is the call graph for this function:

◆ update()

void update ( )
override

Definition at line 122 of file lgmimplieddefaulttermstructure.hpp.

122 {
123 if (!purelyTimeBased_) {
124 relativeTime_ = dayCounter().yearFraction(model_->irlgm1f(0)->termStructure()->referenceDate(), referenceDate_);
125 }
126 notifyObservers();
127}
+ Here is the caller graph for this function:

◆ survivalProbabilityImpl()

Real survivalProbabilityImpl ( Time  t) const
overrideprotected

Definition at line 129 of file lgmimplieddefaulttermstructure.hpp.

129 {
130 QL_REQUIRE(t >= 0.0, "negative time (" << t << ") given");
131 return model_->crlgm1fS(index_, currency_, relativeTime_, relativeTime_ + t, z_, y_).second;
132}

Member Data Documentation

◆ model_

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

Definition at line 68 of file lgmimplieddefaulttermstructure.hpp.

◆ index_

const Size index_
protected

Definition at line 69 of file lgmimplieddefaulttermstructure.hpp.

◆ currency_

const Size currency_
protected

Definition at line 69 of file lgmimplieddefaulttermstructure.hpp.

◆ purelyTimeBased_

const bool purelyTimeBased_
protected

Definition at line 70 of file lgmimplieddefaulttermstructure.hpp.

◆ referenceDate_

Date referenceDate_
protected

Definition at line 71 of file lgmimplieddefaulttermstructure.hpp.

◆ relativeTime_

Real relativeTime_
protected

Definition at line 72 of file lgmimplieddefaulttermstructure.hpp.

◆ z_

Real z_
protected

Definition at line 72 of file lgmimplieddefaulttermstructure.hpp.

◆ y_

Real y_
protected

Definition at line 72 of file lgmimplieddefaulttermstructure.hpp.