Smoothing.Loess Method

Definition

Namespace: Extreme.Mathematics.SignalProcessing
Assembly: Extreme.Numerics (in Extreme.Numerics.dll) Version: 8.1.23

Overload List

Loess(Vector<Double>, Double, Int32, Double) Applies a LOESS filter to the specified signal.
Loess(Vector<Double>, Int32, Int32, Double) Applies a LOESS filter to the specified signal.
Loess(Vector<Double>, Vector<Double>, Double, Int32, Double) Applies a LOESS filter to the specified signal.
Loess(Vector<Double>, Vector<Double>, Int32, Int32, Double) Applies a LOESS filter to the specified signal.

Loess(Vector<Double>, Double, Int32, Double)

Applies a LOESS filter to the specified signal.
C#
public static Vector<double> Loess(
	Vector<double> signal,
	double smoothingFactor,
	int robustSteps = 0,
	double delta = 0
)

Parameters

signal  Vector<Double>
The signal to filter.
smoothingFactor  Double
The size of the neighbourhood that contributes to the smoothing at each point as a fraction of the total range of the input.
robustSteps  Int32  (Optional)
(Optional.) The number of robustness iterations. The default is 0.
delta  Double  (Optional)
(Optional.) Distance within which robust regression is not recomputed.

Return Value

Vector<Double>
The smoothed signal.

Remarks

When the number of data points is large, the computation time can be reduced by setting delta to a suitable value. After the initial robust regression weights are computed, the full regression is only performed for points that are delta apart. Interpolation is used for any intermediate points.

Exceptions

ArgumentNullException

signal is null.

ArgumentOutOfRangeException

smoothingFactor is less than or equal to zero or greater than 1.

Loess(Vector<Double>, Int32, Int32, Double)

Applies a LOESS filter to the specified signal.
C#
public static Vector<double> Loess(
	Vector<double> signal,
	int windowLength,
	int robustSteps = 0,
	double delta = 0
)

Parameters

signal  Vector<Double>
The signal to filter.
windowLength  Int32
The length of the smoothing window.
robustSteps  Int32  (Optional)
(Optional.) The number of robustness iterations. The default is 0.
delta  Double  (Optional)
(Optional.) Distance within which robust regression is not recomputed.

Return Value

Vector<Double>
The smoothed signal.

Remarks

When the number of data points is large, the computation time can be reduced by setting delta to a suitable value. After the initial robust regression weights are computed, the full regression is only performed for points that are delta apart. Interpolation is used for any intermediate points.

Exceptions

ArgumentNullException

signal is null.

ArgumentOutOfRangeException

windowLength is less than two or greater than the length of signal.

-or-

windowLength is not odd.

Loess(Vector<Double>, Vector<Double>, Double, Int32, Double)

Applies a LOESS filter to the specified signal.
C#
public static Vector<double> Loess(
	Vector<double> x,
	Vector<double> signal,
	double smoothingFactor,
	int robustSteps = 0,
	double delta = 0
)

Parameters

x  Vector<Double>
The x values of the signal.
signal  Vector<Double>
The signal to filter.
smoothingFactor  Double
The size of the neighbourhood that contributes to the smoothing at each point as a fraction of the total range of x.
robustSteps  Int32  (Optional)
(Optional.) The number of robustness iterations. The default is 0.
delta  Double  (Optional)
(Optional.) Distance within which robust regression is not recomputed.

Return Value

Vector<Double>
The filtered signal.

Remarks

When the number of data points is large, the computation time can be reduced by setting delta to a suitable value. After the initial robust regression weights are computed, the full regression is only performed for points that are delta apart. Interpolation is used for any intermediate points.

Exceptions

ArgumentNullException

x is null.

-or-

signal is null.

DimensionMismatchException

x and signal do not have the same length.

ArgumentOutOfRangeException

smoothingFactor is less than or equal to zero or greater than 1.

Loess(Vector<Double>, Vector<Double>, Int32, Int32, Double)

Applies a LOESS filter to the specified signal.
C#
public static Vector<double> Loess(
	Vector<double> x,
	Vector<double> signal,
	int windowLength,
	int robustSteps = 0,
	double delta = 0
)

Parameters

x  Vector<Double>
The x values of the signal.
signal  Vector<Double>
The signal to filter.
windowLength  Int32
The length of the smoothing window.
robustSteps  Int32  (Optional)
(Optional.) The number of robustness iterations. The default is 0.
delta  Double  (Optional)
(Optional.) Distance within which robust regression is not recomputed.

Return Value

Vector<Double>
The filtered signal.

Remarks

When the number of data points is large, the computation time can be reduced by setting delta to a suitable value. After the initial robust regression weights are computed, the full regression is only performed for points that are delta apart. Interpolation is used for any intermediate points.

Exceptions

ArgumentNullException

x is null.

-or-

signal is null.

DimensionMismatchException

x and signal do not have the same length.

ArgumentOutOfRangeException

windowLength is less than two or greater than the length of signal.

-or-

windowLength is not odd.

See Also