Class LoessInterpolator

java.lang.Object
org.apache.commons.math4.analysis.interpolation.LoessInterpolator
All Implemented Interfaces:
java.io.Serializable, UnivariateInterpolator

public class LoessInterpolator
extends java.lang.Object
implements UnivariateInterpolator, java.io.Serializable
Implements the Local Regression Algorithm (also Loess, Lowess) for interpolation of real univariate functions.

For reference, see William S. Cleveland - Robust Locally Weighted Regression and Smoothing Scatterplots

This class implements both the loess method and serves as an interpolation adapter to it, allowing one to build a spline on the obtained loess fit.

Since:
2.0
See Also:
Serialized Form
  • Field Summary

    Fields 
    Modifier and Type Field Description
    static double DEFAULT_ACCURACY
    Default value for accuracy.
    static double DEFAULT_BANDWIDTH
    Default value of the bandwidth parameter.
    static int DEFAULT_ROBUSTNESS_ITERS
    Default value of the number of robustness iterations.
  • Constructor Summary

    Constructors 
    Constructor Description
    LoessInterpolator()
    Constructs a new LoessInterpolator with a bandwidth of DEFAULT_BANDWIDTH, DEFAULT_ROBUSTNESS_ITERS robustness iterations and an accuracy of {#link #DEFAULT_ACCURACY}.
    LoessInterpolator​(double bandwidth, int robustnessIters)
    Construct a new LoessInterpolator with given bandwidth and number of robustness iterations.
    LoessInterpolator​(double bandwidth, int robustnessIters, double accuracy)
    Construct a new LoessInterpolator with given bandwidth, number of robustness iterations and accuracy.
  • Method Summary

    Modifier and Type Method Description
    PolynomialSplineFunction interpolate​(double[] xval, double[] yval)
    Compute an interpolating function by performing a loess fit on the data at the original abscissae and then building a cubic spline with a SplineInterpolator on the resulting fit.
    double[] smooth​(double[] xval, double[] yval)
    Compute a loess fit on the data at the original abscissae.
    double[] smooth​(double[] xval, double[] yval, double[] weights)
    Compute a weighted loess fit on the data at the original abscissae.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait