Class SmithWilsonCurveFunction


  • public class SmithWilsonCurveFunction
    extends Object
    Smith-Wilson curve function.

    The curve represents the discount factor values as a function of time.

    The curve is controlled by omega, alpha and weights: omega is related to the ultimate forward rate (UFR) by omega = log(1 + UFR), the alpha parameter determines the rate of convergence to the UFR, and the weights are the parameters to be calibrated to market data.

    • Method Detail

      • of

        public static SmithWilsonCurveFunction of​(double ufr)
        Creates an instance with UFR.
        Parameters:
        ufr - the UFR
        Returns:
        the instance
      • gap

        public static double gap​(double x,
                                 double alpha,
                                 DoubleArray nodes,
                                 DoubleArray weights)
        Computes the gap from the UFR at x value.

        The nodes must be sorted in ascending order and coherent to weights.

        Parameters:
        x - the x value
        alpha - the alpha parameter
        nodes - the nodes
        weights - the weights
        Returns:
        the gap
      • value

        public double value​(double x,
                            double alpha,
                            DoubleArray nodes,
                            DoubleArray weights)
        Evaluates the Smith-Wilson curve function at a x value.

        The nodes must be sorted in ascending order and coherent to weights.

        Parameters:
        x - the x value
        alpha - the alpha parameter
        nodes - the nodes
        weights - the weights
        Returns:
        the value
      • firstDerivative

        public double firstDerivative​(double x,
                                      double alpha,
                                      DoubleArray nodes,
                                      DoubleArray weights)
        Computes the gradient of the Smith-Wilson curve function at a x value.

        The nodes must be sorted in ascending order and coherent to weights.

        Parameters:
        x - the x value
        alpha - the alpha parameter
        nodes - the nodes
        weights - the weights
        Returns:
        the gradient
      • parameterSensitivity

        public DoubleArray parameterSensitivity​(double x,
                                                double alpha,
                                                DoubleArray nodes)
        Computes the sensitivity of the Smith-Wilson curve function to weights parameters at a x value.

        The nodes must be sorted in ascending order.

        Parameters:
        x - the x value
        alpha - the alpha parameter
        nodes - the nodes
        Returns:
        the value