public class LoessInterpolator extends Object implements UnivariateInterpolator, Serializable
Modifier and Type | Field and 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 and 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 bandwidthIn,
int robustnessItersIn)
Construct a new
LoessInterpolator with given bandwidth and number of robustness iterations. |
LoessInterpolator(double bandwidthIn,
int robustnessItersIn,
double accuracyIn)
Construct a new
LoessInterpolator with given bandwidth, number of robustness iterations and accuracy. |
Modifier and Type | Method and 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.
|
public static final double DEFAULT_BANDWIDTH
public static final int DEFAULT_ROBUSTNESS_ITERS
public static final double DEFAULT_ACCURACY
public LoessInterpolator()
LoessInterpolator
with a bandwidth of DEFAULT_BANDWIDTH
,
DEFAULT_ROBUSTNESS_ITERS
robustness iterations
and an accuracy of {#link #DEFAULT_ACCURACY}.
See LoessInterpolator(double, int, double)
for an explanation of
the parameters.public LoessInterpolator(double bandwidthIn, int robustnessItersIn)
LoessInterpolator
with given bandwidth and number of robustness iterations.
Calling this constructor is equivalent to calling {link LoessInterpolator(bandwidth,
robustnessIters, LoessInterpolator.DEFAULT_ACCURACY)
bandwidthIn
- 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.DEFAULT_BANDWIDTH
.robustnessItersIn
- This many robustness iterations are done.DEFAULT_ROBUSTNESS_ITERS
.LoessInterpolator(double, int, double)
public LoessInterpolator(double bandwidthIn, int robustnessItersIn, double accuracyIn)
LoessInterpolator
with given bandwidth, number of robustness iterations and accuracy.bandwidthIn
- 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.DEFAULT_BANDWIDTH
.robustnessItersIn
- This many robustness iterations are done.DEFAULT_ROBUSTNESS_ITERS
.accuracyIn
- If the median residual at a certain robustness iteration
is less than this amount, no more iterations are done.OutOfRangeException
- if bandwidth does not lie in the interval [0,1].NotPositiveException
- if robustnessIters
is negative.LoessInterpolator(double, int)
public final PolynomialSplineFunction interpolate(double[] xval, double[] yval)
SplineInterpolator
on the resulting fit.interpolate
in interface UnivariateInterpolator
xval
- the arguments for the interpolation pointsyval
- the values for the interpolation pointsNonMonotonicSequenceException
- if xval
not sorted in
strictly increasing order.DimensionMismatchException
- if xval
and yval
have
different sizes.NoDataException
- if xval
or yval
has zero size.NotFiniteNumberException
- if any of the arguments and values are
not finite real numbers.NumberIsTooSmallException
- if the bandwidth is too small to
accomodate the size of the input data (i.e. the bandwidth must be
larger than 2/n).public final double[] smooth(double[] xval, double[] yval, double[] weights)
xval
- Arguments for the interpolation points.yval
- Values for the interpolation points.weights
- point weights: coefficients by which the robustness weight
of a point is multiplied.NonMonotonicSequenceException
- if xval
not sorted in
strictly increasing order.DimensionMismatchException
- if xval
and yval
have
different sizes.NoDataException
- if xval
or yval
has zero size.NotFiniteNumberException
- if any of the arguments and values are
not finite real numbers.NumberIsTooSmallException
- if the bandwidth is too small to
accomodate the size of the input data (i.e. the bandwidth must be
larger than 2/n).public final double[] smooth(double[] xval, double[] yval)
xval
- the arguments for the interpolation pointsyval
- the values for the interpolation pointsNonMonotonicSequenceException
- if xval
not sorted in
strictly increasing order.DimensionMismatchException
- if xval
and yval
have
different sizes.NoDataException
- if xval
or yval
has zero size.NotFiniteNumberException
- if any of the arguments and values are
not finite real numbers.NumberIsTooSmallException
- if the bandwidth is too small to
accomodate the size of the input data (i.e. the bandwidth must be
larger than 2/n).Copyright © 2021 CNES. All rights reserved.