reversalRate
reversalRate(
values):number
Defined in: trend.ts:102
Fraction of interior points at which a series changes direction.
Where mannKendallTrend answers “is it drifting”, this answers “is it oscillating”: a thermal ramp climbs steadily and reverses rarely, while a throttling processor alternates and reverses constantly. The two are complementary, and a series can score low on both by being flat.
Flat steps are not reversals and do not break a run: a direction persists across equal values until it actually changes.
O(n).
Parameters
Section titled “Parameters”values
Section titled “values”readonly number[]
The series, in observation order. Not modified.
Returns
Section titled “Returns”number
The reversal count divided by n - 2, in [0, 1] — 0 for a
monotone series, 1 for a perfectly alternating one. 0 for a series of
fewer than three values, which has no interior point to reverse at.