Fantastic - thanks for the quick reply!
I have my code as follows:
Code:
double[] y = dataPoints.Select(p => (double)p.Result).ToArray();
double[] x = new double[dataPoints.Count];
for (int i = 0; i < x.Length; i++) // it is always a counter...right?
x[i] = i;
int resultIndicator = -1;
alglib.spline1d.spline1dinterpolant spline = new alglib.spline1d.spline1dinterpolant();
alglib.spline1d.spline1dfitreport report = new alglib.spline1d.spline1dfitreport();
alglib.spline1d.spline1dfitcubic(ref x, ref y, dataPoints.Count, 4, ref resultIndicator, ref spline, ref report);
if (resultIndicator > 0) // success
for (int i = 0; i < dataPoints.Count; i++ )
dataPoints[i].TrendPosition = (decimal)alglib.spline1d.spline1dcalc(ref spline, (double)i);
does this look right?