public class MovingAverage extends Object implements Filter
y[i] = f[1]*x[i+o] + … + f[p]*x[i+o-(p-1)]
o is the offset, depending on whether only past values or both past and future values centered around lag 0 are used.
When a symmetric window is used and the filter length is even, more of the filter is forward in time than backward.
The R equivalent function is filter
.
Modifier and Type | Class and Description |
---|---|
static class |
MovingAverage.Side
the available types of moving average filtering
|
Constructor and Description |
---|
MovingAverage(double[] filter)
Construct a moving average filter using a symmetric window.
|
MovingAverage(double[] filter,
MovingAverage.Side side)
Construct a moving average filter.
|
Modifier and Type | Method and Description |
---|---|
double[] |
transform(double[] x)
Transforms the input signal into the output signal.
|
public MovingAverage(double[] filter, MovingAverage.Side side)
filter
- the filter coefficients in reverse time orderside
- specify the data window to usepublic MovingAverage(double[] filter)
filter
- the filter coefficients in reverse time orderCopyright © 2010-2020 NM FinTech Ltd.. All Rights Reserved.