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.

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

Evaluates the model at given maturities.

Parameters:

x – Vector of maturities.

Returns:

Vector of computed yield values.

inline virtual void set_transformed_calibration_parameters(const std::vector<double> &transformed_parameters)

Sets the model parameters from a transformed space.

The transformation applies an exponential function to tau.

Parameters:

transformed_parameters – A vector containing transformed parameters.

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

Set the model’s raw parameters.

Parameters:

parameters – A vector of new parameter values.

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

Retrieves the model parameters.

Returns:

Vector of model parameters.

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

Retrieves the transformed model parameters.

The transformation applies a logarithm to tau.

Returns:

Vector of transformed parameters.

inline virtual std::vector<double> get_transformed_calibration_parameter_variances() const

Retrieves variances for the transformed parameters.

Returns:

Vector of parameter variances.

inline virtual std::string name() const

Gets the model name.

Returns:

A string representing the model name.

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)