WebCab Portfolio for .NET v5.0 Demo

Interpolation.InterpolateExtrapolatePolynomial Method 

Interpolates (or extrapolates) a given polynomial in one variable.

public double[] InterpolateExtrapolatePolynomial(
   double[] tabulationPointsInX,
   double[] polynomialValues,
   double interpolationPoint
);

Parameters

tabulationPointsInX
An array of doubles for which at member we know the corresponding value of the given polynomial. Note, that the corresponding values of the polynomial at these points given by the member of the array yCoordinates which lie in the corresponding position.
polynomialValues
An array of doubles which corresponds to the value of the polynomial at the points tabulationPointsInX. The first point of this array is the value of the given polynomial evaluated at the point tabulationPointsInX[0], th second point of the array is the value of the given polynomial at the point tabulationPointsInX[1].
interpolationPoint
The value of the point at which the interpolation function is evaluated and a corresponding error estimate is given.

Return Value

An array of doubles where the first terms if the value of the interpolation function and the second is an error estimate.

Remarks

It returns an array of two values the first being the value of the interpolation function evaluated at the interpolation point and the other being the error estimate.

If P(x) is the polynomial of degree `n-1' such that P(xCoordinates[i]) = yCoordinates[i]; i=0,...,n-1; then if the desired point at which the interpolation functions value is required is `interpolationPoint'. Then the returned value will be some double value y, where y = P(interpolationPoint).

The `tabulationPointsInX' array and the `polynomialValues' array should each contain at least one element. If these arrays have different lengths the shorter one will be chosen as reference.

Exceptions

Exception TypeCondition
InterpolationExceptionThrown when the input values do not meet the requirements mentioned above.

See Also

Interpolation Class | WebCab.Libraries.Finance.Portfolio Namespace