Class SmithWilsonCurveFunction
- java.lang.Object
-
- com.opengamma.strata.math.impl.interpolation.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,alphaandweights:omegais related to the ultimate forward rate (UFR) byomega = log(1 + UFR), thealphaparameter determines the rate of convergence to the UFR, and theweightsare the parameters to be calibrated to market data.
-
-
Field Summary
Fields Modifier and Type Field Description static SmithWilsonCurveFunctionDEFAULTDefault implementation with UFR = 4.2%
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description doublefirstDerivative(double x, double alpha, DoubleArray nodes, DoubleArray weights)Computes the gradient of the Smith-Wilson curve function at a x value.static doublegap(double x, double alpha, DoubleArray nodes, DoubleArray weights)Computes the gap from the UFR at x value.static SmithWilsonCurveFunctionof(double ufr)Creates an instance with UFR.DoubleArrayparameterSensitivity(double x, double alpha, DoubleArray nodes)Computes the sensitivity of the Smith-Wilson curve function to weights parameters at a x value.doublevalue(double x, double alpha, DoubleArray nodes, DoubleArray weights)Evaluates the Smith-Wilson curve function at a x value.
-
-
-
Field Detail
-
DEFAULT
public static final SmithWilsonCurveFunction DEFAULT
Default implementation with UFR = 4.2%
-
-
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
nodesmust be sorted in ascending order and coherent toweights.- Parameters:
x- the x valuealpha- the alpha parameternodes- the nodesweights- 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
nodesmust be sorted in ascending order and coherent toweights.- Parameters:
x- the x valuealpha- the alpha parameternodes- the nodesweights- 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
nodesmust be sorted in ascending order and coherent toweights.- Parameters:
x- the x valuealpha- the alpha parameternodes- the nodesweights- 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
nodesmust be sorted in ascending order.- Parameters:
x- the x valuealpha- the alpha parameternodes- the nodes- Returns:
- the value
-
-