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
,alpha
andweights
:omega
is related to the ultimate forward rate (UFR) byomega = log(1 + UFR)
, thealpha
parameter determines the rate of convergence to the UFR, and theweights
are the parameters to be calibrated to market data.
-
-
Field Summary
Fields Modifier and Type Field Description static SmithWilsonCurveFunction
DEFAULT
Default implementation with UFR = 4.2%
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description double
firstDerivative(double x, double alpha, DoubleArray nodes, DoubleArray weights)
Computes the gradient of the Smith-Wilson curve function at a x value.static double
gap(double x, double alpha, DoubleArray nodes, DoubleArray weights)
Computes the gap from the UFR at x value.static SmithWilsonCurveFunction
of(double ufr)
Creates an instance with UFR.DoubleArray
parameterSensitivity(double x, double alpha, DoubleArray nodes)
Computes the sensitivity of the Smith-Wilson curve function to weights parameters at a x value.double
value(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
nodes
must 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
nodes
must 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
nodes
must 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
nodes
must be sorted in ascending order.- Parameters:
x
- the x valuealpha
- the alpha parameternodes
- the nodes- Returns:
- the value
-
-