Skip to content

RollingPeakToPeak

Running peak to peak (max - min) over a window.

Parameters

  • window_size

    Typeint

    Size of the rolling window.

Attributes

Examples

from river import stats

X = [1, -4, 3, -2, 2, 1]
ptp = stats.RollingPeakToPeak(window_size=2)
for x in X:
    ptp.update(x)
    print(ptp.get())
0
5
7
5
4
1

Methods

get

Return the current value of the statistic.

update

Update and return the called instance.

Parameters

  • x'numbers.Number'