Interpolation

The QuantExpress Interpolation classes supports 3 different interpolation technique: linear, cubic and clamped cubic.

The classes share a common interface and a class factory makes it easy to instanciate them.

The chart showing Series To Interpolate series, Interpolated Series series.

Select an Interpolation Method
v
 
Generate Interpolation Curve


C# Code Sample
// Reads input data values
ReadData(out wX, out wY);
// Creates the interpolation object according to the user's selection
QuantExpress.Maths.Interpolation.IInterpolation oInterpolation = CreateInterpolationClass();
// Fits the data
oInterpolation.Fit(wX, wY);

double[] wXInterpolated = QuantExpress.Maths.MathsHelper.CreateArray(wX[0], wX[wX.Length - 1], 0.1);
double[] wYInterpolated = new double[wXInterpolated.Length];
for (int i = 0; i < wXInterpolated.Length; i++)
{
    // Evaluates interpolated values
    wYInterpolated[i] = oInterpolation.Eval(wXInterpolated[i]);
}