DADiSP Worksheet Functions > Function Categories > Statistics and Calculus > MOVMEDIAN
Calculates the moving median of a series.
MOVMEDIAN(series, N, rampflag)
series |
- |
A series or table. |
||||
N |
- |
An integer, the number of points to calculate the median as the series is processed. |
||||
rampflag |
- |
Optional. An integer, endpoint median flag.
|
A series or table.
W1: 1..5
W2: movmedian(W1, 3)
W3: movmedian(W1, 3, 0)
W2 == {1, 1.5, 2, 3, 4, 4, 5}
W3 == {0, 1, 2, 3, 4, 4, 0}
The moving median computation in W2 "ramps" up and down at the beginning and end of the series whereas the moving median computation of W3 assumes the series consists of 0 values before the beginning and after the end.
In particular, for series x of length N, movmedian(x, 3) returns the following N+2 length series:
If rampflag is 0, movmedian(x, 3, 0) returns the following N+2 length series:
For multi-column series, MOVMEDIAN computes the moving median on each column.
See SORT for a description of the sorting algorithm used to compute the median of each segment.
See MEDIAN to compute the median of the entire series.
See BLOCKMEDIAN to compute the non-overlapping block median of a series.