WebCab Portfolio Web Services for .NET v5.0 Demo

Interpolation.CubicSplinePointwise Method 

Returns the value of the cubic spline interpolation at a given point.

public double CubicSplinePointwise(
   double[] tabulationPointsInX,
   double[] functionValuesAtTabulationPoints,
   double derivativeInterpolationAt0,
   double derivativeInterpolationAtn_1,
   double interpolationPoint
);

Parameters

tabulationPointsInX
The array containing the values at which the function is tabulated, i.e. functionValuesAtTabulationPoints[i] = f(tabulationPointsInX[i]).
functionValuesAtTabulationPoints
An array of double of the values of the function evaluated at the interpolation points, i.e. functionValuesAtTabulationPoints[i] = f(tabulationPointsInX[i]), where f is the function being considered.
derivativeInterpolationAt0
The first derivative of the interpolation function at the point tabulationPointsInX[0].
derivativeInterpolationAtn_1
The first derivative of the interpolation function at the point tabulatedPointInX[n-1].
interpolationPoint
The value of the `x-coordinate' at which the value of the cubic spline interpolation function is evaluated. Note, that in the case of the Efficient Frontier this will refer to the risk of the portfolio.

Return Value

The value of the cubic spline interpolation function at a point.

Remarks

In particular, here we apply this method to estimate the value of the Efficient Frontier at a given point when it is only know on a finite set of points.

General Description of Parameters

Given a function which is tabulated at the points tabulationPointsInX[0..n-1] which has elements was are monotonically increasing and takes the values functionValuesAtTabulationPoints[0..n-1] at those points, this methods returns the values of the cubic spline interpolation function evaluated at the given point interpolationPoint.

Description of the Parameters in terms of the Efficient Frontier

With direct regards to the Efficient Frontier the points tabulationPointsInX[0..n-1], will refer to the risk of the portfolios on the Efficient Frontier and be evaluated using GetEfficientFrontierPortfolioRisks of the Markowitz XML Web service. The values functionValuesAtTabulationPoints[0..n-1] will refer to the expected returns of the known portfolios on the Efficient Frontier and be evaluated using GetEfficientFrontierExpectedReturns of the Markowitz XML Web service. The point at which the cubic spline in interpolated namely, interpolationPoint, will refer to the value of the portfolio risk for which the value of corresponding expected return will be returned.

Notes on Estimating the Derivatives

When applying this method you will need to provide values of the derivative of the interpolation function at the end points. A reasonable estimate with regard to approximating the Efficient Frontier could be provided by directed evaluating the slope between either the first or last two known points of the Efficient Frontier.

Remark: If the two arrays have different lengths, the shorter one will be used as reference. The two arrays should be at least 2 elements long.

Exceptions

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

See Also

Interpolation Class | Portfolio Namespace | CubicSplinePointwisePreEvaluation