private static double predict(double x, double[] coefficients) { double y = 0; for (int i = 0; i < coefficients.Length; i++) { y += Math.Pow(x, i) * coefficients[i]; } return y; }
private double predict(double x, LoessInterval interval) { var coeffs = LoessInterpolator.computeCoefficients(x, SortedXs, SortedYs, SortedRobustnessWeights, interval.BandwidthInterval); return(LoessInterpolator.predict(x, coeffs)); }