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

weighted yield term structure More...

#include <qle/termstructures/weightedyieldtermstructure.hpp>

+ Inheritance diagram for WeightedYieldTermStructure:
+ Collaboration diagram for WeightedYieldTermStructure:

Public Member Functions

 WeightedYieldTermStructure (const Handle< YieldTermStructure > &yts1, const Handle< YieldTermStructure > &yts2, const Real w1, const Real w2)
 
Date maxDate () const override
 
const Date & referenceDate () const override
 

Protected Member Functions

Real discountImpl (Time t) const override
 

Protected Attributes

const Handle< YieldTermStructure > yts1_
 
const Handle< YieldTermStructure > yts2_
 
const Real w1_
 
const Real w2_
 

Detailed Description

weighted yield term structure

this yield term structure is defined by discount factors given by a weighted geometric average of discount factors of underlying curves; this corresponds to a weighted arithmetic average of instantaneous forward rates and can be used to interpolate e.g. a Euribor2M curve between Euribor1M and Euribor3M (using w1=w2=0.5)

Definition at line 37 of file weightedyieldtermstructure.hpp.

Constructor & Destructor Documentation

◆ WeightedYieldTermStructure()

WeightedYieldTermStructure ( const Handle< YieldTermStructure > &  yts1,
const Handle< YieldTermStructure > &  yts2,
const Real  w1,
const Real  w2 
)

Definition at line 39 of file weightedyieldtermstructure.hpp.

41 : YieldTermStructure(yts1->dayCounter()), yts1_(yts1), yts2_(yts2), w1_(w1), w2_(w2) {
42 QL_REQUIRE(yts1->dayCounter() == yts2->dayCounter(),
43 "WeightedYieldTermStructure(): sources have inconsistent day counters ("
44 << yts1->dayCounter().name() << " vs. " << yts2->dayCounter().name());
45 registerWith(yts1);
46 registerWith(yts2);
47 }
const Handle< YieldTermStructure > yts1_
const Handle< YieldTermStructure > yts2_

Member Function Documentation

◆ maxDate()

Date maxDate ( ) const
override

Definition at line 59 of file weightedyieldtermstructure.hpp.

59{ return std::min(yts1_->maxDate(), yts2_->maxDate()); }

◆ referenceDate()

const Date & referenceDate ( ) const
override

Definition at line 61 of file weightedyieldtermstructure.hpp.

61 {
62 QL_REQUIRE(yts1_->referenceDate() == yts2_->referenceDate(),
63 "WeightedYieldTermStructure::referenceDate(): inconsistent reference dates in sources ("
64 << yts1_->referenceDate() << " vs. " << yts2_->referenceDate());
65 return yts1_->referenceDate();
66}

◆ discountImpl()

Real discountImpl ( Time  t) const
overrideprotected

Definition at line 68 of file weightedyieldtermstructure.hpp.

68 {
69 return std::pow(yts1_->discount(t), w1_) * std::pow(yts2_->discount(t), w2_);
70}

Member Data Documentation

◆ yts1_

const Handle<YieldTermStructure> yts1_
protected

Definition at line 53 of file weightedyieldtermstructure.hpp.

◆ yts2_

const Handle<YieldTermStructure> yts2_
protected

Definition at line 53 of file weightedyieldtermstructure.hpp.

◆ w1_

const Real w1_
protected

Definition at line 54 of file weightedyieldtermstructure.hpp.

◆ w2_

const Real w2_
protected

Definition at line 54 of file weightedyieldtermstructure.hpp.