Class NelsonSiegel

Inheritance Relationships

Base Type

Derived Type

Class Documentation

class NelsonSiegel : public otyca::Model<1>

Implements the Nelson-Siegel yield curve model.

The Nelson-Siegel model is commonly used for fitting yield curves. It consists of four parameters: level, slope, curvature, and tau.

Subclassed by otyca::NelsonSiegelSvensson

Public Functions

inline NelsonSiegel()

Default constructor initializing parameters to NaN.

inline NelsonSiegel(double level, double slope, double curvature, double tau)

Parameterized constructor.

Parameters:
  • level – The long-term level of the yield curve.

  • slope – The short-term component.

  • curvature – The medium-term component.

  • tau – The decay factor controlling the shape.

std::vector<double> evaluate(const std::vector<std::array<double, 1>> &x) const override
virtual void set_transformed_calibration_parameters(const std::vector<double> &transformed_parameters) override

set the transformed parameters for calibration.

Parameters:

transformed_calibration_parameters – the transformed calibration parameters

inline virtual void set_parameters(const std::vector<double> &parameters) override

Set the model’s raw parameters.

Parameters:

parameters – A vector of new parameter values.

inline virtual std::vector<double> get_parameters() const override

Get the model’s raw parameters.

Returns:

A vector containing the model’s parameters.

virtual std::vector<double> get_transformed_calibration_parameters() const override

get the transformed parameters for calibration.

Returns:

the transformed parameters for calibration

inline virtual std::string name() const override

Get the model’s name.

Returns:

A string representing the name of the model.

inline double get_level() const
inline double get_slope() const
inline double get_curvature() const
inline double get_tau() const
inline void set_level(double level)
inline void set_slope(double slope)
inline void set_curvature(double curvature)
inline void set_tau(double tau)