Adapter class for turning a PriceTermStructure in to a YieldTermStructure. More...
#include <qle/termstructures/pricetermstructureadapter.hpp>
Public Member Functions | |
PriceTermStructureAdapter (const QuantLib::ext::shared_ptr< PriceTermStructure > &priceCurve, const QuantLib::ext::shared_ptr< QuantLib::YieldTermStructure > &discount, QuantLib::Natural spotDays=0, const QuantLib::Calendar &spotCalendar=QuantLib::NullCalendar()) | |
PriceTermStructureAdapter (const QuantLib::ext::shared_ptr< PriceTermStructure > &priceCurve, const QuantLib::ext::shared_ptr< QuantLib::YieldTermStructure > &discount, const QuantLib::Handle< QuantLib::Quote > &spotQuote) | |
TermStructure interface | |
QuantLib::Date | maxDate () const override |
const QuantLib::Date & | referenceDate () const override |
QuantLib::DayCounter | dayCounter () const override |
Inspectors | |
const QuantLib::ext::shared_ptr< PriceTermStructure > & | priceCurve () const |
const QuantLib::ext::shared_ptr< QuantLib::YieldTermStructure > & | discount () const |
QuantLib::Natural | spotDays () const |
const QuantLib::Calendar & | spotCalendar () const |
YieldTermStructure interface | |
QuantLib::ext::shared_ptr< PriceTermStructure > | priceCurve_ |
QuantLib::ext::shared_ptr< QuantLib::YieldTermStructure > | discount_ |
QuantLib::Natural | spotDays_ |
QuantLib::Calendar | spotCalendar_ |
QuantLib::Handle< QuantLib::Quote > | spotQuote_ |
QuantLib::DiscountFactor | discountImpl (QuantLib::Time t) const override |
Adapter class for turning a PriceTermStructure in to a YieldTermStructure.
This class takes a price term structure and an input yield curve and constructs a yield curve such that the discount factor \( P_p(0, t) \) at time \( t \) is given by:
\[ P_p(0, t) = \exp(-s(t) t) \]
where \( s(t) \) is defined by:
\[ \Pi(0, t) = S(0) \exp((z(t) - s(t)) t) \]
Here, \( \Pi(0, t) \) is the forward price of the underlying from the input price curve, \( S(0) \) is its spot price and \( z(t) \) is the continuously compounded zero rate from the input yield curve. The spot price is determined from the price curve at time 0 by default. There are optional parameters that allow using a price at a time other than 0 for the spot price.
Definition at line 52 of file pricetermstructureadapter.hpp.
PriceTermStructureAdapter | ( | const QuantLib::ext::shared_ptr< PriceTermStructure > & | priceCurve, |
const QuantLib::ext::shared_ptr< QuantLib::YieldTermStructure > & | discount, | ||
QuantLib::Natural | spotDays = 0 , |
||
const QuantLib::Calendar & | spotCalendar = QuantLib::NullCalendar() |
||
) |
PriceTermStructureAdapter | ( | const QuantLib::ext::shared_ptr< PriceTermStructure > & | priceCurve, |
const QuantLib::ext::shared_ptr< QuantLib::YieldTermStructure > & | discount, | ||
const QuantLib::Handle< QuantLib::Quote > & | spotQuote | ||
) |
|
override |
Definition at line 53 of file pricetermstructureadapter.cpp.
|
override |
Definition at line 59 of file pricetermstructureadapter.cpp.
|
override |
Definition at line 66 of file pricetermstructureadapter.cpp.
const QuantLib::ext::shared_ptr< PriceTermStructure > & priceCurve | ( | ) | const |
Definition at line 68 of file pricetermstructureadapter.cpp.
const QuantLib::ext::shared_ptr< YieldTermStructure > & discount | ( | ) | const |
Definition at line 70 of file pricetermstructureadapter.cpp.
Natural spotDays | ( | ) | const |
Definition at line 72 of file pricetermstructureadapter.cpp.
const Calendar & spotCalendar | ( | ) | const |
Definition at line 74 of file pricetermstructureadapter.cpp.
|
overrideprotected |
Definition at line 76 of file pricetermstructureadapter.cpp.
|
private |
Definition at line 87 of file pricetermstructureadapter.hpp.
|
private |
Definition at line 88 of file pricetermstructureadapter.hpp.
|
private |
Definition at line 89 of file pricetermstructureadapter.hpp.
|
private |
Definition at line 90 of file pricetermstructureadapter.hpp.
|
private |
Definition at line 91 of file pricetermstructureadapter.hpp.