rolling_max
rolling_max(x, [window=5])
Input: x, window · Output: no output
What it is
Maximum over a centred window. Same shape/type rules as rolling_mean.
Overloads
One call shape — this function is not overloaded.
| Code | Input | Output | Description |
rolling_max(x, [window=5]) | x —not documented yetwindow optional (default 5)Maximum over a centred window. | not documented yet | Same shape/type rules as rolling_mean. |
Examples
No documentation example calls this form yet. The Noise chapter is where one belongs.
How it works
rolling_mean/rolling_rms/rolling_std/rolling_min/ rolling_max(x, [window=5]) — a statistic over a sliding window: drift removal before an FFT, a moving-RMS trigger level, a moving min/max envelope. Centred on each sample over an ODD window, same as every other windowed function in this engine (medfilt, savgol, smooth, hampel) and refusing an even one for the same reason -- an even window has no middle sample and which way it rounds changes the answer. The edges are where these deliberately DIVERGE from the smoothers above, and it is worth stating why rather than leaving it to be discovered. medfilt/moving_average pad (reflect/clamp) because a filter must emit a sample for every input sample and has to invent the neighbours it does not have. These are statistics, not filters: padding would answer "what was the spread of the data here" with fabricated data, and for rolling_std it does not just add edge error, it biases the answer toward zero (a clamped repeat has no variance), reporting the signal as quietest exactly where least is known about it. So the window SHRINKS at the edges instead -- MATLAB's movmean/movstd default and pandas' min_periods=1 -- and every returned value is the statistic of real samples only. See numeric::noise's own section comment for the full argument. A Signal comes back a Signal at the same Fs: the output is the same length and each sample still lines up with the input instant it was centred on, so the rate is still true.
From the note above this builtin in the interpreter, where the reasoning was written down as it was built.