Performs an N-point moving maximum calculation.
MOVMAXIMUM(series, N, "naflag", "edgeflag")
series |
- |
A series or table. |
|||||||||||||||
N |
- |
An integer, the segment size. The number of points to process as the series is traversed. |
|||||||||||||||
"naflag" |
- |
Optional. A string, the NA handling method.
|
|||||||||||||||
"edgeflag" |
- |
Optional. A string, the edge processing flag.
|
A series or table.
W1: {2, 3, 1, 5, 2, 4, 5, 7, 2}
W2: movmaximum(W1, 3)
W3: movmaximum(W1, 3, "center")
W4: movmax(W1, 3)
W2 == {2, 3, 3, 5, 5, 5, 5, 7, 7, 7, 2}
W3 == {3, 3, 5, 5, 5, 5, 7, 7, 7}
W4 == {3, 3, 5, 5, 5, 5, 7, 7, 7}
W2 computes the non-centered 3-point moving maximum. The first point of W2 is the first point of W1 and the second point is the maximum of the first two points of W1. The second to last point of W2 is the maximum of the last two points of W1 and the last point is the last point of W1.
W3 computes the centered 3-point moving maximum where the result at point N is the maximum of points N-1, N and N+1. The computation starts at sample 2.
W4 computes the same centered 3-point moving maximum as W3.
W1: {2, 3, 1, 5, 2, 4, 5, 7, 2}
W2: movmaximum(W1, 3, "full")
W3: movmaximum(W1, 3, "shrink")
Both W2 and W3 return the series: {2, 3, 3, 5, 5, 5, 5, 7, 7, 7, 2}.
W1: {2, 3, 1, 5, nan, 4, 5, 7, 2}
W2: movmaximum(W1, 3)
W3: movmaximum(W1, 3, "omitnan")
W4: movmaximum(W1, 3, "includenan")
W2 == {2, 3, 3, 5, 5, 5, 5, 7, 7, 7, 2}
W3 == {2, 3, 3, 5, 5, 5, 5, 7, 7, 7, 2}
W4 == {2, 3, 3, 5, nan, nan, nan, 7, 7, 7, 2}
Both W2 and W3 ignore the NaN values.
W4 returns NaN for any segment that includes one or more NaN values.
W1: {2, 3, 1, 5, nan, 4, 5, 7, 2}
W2: movmaximum(W1, 3, "includenan", "center")
W2 == {3, 3, 5, nan, nan, nan, 7, 7, 7}
Similar to above except W2 computes a 3-point centered moving maximum where the result at point N is the maximum of points N-1, N and N+1. Any segment that includes one or more NaN values returns NaN.
W1: {2, 3, 1, 5, 2, 4, 5, 7, 2}
W2: movmaximum(W1, 3, "center")
W3: movmaximum(W1, 3, "discard")
W4: movmaximum(W1, 3, "legacy")
W2 == {3, 3, 5, 5, 5, 5, 7, 7, 7}
W3 == {3, 5, 5, 5, 5, 7, 7}
W4 == {2, 3, 3, 5, 5, 5, 5, 7, 7}
W2 computes a 3-point centered moving maximum where the result at point N is the maximum of points N-1, N and N+1.
W3 computes a 3-point moving maximum for overlapping segments that contain exactly 3 samples. Shorter segments at the start and end edges are discarded.
W4 computes a 3-point moving maximum where the maximum of each overlapping moving segment of length 3 is computed but the segment length adjusts from 1 to 3 at the start edge only. The output length is the same as the input length. This option reproduces the behavior of MOVMAX implemented in previous versions.
MOVMAXIMUM computes a non centered N-point moving maximum.
NaN values are ignored by default. Set naflag to "includenan" to process NaN values.
By default or with edgeflag
== "full" or edgeflag
= "shrink", the first N-1 points returned by MOVMAXIMUM given
an N-point window are the maximum values in consecutively larger segments
of sizes 1, 2, 3, ... , N-1. The last N-1 points are the maximum values
of consecutively smaller segments of sizes N-1, N-2, ..., 2, 1. The output
length is
For edgeflag == "center", the result is centered within the N-point segment and the output length is the same as the input length.
For edgeflag == "discard", only segments that contain exactly N samples are processed. Shorter segments at the start and end edges are discarded.
For edgeflag == "legacy", the start segments are processed in the same manner as "full", but the processing stops at the last block of N samples. This reproduces the behavior of prior versions of MOVMAX .
See MOVMAX to compute a centered moving maximum.
See BLOCKMAX to compute the moving maximum of non-overlapping blocks.