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.| Modifier and Type | Field and Description |
|---|---|
| private final double | accuracy
If the median residual at a certain robustness iteration is less than this amount, no more iterations are done. |
| private final double | bandwidth
The bandwidth parameter: when computing the loess fit at a particular point, this fraction of source points closest to the current point is taken into account for computing a least-squares regression. |
| public static final double | DEFAULT_ACCURACY
Default value for accuracy. |
| public static final double | DEFAULT_BANDWIDTH
Default value of the bandwidth parameter. |
| public static final int | DEFAULT_ROBUSTNESS_ITERS
Default value of the number of robustness iterations. |
| private final int | robustnessIters
The number of robustness iterations parameter: this many robustness iterations are done. |
| private static final long | serialVersionUID
serializable version identifier. |
| Access | Constructor and Description |
|---|---|
| public | LoessInterpolator()
Constructs a new |
| public | LoessInterpolator(double
when computing the loess fit at
a particular point, this fraction of source points closest
to the current point is taken into account for computing
a least-squares regression.
A sensible value is usually 0.25 to 0.5, the default value is
bandwidth, int DEFAULT_BANDWIDTH.This many robustness iterations are done.
A sensible value is usually 0 (just the initial fit without any
robustness iterations) to 4, the default value is
robustnessIters)DEFAULT_ROBUSTNESS_ITERS.Construct a new |
| public | LoessInterpolator(double
when computing the loess fit at
a particular point, this fraction of source points closest
to the current point is taken into account for computing
a least-squares regression.
A sensible value is usually 0.25 to 0.5, the default value is
bandwidth, int DEFAULT_BANDWIDTH.This many robustness iterations are done.
A sensible value is usually 0 (just the initial fit without any
robustness iterations) to 4, the default value is
robustnessIters, double DEFAULT_ROBUSTNESS_ITERS.If the median residual at a certain robustness iteration
is less than this amount, no more iterations are done. accuracy)Construct a new |
| Modifier and Type | Method and Description |
|---|---|
| private static void | checkAllFiniteReal(final double[]
Values array. values)Check that all elements of an array are finite real numbers. |
| public final PolynomialSplineFunction | Returns: A cubic spline built upon a loess fit to the data at the original abscissaethe arguments for the interpolation points xval, final double[] the values for the interpolation points yval)Implements org.
Deprecated
as a consequence of
PolynomialSplineFunction being deprecated.
Compute an interpolating function by performing a loess fit
on the data at the original abscissae and then building a cubic spline
with a
|
| private static int | Returns: the smallest compliant index.Weights array. weights, final int Index from which to start search. i)Return the smallest index |
| public final double[] | Returns: the values of the loess fit at corresponding original abscissae.Arguments for the interpolation points. xval, final double[] Values for the interpolation points. yval, final double[] point weights: coefficients by which the robustness weight
of a point is multiplied. weights)Compute a weighted loess fit on the data at the original abscissae. |
| public final double[] | Returns: values of the loess fit at corresponding original abscissaethe arguments for the interpolation points xval, final double[] the values for the interpolation points yval)Compute a loess fit on the data at the original abscissae. |
| private static double | |
| private static void | updateBandwidthInterval(final double[]
Arguments array. xval, final double[] Weights array. weights, final int Index around which the new interval should be computed. i, final int[] a two-element array {left, right} such that:
bandwidthInterval)(left==0 or xval[i] - xval[left-1] > xval[right] - xval[i])
and
(right==xval.length-1 or xval[right+1] - xval[i] > xval[i] - xval[left]).
The array will be updated.Given an index interval into xval that embraces a certain number of
points closest to |
| accuracy | back to summary |
|---|---|
| private final double accuracy If the median residual at a certain robustness iteration is less than this amount, no more iterations are done. | |
| bandwidth | back to summary |
|---|---|
| private final double bandwidth The bandwidth parameter: when computing the loess fit at a particular point, this fraction of source points closest to the current point is taken into account for computing a least-squares regression. A sensible value is usually 0.25 to 0.5. | |
| DEFAULT_ACCURACY | back to summary |
|---|---|
| public static final double DEFAULT_ACCURACY Default value for accuracy.
| |
| DEFAULT_BANDWIDTH | back to summary |
|---|---|
| public static final double DEFAULT_BANDWIDTH Default value of the bandwidth parameter. | |
| DEFAULT_ROBUSTNESS_ITERS | back to summary |
|---|---|
| public static final int DEFAULT_ROBUSTNESS_ITERS Default value of the number of robustness iterations. | |
| robustnessIters | back to summary |
|---|---|
| private final int robustnessIters The number of robustness iterations parameter: this many robustness iterations are done. A sensible value is usually 0 (just the initial fit without any robustness iterations) to 4. | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID serializable version identifier. | |
| LoessInterpolator | back to summary |
|---|---|
| public LoessInterpolator() Constructs a new | |
| LoessInterpolator | back to summary |
|---|---|
| public LoessInterpolator(double bandwidth, int robustnessIters) Construct a new
Calling this constructor is equivalent to calling {link
| |
| LoessInterpolator | back to summary |
|---|---|
| public LoessInterpolator(double bandwidth, int robustnessIters, double accuracy) throws OutOfRangeException, NotPositiveException Construct a new
| |
| checkAllFiniteReal | back to summary |
|---|---|
| private static void checkAllFiniteReal(final double[] values) Check that all elements of an array are finite real numbers.
| |
| interpolate | back to summary |
|---|---|
| public final PolynomialSplineFunction interpolate(final double[] xval, final double[] yval) throws NonMonotonicSequenceException, DimensionMismatchException, NoDataException, NotFiniteNumberException, NumberIsTooSmallException Implements org. Deprecated as a consequence of Compute an interpolating function by performing a loess fit
on the data at the original abscissae and then building a cubic spline
with a
| |
| nextNonzero | back to summary |
|---|---|
| private static int nextNonzero(final double[] weights, final int i) Return the smallest index
| |
| smooth | back to summary |
|---|---|
| public final double[] smooth(final double[] xval, final double[] yval, final double[] weights) throws NonMonotonicSequenceException, DimensionMismatchException, NoDataException, NotFiniteNumberException, NumberIsTooSmallException Compute a weighted loess fit on the data at the original abscissae.
| |
| smooth | back to summary |
|---|---|
| public final double[] smooth(final double[] xval, final double[] yval) throws NonMonotonicSequenceException, DimensionMismatchException, NoDataException, NotFiniteNumberException, NumberIsTooSmallException Compute a loess fit on the data at the original abscissae.
| |
| tricube | back to summary |
|---|---|
| private static double tricube(final double x) Compute the tricube weight function
| |
| updateBandwidthInterval | back to summary |
|---|---|
| private static void updateBandwidthInterval(final double[] xval, final double[] weights, final int i, final int[] bandwidthInterval) Given an index interval into xval that embraces a certain number of
points closest to
| |