Skip to content

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).

readonly number[]

The series, in observation order. Not modified.

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.