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

yield plus default yield term structure More...

#include <qle/termstructures/yieldplusdefaultyieldtermstructure.hpp>

+ Inheritance diagram for YieldPlusDefaultYieldTermStructure:
+ Collaboration diagram for YieldPlusDefaultYieldTermStructure:

Public Member Functions

 YieldPlusDefaultYieldTermStructure (const Handle< YieldTermStructure > &yts, const std::vector< Handle< DefaultProbabilityTermStructure > > &df, const std::vector< Handle< Quote > > &rr, const std::vector< Real > &weights)
 
Date maxDate () const override
 
const Date & referenceDate () const override
 

Protected Member Functions

Real discountImpl (Time t) const override
 

Protected Attributes

const Handle< YieldTermStructure > yts_
 
const std::vector< Handle< DefaultProbabilityTermStructure > > df_
 
const std::vector< Handle< Quote > > rr_
 
const std::vector< Real > weights_
 

Detailed Description

yield plus default yield term structure

this yield term structure is defined by discount factors given by a weighted sum of survival probabilities of underlying default curves plus the discount factor of a reference yield curve

Definition at line 37 of file yieldplusdefaultyieldtermstructure.hpp.

Constructor & Destructor Documentation

◆ YieldPlusDefaultYieldTermStructure()

YieldPlusDefaultYieldTermStructure ( const Handle< YieldTermStructure > &  yts,
const std::vector< Handle< DefaultProbabilityTermStructure > > &  df,
const std::vector< Handle< Quote > > &  rr,
const std::vector< Real > &  weights 
)

Definition at line 39 of file yieldplusdefaultyieldtermstructure.hpp.

42 : YieldTermStructure(yts->dayCounter()), yts_(yts), df_(df), rr_(rr), weights_(weights) {
43 QL_REQUIRE(df_.size() == weights_.size(), "YieldPlusDefaultYieldTermStructure: default curve size ("
44 << df_.size() << ") must match weights size (" << weights_.size()
45 << ")");
46 QL_REQUIRE(df_.size() == rr_.size(), "YieldPlusDefaultYieldTermStructure: rec rate size ("
47 << rr_.size() << ") must match weights size (" << weights_.size()
48 << ")");
49 // todo check consistent day counters?
50 registerWith(yts);
51 for (Size i = 0; i < df_.size(); ++i)
52 registerWith(df_[i]);
53 for (Size i = 0; i < rr_.size(); ++i)
54 registerWith(rr_[i]);
55 }
const std::vector< Handle< DefaultProbabilityTermStructure > > df_

Member Function Documentation

◆ maxDate()

Date maxDate ( ) const
override

Definition at line 69 of file yieldplusdefaultyieldtermstructure.hpp.

69{ return yts_->maxDate(); }

◆ referenceDate()

const Date & referenceDate ( ) const
override

Definition at line 71 of file yieldplusdefaultyieldtermstructure.hpp.

71 {
72 // todo check consistent reference dates?
73 return yts_->referenceDate();
74}

◆ discountImpl()

Real discountImpl ( Time  t) const
overrideprotected

Definition at line 76 of file yieldplusdefaultyieldtermstructure.hpp.

76 {
77 Real d = yts_->discount(t);
78 for (Size i = 0; i < df_.size(); ++i) {
79 // use implied surv prob adjusted by a factor corresponding to a market value recovery model:
80 // adj_S = S^{1-R}
81 d *= std::pow(df_[i]->survivalProbability(t), weights_[i] * (1.0 - rr_[i]->value()));
82 }
83 return d;
84}

Member Data Documentation

◆ yts_

const Handle<YieldTermStructure> yts_
protected

Definition at line 61 of file yieldplusdefaultyieldtermstructure.hpp.

◆ df_

const std::vector<Handle<DefaultProbabilityTermStructure> > df_
protected

Definition at line 62 of file yieldplusdefaultyieldtermstructure.hpp.

◆ rr_

const std::vector<Handle<Quote> > rr_
protected

Definition at line 63 of file yieldplusdefaultyieldtermstructure.hpp.

◆ weights_

const std::vector<Real> weights_
protected

Definition at line 64 of file yieldplusdefaultyieldtermstructure.hpp.