mannKendallTrend
mannKendallTrend(
values):MannKendallTrend
Defined in: trend.ts:37
Mann–Kendall trend test statistic: whether a series drifts monotonically, with no assumption about the shape of the underlying distribution and no assumption that the drift is linear.
A monotone ramp and an oscillation around a fixed level are what this
separates — the first accumulates concordant pairs and drives S away from
zero, while the second cancels them out. It is unaffected by outliers, since
only the sign of each pairwise difference counts, never its size.
Ties contribute nothing to S and are corrected for in the variance.
O(n²) — every ordered pair is compared. Intended for the hundreds-of-points series a monitor collects, not for bulk data.
Parameters
Section titled “Parameters”values
Section titled “values”readonly number[]
The series, in observation order. Not modified.
Returns
Section titled “Returns”The statistic and its standardised form, both 0 for a series of
fewer than two values.