List of usage examples for org.apache.commons.math.analysis.interpolation LoessInterpolator LoessInterpolator
public LoessInterpolator()
From source file:guineu.modules.filter.Alignment.SerumHuNormalization.SerumHuNormalizationTask.java
private PolynomialSplineFunction createCurve() { try {/*from w ww . j a va 2 s .c o m*/ // if there are more than 2 points in the model LoessInterpolator loess = null; if (this.loessBandwidth == 0 && this.iterations == 0) { loess = new LoessInterpolator(); } else { loess = new LoessInterpolator(this.loessBandwidth, this.iterations); } double[] newy = loess.smooth(xval, yval); PolynomialSplineFunction function = loess.interpolate(xval, newy); return function; } catch (MathException ex) { Logger.getLogger(SerumHuNormalizationTask.class.getName()).log(Level.SEVERE, null, ex); SplineInterpolator loess = new SplineInterpolator(); PolynomialSplineFunction function = loess.interpolate(xval, yval); return function; } }