Class ProductPiecewisePolynomialInterpolator
- java.lang.Object
-
- com.opengamma.strata.math.impl.interpolation.PiecewisePolynomialInterpolator
-
- com.opengamma.strata.math.impl.interpolation.ProductPiecewisePolynomialInterpolator
-
public class ProductPiecewisePolynomialInterpolator extends PiecewisePolynomialInterpolator
Given a data set {xValues[i], yValues[i]}, interpolate {xValues[i], xValues[i] * yValues[i]} by a piecewise polynomial function. The interpolation can be clamped at {xValuesClamped[j], xValuesClamped[j] * yValuesClamped[j]}, i.e., {xValuesClamped[j], yValuesClamped[j]}, where the extra points can be inside or outside the data range. By default right extrapolation is completed with a linear function, whereas default left extrapolation uses polynomial coefficients for the leftmost interval and left linear extrapolation can be straightforwardly computed from the coefficients. This default setting is changed by adding extra node points outside the data range.
-
-
Constructor Summary
Constructors Constructor Description ProductPiecewisePolynomialInterpolator(PiecewisePolynomialInterpolator baseMethod)
Construct the interpolator without clamped points.ProductPiecewisePolynomialInterpolator(PiecewisePolynomialInterpolator baseMethod, double[] xValuesClamped, double[] yValuesClamped)
Construct the interpolator with clamped points.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PiecewisePolynomialInterpolator
getPrimaryMethod()
Hyman filter modifies derivative values at knot points which are initially computed by a "primary" interpolator.PiecewisePolynomialResult
interpolate(double[] xValues, double[] yValues)
Interpolate.PiecewisePolynomialResult
interpolate(double[] xValues, double[][] yValuesMatrix)
Interpolate.PiecewisePolynomialResultsWithSensitivity
interpolateWithSensitivity(double[] xValues, double[] yValues)
Derive interpolant on {xValues_i, yValues_i} and (yValues) node sensitivity.-
Methods inherited from class com.opengamma.strata.math.impl.interpolation.PiecewisePolynomialInterpolator
getValue, getValue, interpolate, interpolate, interpolate, interpolate, interpolate, interpolate
-
-
-
-
Constructor Detail
-
ProductPiecewisePolynomialInterpolator
public ProductPiecewisePolynomialInterpolator(PiecewisePolynomialInterpolator baseMethod)
Construct the interpolator without clamped points.- Parameters:
baseMethod
- The base interpolator must not be itself
-
ProductPiecewisePolynomialInterpolator
public ProductPiecewisePolynomialInterpolator(PiecewisePolynomialInterpolator baseMethod, double[] xValuesClamped, double[] yValuesClamped)
Construct the interpolator with clamped points.- Parameters:
baseMethod
- The base interpolator must be not be itselfxValuesClamped
- X values of the clamped pointsyValuesClamped
- Y values of the clamped points
-
-
Method Detail
-
interpolate
public PiecewisePolynomialResult interpolate(double[] xValues, double[] yValues)
Description copied from class:PiecewisePolynomialInterpolator
Interpolate.- Specified by:
interpolate
in classPiecewisePolynomialInterpolator
- Parameters:
xValues
- X values of datayValues
- Y values of data- Returns:
PiecewisePolynomialResult
containing knots, coefficients of piecewise polynomials, number of intervals, degree of polynomials, dimension of spline
-
interpolate
public PiecewisePolynomialResult interpolate(double[] xValues, double[][] yValuesMatrix)
Description copied from class:PiecewisePolynomialInterpolator
Interpolate.- Specified by:
interpolate
in classPiecewisePolynomialInterpolator
- Parameters:
xValues
- X values of datayValuesMatrix
- Y values of data- Returns:
- Coefficient matrix whose i-th row vector is {a_n, a_{n-1}, ... } of f(x) = a_n * (x-x_i)^n + a_{n-1} * (x-x_i)^{n-1} +... for the i-th interval
-
interpolateWithSensitivity
public PiecewisePolynomialResultsWithSensitivity interpolateWithSensitivity(double[] xValues, double[] yValues)
Description copied from class:PiecewisePolynomialInterpolator
Derive interpolant on {xValues_i, yValues_i} and (yValues) node sensitivity.- Specified by:
interpolateWithSensitivity
in classPiecewisePolynomialInterpolator
- Parameters:
xValues
- X values of datayValues
- Y values of data- Returns:
PiecewisePolynomialResultsWithSensitivity
-
getPrimaryMethod
public PiecewisePolynomialInterpolator getPrimaryMethod()
Description copied from class:PiecewisePolynomialInterpolator
Hyman filter modifies derivative values at knot points which are initially computed by a "primary" interpolator.- Overrides:
getPrimaryMethod
in classPiecewisePolynomialInterpolator
- Returns:
- The primary interpolator for Hyman filter, interpolation method itself for other interpolators
-
-