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

Lgm Implied Yield Term Structure. More...

#include <qle/models/lgmimpliedyieldtermstructure.hpp>

+ Inheritance diagram for LgmImpliedYieldTermStructure:
+ Collaboration diagram for LgmImpliedYieldTermStructure:

Public Member Functions

 LgmImpliedYieldTermStructure (const QuantLib::ext::shared_ptr< LinearGaussMarkovModel > &model, const DayCounter &dc=DayCounter(), const bool purelyTimeBased=false, const bool cacheValues=false)
 
Date maxDate () const override
 
Time maxTime () const override
 
const Date & referenceDate () const override
 
virtual void referenceDate (const Date &d)
 
virtual void referenceTime (const Time t)
 
void state (const Real s)
 
void move (const Date &d, const Real s)
 
void move (const Time t, const Real s)
 
virtual void update () override
 

Protected Member Functions

Real discountImpl (Time t) const override
 

Protected Attributes

Real dt_
 
Real zeta_
 
Real Ht_
 
bool cacheValues_
 
const QuantLib::ext::shared_ptr< LinearGaussMarkovModelmodel_
 
const bool purelyTimeBased_
 
Date referenceDate_
 
Real relativeTime_
 
Real state_
 

Detailed Description

Lgm Implied Yield 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.

\ingroup models

Definition at line 46 of file lgmimpliedyieldtermstructure.hpp.

Constructor & Destructor Documentation

◆ LgmImpliedYieldTermStructure()

LgmImpliedYieldTermStructure ( const QuantLib::ext::shared_ptr< LinearGaussMarkovModel > &  model,
const DayCounter &  dc = DayCounter(),
const bool  purelyTimeBased = false,
const bool  cacheValues = false 
)

Definition at line 23 of file lgmimpliedyieldtermstructure.cpp.

26 : YieldTermStructure(dc == DayCounter() ? model->parametrization()->termStructure()->dayCounter() : dc),
27 cacheValues_(cacheValues), model_(model), purelyTimeBased_(purelyTimeBased),
28 referenceDate_(purelyTimeBased ? Null<Date>() : model_->parametrization()->termStructure()->referenceDate()),
29 state_(0.0) {
30 registerWith(model_);
31 update();
32}
const QuantLib::ext::shared_ptr< LinearGaussMarkovModel > model_
+ Here is the call graph for this function:

Member Function Documentation

◆ maxDate()

Date maxDate ( ) const
override

Definition at line 121 of file lgmimpliedyieldtermstructure.hpp.

121 {
122 // we don't care - let the underlying classes throw
123 // exceptions if applicable
124 return Date::maxDate();
125}

◆ maxTime()

Time maxTime ( ) const
override

Definition at line 127 of file lgmimpliedyieldtermstructure.hpp.

127 {
128 // see maxDate
129 return QL_MAX_REAL;
130}

◆ referenceDate() [1/2]

const Date & referenceDate ( ) const
override

Definition at line 132 of file lgmimpliedyieldtermstructure.hpp.

132 {
133 QL_REQUIRE(!purelyTimeBased_, "reference date not available for purely "
134 "time based term structure");
135 return referenceDate_;
136}
+ Here is the caller graph for this function:

◆ referenceDate() [2/2]

void referenceDate ( const Date &  d)
virtual

Reimplemented in LgmImpliedYtsFwdFwdCorrected.

Definition at line 138 of file lgmimpliedyieldtermstructure.hpp.

138 {
139 QL_REQUIRE(!purelyTimeBased_, "reference date not available for purely "
140 "time based term structure");
141 referenceDate_ = d;
142 update();
143}
+ Here is the call graph for this function:

◆ referenceTime()

void referenceTime ( const Time  t)
virtual

Reimplemented in LgmImpliedYtsFwdFwdCorrected.

Definition at line 158 of file lgmimpliedyieldtermstructure.hpp.

158 {
159 QL_REQUIRE(purelyTimeBased_, "reference time can only be set for purely "
160 "time based term structure");
161 relativeTime_ = t;
162 notifyObservers();
163}
+ Here is the caller graph for this function:

◆ state()

void state ( const Real  s)

Definition at line 178 of file lgmimpliedyieldtermstructure.hpp.

178 {
179 state_ = s;
180 notifyObservers();
181}

◆ move() [1/2]

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

Definition at line 183 of file lgmimpliedyieldtermstructure.hpp.

183 {
184
185 state_ = s;
186 referenceDate(d);
187}
+ Here is the call graph for this function:

◆ move() [2/2]

void move ( const Time  t,
const Real  s 
)

Definition at line 189 of file lgmimpliedyieldtermstructure.hpp.

189 {
190 state_ = s;
191 referenceTime(t);
192
193 notifyObservers();
194}
+ Here is the call graph for this function:

◆ update()

void update ( )
overridevirtual

Definition at line 196 of file lgmimpliedyieldtermstructure.hpp.

196 {
197 if (!purelyTimeBased_) {
199 dayCounter().yearFraction(model_->parametrization()->termStructure()->referenceDate(), referenceDate_);
200 }
201
202 notifyObservers();
203}
+ Here is the caller graph for this function:

◆ discountImpl()

Real discountImpl ( Time  t) const
overrideprotected

Definition at line 205 of file lgmimpliedyieldtermstructure.hpp.

205 {
206 QL_REQUIRE(t >= 0.0, "negative time (" << t << ") given");
207 return model_->discountBond(relativeTime_, relativeTime_ + t, state_);
208}
+ Here is the caller graph for this function:

Member Data Documentation

◆ dt_

Real dt_
mutableprotected

Definition at line 67 of file lgmimpliedyieldtermstructure.hpp.

◆ zeta_

Real zeta_
mutableprotected

Definition at line 68 of file lgmimpliedyieldtermstructure.hpp.

◆ Ht_

Real Ht_
mutableprotected

Definition at line 69 of file lgmimpliedyieldtermstructure.hpp.

◆ cacheValues_

bool cacheValues_
protected

Definition at line 70 of file lgmimpliedyieldtermstructure.hpp.

◆ model_

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

Definition at line 72 of file lgmimpliedyieldtermstructure.hpp.

◆ purelyTimeBased_

const bool purelyTimeBased_
protected

Definition at line 73 of file lgmimpliedyieldtermstructure.hpp.

◆ referenceDate_

Date referenceDate_
protected

Definition at line 74 of file lgmimpliedyieldtermstructure.hpp.

◆ relativeTime_

Real relativeTime_
protected

Definition at line 75 of file lgmimpliedyieldtermstructure.hpp.

◆ state_

Real state_
protected

Definition at line 75 of file lgmimpliedyieldtermstructure.hpp.