|
SuanShu, a Java numerical and statistical library | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectcom.numericalmethod.suanshu.signalprocessing.filter.MovingAverage
public class MovingAverage
This class applies a linear filtering to a univariate time series using Moving Average estimation.
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.
| Nested Class Summary | |
|---|---|
static class |
MovingAverage.Side
the types of moving average filtering available |
| Field Summary | |
|---|---|
MovingAverage.Side |
side
the data window |
| Constructor Summary | |
|---|---|
MovingAverage(double[] filter)
Create a MovingAverage filter using a symmetric window. |
|
MovingAverage(double[] filter,
MovingAverage.Side side)
Create a MovingAverage filter. |
|
| Method Summary | |
|---|---|
double[] |
filtering(double[] Xt)
Get the filtered signals. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public final MovingAverage.Side side
| Constructor Detail |
|---|
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 order| Method Detail |
|---|
public double[] filtering(double[] Xt)
Filter
filtering in interface FilterXt - the input signals
|
SuanShu, a Java numerical and statistical library | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||