PiecewiseFlatForward Class Reference
[Term structures]

#include <ql/TermStructures/piecewiseflatforward.hpp>

Inheritance diagram for PiecewiseFlatForward:

Inheritance graph
[legend]
List of all members.

Detailed Description

Piecewise flat forward term structure.

This term structure is bootstrapped on a number of interest rate instruments which are passed as a vector of handles to RateHelper instances. Their maturities mark the boundaries of the flat forward segments.

The values of the forward rates for each segment are determined sequentially starting from the earliest period to the latest.

The value for each segment is chosen so that the instrument whose maturity marks the end of such segment is correctly repriced on the curve.

Rates are assumed to be annual continuos compounding.

Warning:
The bootstrapping algorithm will raise an exception if any two instruments have the same maturity date.
Tests:
  • the correctness of the returned values is tested by checking them against the original inputs.
  • the observability of the term structure is tested.


Public Member Functions

Constructors
 PiecewiseFlatForward (const Date &referenceDate, const std::vector< boost::shared_ptr< RateHelper > > &instruments, const DayCounter &dayCounter, Real accuracy=1.0e-12)
 PiecewiseFlatForward (Integer settlementDays, const Calendar &calendar, const std::vector< boost::shared_ptr< RateHelper > > &instruments, const DayCounter &dayCounter, Real accuracy=1.0e-12)
 PiecewiseFlatForward (const std::vector< Date > &dates, const std::vector< Rate > &forwards, const DayCounter &dayCounter)
YieldTermStructure interface
DayCounter dayCounter () const
 the day counter used for date/time conversion
const std::vector< Date > & dates () const
Date maxDate () const
 the latest date for which the curve can return rates
const std::vector< Time > & times () const
Time maxTime () const
 the latest time for which the curve can return rates
Observer interface
void update ()

Protected Member Functions

Rate zeroYieldImpl (Time) const
DiscountFactor discountImpl (Time) const
 discount calculation
Rate forwardImpl (Time) const

Friends

class FFObjFunction


Constructor & Destructor Documentation

PiecewiseFlatForward const std::vector< Date > &  dates,
const std::vector< Rate > &  forwards,
const DayCounter dayCounter
 

In this constructor, the first date must be the reference date of the curve, the other dates are the nodes of the term structure. The forward rate at index $i$ is used in the period $t_{i-1} < t \le t_i$ . Therefore, forwards[0] is used only to compute the zero yield for $t = 0$ .

Deprecated:
use ForwardCurve instead


Member Function Documentation

void update  )  [virtual]
 

This method must be implemented in derived classes. An instance of Observer does not call this method directly: instead, it will be called by the observables the instance registered with when they need to notify any changes.

Reimplemented from LazyObject.


QuantLib.org
QuantLib
Hosted by
SourceForge.net Logo
Documentation generated by
doxygen