Class TermStructure
Defined in File term_structure.hpp
Inheritance Relationships
Derived Types
public otyca::PieceWiseTermStructure
(Class PieceWiseTermStructure)public otyca::YieldCurve
(Class YieldCurve)
Class Documentation
-
class TermStructure
Abstract base class representing a term structure of rates.
A TermStructure provides methods to retrieve term and forward estimates or rates as a function of time. Derived classes must implement the
term_estimate
function.Subclassed by otyca::PieceWiseTermStructure, otyca::YieldCurve
Public Functions
-
virtual Estimate term_estimate(double t) const = 0
Pure virtual function to get the term estimate at a given time.
This function must be implemented by subclasses to return an
Estimate
for the rate at timet
.- Parameters:
t – The time at which to evaluate the term estimate.
- Returns:
An
Estimate
object representing the rate at timet
.
-
inline double term_rate(double t) const
Returns the term rate (value of the term estimate) at a given time.
This is a convenience method that calls
term_estimate(t)
and returns its value.- Parameters:
t – The time at which to evaluate the term rate.
- Returns:
The rate value at time
t
.
-
virtual Estimate forward_estimate(double t1, double t2) const
Virtual function to get the forward estimate between two times.
Subclasses may override this method to provide a custom forward estimate. The default implementation may be based on numerical differentiation or interpolated/extrapolated logic.
- Parameters:
t1 – The start time.
t2 – The end time.
- Returns:
An
Estimate
object representing the forward rate betweent1
andt2
.
-
inline double forward_rate(double t1, double t2) const
Returns the forward rate (value of the forward estimate) between two times.
This is a convenience method that calls
forward_estimate(t1, t2)
and returns its value.- Parameters:
t1 – The start time.
t2 – The end time.
- Returns:
The forward rate value between
t1
andt2
.
-
virtual Estimate term_estimate(double t) const = 0