A detrending tool that refuses to guess.
Detrend is a browser-based detrending tool that turns a raw Excel column into a defensible trend statement. It runs a fixed seven-step protocol inside your browser: unit-root diagnostics decide which operations are legal, the trend test is chosen from those diagnostics, and every number is published with the independent oracle that validated it. Nothing is uploaded.
- Computation
- Parsing, diagnostics, decomposition and tests run in Web Workers on this device. No upload endpoint exists.
- Verification
- Every user-visible statistic is compared against an independent implementation with a published tolerance.
- Protocol
- Eight prescribed steps. No step is skipped silently, and a blocked step states its reason and its alternative.

The protocol
The analysis is a sequence, not a menu. Each stage has an action, a decision rule that can block the next stage, and a defined output. The rules below are implemented literally in the workspace.
- 01Ingest
The workbook is parsed in a dedicated Web Worker. Sheet names are read first; only the selected sheet is materialised.
Rule A sheet without at least five numeric values is rejected before any statistic runs.
Output Sheet inventory, column list, usable sample size.
- 02Screen
The parsed column is audited before any statistic runs: the time axis, the sentinel codes, the completeness and the instrument resolution.
Rule A non-monotonic time axis blocks the analysis. Sentinel codes are excluded and counted, never treated as measurements.
Output Integrity findings, usable n, missing ratio, sentinel count and the provenance record.
- 03Diagnose
ADF and KPSS are run against each other as complementary unit-root tests.
Rule Rejecting ADF while keeping KPSS admits a stable trend baseline. The reverse admits differencing.
Output Stationarity verdict and per-method availability.
- 04Clean
Robust outlier rules remove only points that fail their own stated threshold.
Rule IQR, modified Z, MAD/Qn and STL-residual rules each publish their efficiency and breakdown point.
Output The removed set, with the rule and row index for every point.
- 05Detrend
The detrending transform is selected by the verdict rather than by a default, and an explicit trend-plus-seasonality model is fitted alongside it.
Rule A blocked operation is never executed silently. Its reason and a legal alternative are shown instead.
Output Trend, seasonal and residual components, or the differenced series; the model slope with its interval and its AICc.
- 06Regimes
PELT with the modified BIC penalty searches for change points, and an interrupted time series is fitted at the strongest boundary.
Rule The penalty is calibrated so that noise is not cut into pieces, and the candidate models are ranked by corrected AIC.
Output Change points, the pre- and post-intervention rates with Newey–West standard errors, and the model comparison.
- 07Test
The Mann-Kendall family is applied with the correction the diagnostics support.
Rule Significant autocorrelation forces the corrected result to be shown beside the uncorrected one.
Output Tau, p-value, effect size and the Theil-Sen interval.
- 08Report
The finding is stated with its interval, its caveats and the decision trace behind it, and the whole run is exported as a reproducible recipe.
Rule A statistic without an independent oracle keeps a permanent UNVALIDATED label in the interface.
Output Finding, interval, caveats, the trace and a downloadable recipe with every parameter in force.
How the detrending tool chooses the method
This is the decision table encoded in the workspace. It is published so that the choice can be argued with, not merely accepted.
| Diagnostic condition | Decision | Reason |
|---|---|---|
| ADF rejects the unit root, KPSS does not reject stationarity | Deterministic detrending is available | A stable trend baseline is plausible, so flattening the series is defensible. |
| ADF cannot reject the unit root, KPSS rejects stationarity | Differencing is used; a straight line is blocked | The series wanders like a random walk, and a fitted line would manufacture structure that is not there. |
| The two unit-root tests disagree | Deterministic detrending carries a warning | Ambiguity is propagated into every downstream result instead of being resolved by preference. |
| Lag-1 autocorrelation exceeds the 95% band | The autocorrelation-corrected test becomes the headline | Variance under independence is overstated when observations persist, so the corrected p-value is the honest one. |
| A cycle length is detected | STL replaces the flat trend | A single slope cannot represent a seasonal component, and the seasonal test depends on it. |
| The usable sample is too small or too incomplete | Trend inference is blocked | Descriptive statistics remain available, but no headline is produced from an unstable sample. |
What a result looks like
Every finding is reported in five layers, in a fixed order. The statement is the same whether it is read by a statistician or a non-specialist, because the plain-language layer is a restatement of the same numbers rather than a separate claim.
- Rate of change
- −3.214 units/step
- 95% interval
- −4.502 … −2.106
- Usable sample
- 128 / 131
- Test
- Mann-Kendall (τ)
- τ
- −0.412
- p
- 0.003
- α
- 0.05
- Decision
- Reject H₀ — trend detected
- Stationarity verdict
- trend stationary
- Detrending
- STL
- Cycle length
- 12
- Outliers removed
- 3 (2.3%)
This series is decreasing overall, by about 3.21 units per step on average (95% likely between 2.11 and 4.50 units per step). The trend is very likely real, not random noise.
- 01
Decision
The direction of the series and whether it is distinguishable from chance at the stated alpha.
- 02
Effect estimate
The rate of change, its 95% interval and the unit it is measured in. An interval, not only a point estimate.
- 03
Inference
The test that was used, the rank correlation, the p-value, alpha and the resulting verdict, each number carrying its verification status.
- 04
Plain language
One sentence restating the same finding for a reader who does not read test statistics, with no new claim added.
- 05
Trace
Every automatic choice in order - diagnostic, rule, threshold, method - with the verification row behind it.
Four independent lines of evidence
Agreement with another implementation only proves that two programs compute the same thing. It does not prove that the thing is right. The workspace therefore carries four separate kinds of evidence, and each of them can fail on its own.
- 01
Agreement with an independent implementation
Every user-visible statistic is compared against statsmodels, SciPy, pymannkendall or ruptures, with the tolerance fixed before the comparison runs. A failed row blocks the build rather than producing a warning.
- 02
Recovery of a known truth
Synthetic series are generated with a planted slope, a planted seasonal amplitude, a planted change point and a planted level shift. The estimators must recover the parameters that were put in, within a tolerance that is stated in advance.
- 03
Metamorphic invariance
Negating, scaling, shifting or monotonically transforming the series must transform the output in exactly the predicted way, and reversing time must mirror the slope and the change points. These relations hold for every correct implementation.
- 04
Calibration under the null
The realised type-I error of the trend test is measured on data with no trend and must match the nominal level. The change-point penalty is calibrated so that noise produces no boundary while a one-standard-deviation shift is still found.
Correctness is a reproducible comparison, not a promise
The public matrix lists every statistic with its oracle, its tolerance, the rationale for that tolerance and the fixture it was checked against. A failed row blocks the build. A statistic that appears in the interface without a verification row is treated as a gate failure, and a method with no available oracle is permanently badged as unvalidated rather than quietly trusted.
Your file never crosses the network
There is no upload endpoint, no server action and no API route that accepts file bytes. Parsing, diagnostics, STL, trend tests and charts run on this device in Web Workers. Closing the tab discards the data. The only stored preferences are your display depth and whether you have seen a chart introduction.
Method notes: formulas, failure modes and the reasoning behind every default
Thirty seconds from workbook to a defensible answer
Drop a file and the workspace selects the sheet with the most numeric columns, picks the first numeric series, runs the stationarity diagnostics and states a finding with its interval. Nothing has to be configured to get a correct first answer, and nothing has to be taken on trust to trust it.