Class PieceWiseTermStructure

Inheritance Relationships

Base Types

Derived Type

Class Documentation

class PieceWiseTermStructure : public virtual otyca::TermStructure, public otyca::Scatter<Estimate>

A piecewise implementation of a term structure.

This class inherits from both TermStructure and Scatter<Estimate> to represent term structure data in a piecewise form. Interpolation between time points allows the term structure to provide estimates at arbitrary times.

Subclassed by otyca::PieceWiseYieldCurve

Public Functions

PieceWiseTermStructure()

Default constructor.

Initializes an empty scatter of Estimate values.

inline PieceWiseTermStructure(double t, double v)

Constructor with a single time-value pair.

Parameters:
  • t – Time coordinate of the data point.

  • v – Value at time t as a double (converted to Estimate).

inline PieceWiseTermStructure(double t, const Estimate &v)

Constructor with a single time-estimate pair.

Parameters:
  • t – Time coordinate of the data point.

  • vEstimate object at time t.

virtual ~PieceWiseTermStructure()

Virtual destructor.

virtual Estimate term_estimate(double x) const

Returns the term estimate at time x.

This function should interpolate between known points stored in the Scatter base class.

Parameters:

x – The time for which the estimate is requested.

Returns:

Estimate at time x.