Calculates the cumulative maximum of a series.
CUMMAX(series, dim, "naflag", "cmpflag")
series |
- |
A series or array, the input series. |
||||||
dim |
- |
Optional. An integer or string, the computation dimension.
|
||||||
"naflag" |
- |
Optional. A string, the NA handling method.
|
||||||
"cmpflag" |
- |
Optional. A string, the complex compare method.
|
A series or table.
cummax({20, 15, 30, 10, 25})
returns {20, 20, 30, 30, 30}.
W1: integ(gnorm(1000, 1))
W2: cummax(W1)
max(W1) == W2[end]
The last point of CUMMAX is the overall maximum of the input data.
W1: {20, 15, nan, nan, 25}
W2: cummax(w1)
W3: cummax(w1, "omitnan")
W4: cummax(w1, "includenan")
W2 == {20, 20, 20, 20, 25}
W3 == {20, 20, 20, 20, 25}
W4 == {20, 20, nan, nan, nan}
Both W2 and W3 ignore the NaN values.
Because W4 contains and includes NaN values, the cumulative maximum becomes and remains NaN after the first occurrence.
W1: {3 + i, -4 + 2i, 2 + 3i, 2 + 4i, 8 + 5i}
W2: cummax(w1)
W3: cummax(w1, "abs")
W4: cummax(w1, "real")
W2 == {3 + i, -4 + 2i, -4 + 2i, -4 + 2i, 8 + 5i}
W3 == {3 + i, -4 + 2i, -4 + 2i, -4 + 2i, 8 + 5i}
W4 == {3 + i, 3 + i, 3 + i, 3 + i, 8 + 5i}
Both W2 and W3 compare complex values based on the magnitude.
W4 compares complex values based on the real part.
CUMMAX calculates the cumulative maximum of a series.
The nth value of the output series is equal to the maximum of the first n points of the input series.
The naflag option defaults to "omitnan" which causes NaN values to be ignored during computation.
The cmpflag option is ignored for real series.
See CUMMIN for the cumulative minimum.