Detect trend
detect_trendMann-Kendall trend test — detect whether a time series is trending up, down, or stable.
Pass an array of ordered values (e.g., daily visitor counts from query_timeseries) to get a statistical determination of trend direction, strength (Kendall's tau), and significance (p-value). Also returns Sen's slope (change per time step). trend is "increasing", "decreasing", or "stable"; "stable" means no significant trend at the given alpha.
Requires at least 4 data points.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| alpha | No | Significance level (default 0.05) | |
| values | Yes | Ordered time-series values (e.g., daily visitors) |