Class HermiteCoefficientsProvider
- java.lang.Object
-
- com.opengamma.strata.math.impl.interpolation.HermiteCoefficientsProvider
-
public class HermiteCoefficientsProvider extends Object
Hermite interpolation is determined if one specifies first derivatives for a cubic interpolant and first and second derivatives for a quintic interpolant.
-
-
Constructor Summary
Constructors Constructor Description HermiteCoefficientsProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description doubleendpointDerivatives(double ints1, double ints2, double slope1, double slope2)double[]intervalsCalculator(double[] xValues)double[]slopesCalculator(double[] yValues, double[] intervals)double[][]slopeSensitivityCalculator(double[] intervals)Derivative values of slopes_i with respect to yValues_j, s_{ij}.double[][]solve(double[] values, double[] intervals, double[] slopes, double[] first)double[][]solve(double[] values, double[] intervals, double[] slopes, double[] first, double[] second)DoubleMatrix[]solveWithSensitivity(double[] values, double[] intervals, double[] slopes, double[][] slopeSensitivity, DoubleArray[] firstWithSensitivity)DoubleMatrix[]solveWithSensitivity(double[] values, double[] intervals, double[] slopes, double[][] slopeSensitivity, DoubleArray[] firstWithSensitivity, DoubleArray[] secondWithSensitivity)
-
-
-
Method Detail
-
solve
public double[][] solve(double[] values, double[] intervals, double[] slopes, double[] first)- Parameters:
values- (yValues_i)intervals- (xValues_{i+1} - xValues_{i})slopes- (yValues_{i+1} - yValues_{i})/(xValues_{i+1} - xValues_{i})first- First derivatives at xValues_i- Returns:
- Coefficient matrix whose i-th row vector is { a_n, a_{n-1}, ...} for the i-th interval, where a_n, a_{n-1},... are coefficients of f(x) = a_n (x-x_i)^n + a_{n-1} (x-x_i)^{n-1} + .... with n=3
-
solveWithSensitivity
public DoubleMatrix[] solveWithSensitivity(double[] values, double[] intervals, double[] slopes, double[][] slopeSensitivity, DoubleArray[] firstWithSensitivity)
- Parameters:
values- Y values of dataintervals- (xValues_{i+1} - xValues_{i})slopes- (yValues_{i+1} - yValues_{i})/(xValues_{i+1} - xValues_{i})slopeSensitivity- Derivative values of slope with respect to yValuesfirstWithSensitivity- First derivative values at xValues_i and their yValues dependencies- Returns:
- Coefficient matrix and its node dependencies
-
solve
public double[][] solve(double[] values, double[] intervals, double[] slopes, double[] first, double[] second)- Parameters:
values- (yValues_i)intervals- (xValues_{i+1} - xValues_{i})slopes- (yValues_{i+1} - yValues_{i})/(xValues_{i+1} - xValues_{i})first- First derivatives at xValues_isecond- Second derivatives at xValues_i- Returns:
- Coefficient matrix whose i-th row vector is { a_n, a_{n-1}, ...} for the i-th interval, where a_n, a_{n-1},... are coefficients of f(x) = a_n (x-x_i)^n + a_{n-1} (x-x_i)^{n-1} + .... with n=5
-
solveWithSensitivity
public DoubleMatrix[] solveWithSensitivity(double[] values, double[] intervals, double[] slopes, double[][] slopeSensitivity, DoubleArray[] firstWithSensitivity, DoubleArray[] secondWithSensitivity)
- Parameters:
values- (yValues_i)intervals- (xValues_{i+1} - xValues_{i})slopes- (yValues_{i+1} - yValues_{i})/(xValues_{i+1} - xValues_{i})slopeSensitivity- Derivative values of slope with respect to yValuesfirstWithSensitivity- First derivative values at xValues_i and their yValues dependenciessecondWithSensitivity- Second derivative values at xValues_i and their yValues dependencies- Returns:
- Coefficient matrix and its node dependencies
-
intervalsCalculator
public double[] intervalsCalculator(double[] xValues)
- Parameters:
xValues- The x values- Returns:
- Intervals of xValues, ( xValues_{i+1} - xValues_i )
-
slopesCalculator
public double[] slopesCalculator(double[] yValues, double[] intervals)- Parameters:
yValues- Y values of dataintervals- Intervals of x data- Returns:
- ( yValues_{i+1} - yValues_i )/( xValues_{i+1} - xValues_i )
-
slopeSensitivityCalculator
public double[][] slopeSensitivityCalculator(double[] intervals)
Derivative values of slopes_i with respect to yValues_j, s_{ij}.- Parameters:
intervals- Intervals of x data- Returns:
- The matrix s_{ij}
-
endpointDerivatives
public double endpointDerivatives(double ints1, double ints2, double slope1, double slope2)- Parameters:
ints1- The first intervalints2- The second intervalslope1- The first gradientslope2- The second gradient- Returns:
- Value of derivative at each endpoint
-
-