Class PiecewisePolynomialInterpolator
- java.lang.Object
-
- com.opengamma.strata.math.impl.interpolation.PiecewisePolynomialInterpolator
-
- Direct Known Subclasses:
ClampedPiecewisePolynomialInterpolator,ConstrainedCubicSplineInterpolator,CubicSplineInterpolator,LinearInterpolator,MonotonicityPreservingCubicSplineInterpolator,NaturalSplineInterpolator,NonnegativityPreservingCubicSplineInterpolator,PiecewiseCubicHermiteSplineInterpolator,PiecewiseCubicHermiteSplineInterpolatorWithSensitivity,ProductPiecewisePolynomialInterpolator,SemiLocalCubicSplineInterpolator
public abstract class PiecewisePolynomialInterpolator extends Object
Abstract class for interpolations based on piecewise polynomial functions .
-
-
Constructor Summary
Constructors Constructor Description PiecewisePolynomialInterpolator()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description PiecewisePolynomialInterpolatorgetPrimaryMethod()Hyman filter modifies derivative values at knot points which are initially computed by a "primary" interpolator.protected doublegetValue(double[] coefs, double x, double leftknot)protected doublegetValue(DoubleArray coefs, double x, double leftknot)abstract PiecewisePolynomialResultinterpolate(double[] xValues, double[] yValues)Interpolate.abstract PiecewisePolynomialResultinterpolate(double[] xValues, double[][] yValuesMatrix)Interpolate.DoubleArrayinterpolate(double[] xValues, double[][] yValuesMatrix, double x)Interpolate.DoubleMatrixinterpolate(double[] xValues, double[][] yValuesMatrix, double[] x)Interpolate.DoubleMatrix[]interpolate(double[] xValues, double[][] yValuesMatrix, double[][] xMatrix)Interpolate.doubleinterpolate(double[] xValues, double[] yValues, double xKey)Interpolate.DoubleArrayinterpolate(double[] xValues, double[] yValues, double[] xKeys)Interpolate.DoubleMatrixinterpolate(double[] xValues, double[] yValues, double[][] xMatrix)Interpolate.abstract PiecewisePolynomialResultsWithSensitivityinterpolateWithSensitivity(double[] xValues, double[] yValues)Derive interpolant on {xValues_i, yValues_i} and (yValues) node sensitivity.
-
-
-
Method Detail
-
interpolate
public abstract PiecewisePolynomialResult interpolate(double[] xValues, double[] yValues)
Interpolate.- Parameters:
xValues- X values of datayValues- Y values of data- Returns:
PiecewisePolynomialResultcontaining knots, coefficients of piecewise polynomials, number of intervals, degree of polynomials, dimension of spline
-
interpolate
public abstract PiecewisePolynomialResult interpolate(double[] xValues, double[][] yValuesMatrix)
Interpolate.- 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
-
interpolate
public double interpolate(double[] xValues, double[] yValues, double xKey)Interpolate.- Parameters:
xValues- X values of datayValues- Y values of dataxKey- the key- Returns:
- value of the underlying cubic spline function at the value of x
-
interpolate
public DoubleArray interpolate(double[] xValues, double[] yValues, double[] xKeys)
Interpolate.- Parameters:
xValues- X values of datayValues- Y values of dataxKeys- the keys- Returns:
- Values of the underlying cubic spline function at the values of x
-
interpolate
public DoubleMatrix interpolate(double[] xValues, double[] yValues, double[][] xMatrix)
Interpolate.- Parameters:
xValues- the valuesyValues- the valuesxMatrix- the matrix- Returns:
- Values of the underlying cubic spline function at the values of x
-
interpolate
public DoubleArray interpolate(double[] xValues, double[][] yValuesMatrix, double x)
Interpolate.- Parameters:
xValues- the valuesyValuesMatrix- the matrixx- the x- Returns:
- Values of the underlying cubic spline functions interpolating {yValuesMatrix.RowVectors} at the value of x
-
interpolate
public DoubleMatrix interpolate(double[] xValues, double[][] yValuesMatrix, double[] x)
Interpolate.- Parameters:
xValues- the valuesyValuesMatrix- the matrixx- the s- Returns:
- Values of the underlying cubic spline functions interpolating {yValuesMatrix.RowVectors} at the values of x
-
interpolate
public DoubleMatrix[] interpolate(double[] xValues, double[][] yValuesMatrix, double[][] xMatrix)
Interpolate.- Parameters:
xValues- the valuesyValuesMatrix- the matrixxMatrix- the matrix- Returns:
- Values of the underlying cubic spline functions interpolating {yValuesMatrix.RowVectors} at the values of xMatrix
-
interpolateWithSensitivity
public abstract PiecewisePolynomialResultsWithSensitivity interpolateWithSensitivity(double[] xValues, double[] yValues)
Derive interpolant on {xValues_i, yValues_i} and (yValues) node sensitivity.- Parameters:
xValues- X values of datayValues- Y values of data- Returns:
PiecewisePolynomialResultsWithSensitivity
-
getPrimaryMethod
public PiecewisePolynomialInterpolator getPrimaryMethod()
Hyman filter modifies derivative values at knot points which are initially computed by a "primary" interpolator.- Returns:
- The primary interpolator for Hyman filter, interpolation method itself for other interpolators
-
getValue
protected double getValue(DoubleArray coefs, double x, double leftknot)
- Parameters:
coefs- {a_n,a_{n-1},...} of f(x) = a_n x^{n} + a_{n-1} x^{n-1} + ....x- the xleftknot- the knot specifying underlying interpolation function- Returns:
- the value of the underlying interpolation function at the value of x
-
getValue
protected double getValue(double[] coefs, double x, double leftknot)- Parameters:
coefs- {a_n,a_{n-1},...} of f(x) = a_n x^{n} + a_{n-1} x^{n-1} + ....x- the xleftknot- the knot specifying underlying interpolation function- Returns:
- the value of the underlying interpolation function at the value of x
-
-