public abstract class AbstractBoundCurveInterpolator extends Object implements BoundCurveInterpolator
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractBoundCurveInterpolator(AbstractBoundCurveInterpolator base,
BoundCurveExtrapolator extrapolatorLeft,
BoundCurveExtrapolator extrapolatorRight)
Creates an instance.
|
protected |
AbstractBoundCurveInterpolator(DoubleArray xValues,
DoubleArray yValues)
Creates an instance.
|
| Modifier and Type | Method and Description |
|---|---|
protected abstract double |
doFirstDerivative(double xValue)
Method for subclasses to calculate the first derivative.
|
protected abstract double |
doInterpolate(double xValue)
Method for subclasses to calculate the interpolated value.
|
protected double |
doInterpolateFromExtrapolator(double xValue)
Method for
InterpolatorCurveExtrapolator to calculate the interpolated value. |
protected abstract DoubleArray |
doParameterSensitivity(double xValue)
Method for subclasses to calculate parameter sensitivity.
|
double |
firstDerivative(double xValue)
Computes the first derivative of the y-value for the specified x-value.
|
double |
interpolate(double xValue)
Computes the y-value for the specified x-value by interpolation.
|
protected static int |
lowerBoundIndex(double xValue,
double[] xValues)
Returns the index of the last value in the input array which is lower than the specified value.
|
DoubleArray |
parameterSensitivity(double xValue)
Computes the sensitivity of the y-value with respect to the curve parameters.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitbindprotected AbstractBoundCurveInterpolator(DoubleArray xValues, DoubleArray yValues)
xValues - the x-values of the curve, must be sorted from low to highyValues - the y-values of the curveprotected AbstractBoundCurveInterpolator(AbstractBoundCurveInterpolator base, BoundCurveExtrapolator extrapolatorLeft, BoundCurveExtrapolator extrapolatorRight)
base - the base interpolatorextrapolatorLeft - the extrapolator for x-values on the leftextrapolatorRight - the extrapolator for x-values on the rightpublic final double interpolate(double xValue)
BoundCurveInterpolatorinterpolate in interface BoundCurveInterpolatorxValue - the x-value to find the y-value forprotected abstract double doInterpolate(double xValue)
Callers can assume that xValue is less than the x-value of the last node.
xValue - the x-valueprotected double doInterpolateFromExtrapolator(double xValue)
InterpolatorCurveExtrapolator to calculate the interpolated value.
This is separated from doInterpolate(double) to allow the check for x-values
beyond the last node to be treated separately.
xValue - the x-valuepublic final double firstDerivative(double xValue)
BoundCurveInterpolator
The first derivative is dy/dx.
firstDerivative in interface BoundCurveInterpolatorxValue - the x-value at which the derivative is takenprotected abstract double doFirstDerivative(double xValue)
xValue - the x-valuepublic final DoubleArray parameterSensitivity(double xValue)
BoundCurveInterpolatorThis returns an array with one element for each parameter of the curve. The array contains the sensitivity of the y-value at the specified x-value to each parameter.
parameterSensitivity in interface BoundCurveInterpolatorxValue - the x-value at which the parameter sensitivity is computedprotected abstract DoubleArray doParameterSensitivity(double xValue)
xValue - the x-valueprotected static int lowerBoundIndex(double xValue,
double[] xValues)
The following conditions must be true for this method to work correctly:
xValues is sorted in ascending orderxValue is greater or equal to the first element of xValuesxValue is less than or equal to the last element of xValues0 <= value < xValues.length
The x-values must not be NaN.
xValue - a value which is less than the last element in xValuesxValues - an array of values sorted in ascending orderxValues which is lower than xValueCopyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.