How this calculation works
Enter a complete ordered sequence. The position in the list defines time or progression; sorting the values would manufacture the pattern being tested.
Ut=2Σi≤t rank(xᵢ)−t(n+1); K=maxt<n |Ut|.A worked example
Ranks yield U=[−7,−12,−15,−16,−9,−4,−1], so K16 and split after4. Every one of8! labeled permutations is included; ties remain distinct labels. All tied yields K0,p1 and every split maximizes.
Good to know
8–300 complete ordered observations; independent/exchangeable under no-change null; pooled midranks for ties;999–4999 seeded permutations with plus-one p, exact enumeration only n≤8; no multiple change points, serial-dependence correction or causal event claim.
Reference: trend author-maintained Pettitt reference (opens in a new tab) ↗
Preserve the observation order
Enter a complete ordered sequence. The position in the list defines time or progression; sorting the values would manufacture the pattern being tested.
The test targets one shift in central tendency under a no-change reference. It does not segment multiple distinct regimes or identify the cause of a transition.
Compare this with the Time series change point segmentation calculator. Test the no-change null using the maximum absolute rank cumulative score and calibrate the maximum, returning all maximizing split locations. Existing segmentation minimizes squared-error plus user penalty and explicitly offers no significance calibration.
Accumulate centered ranks along the sequence
Rank the entire sequence with midranks for ties. At each split, compare the accumulated rank sum with its no-change center.
The largest absolute cumulative departure is K. Record every split attaining that maximum rather than hiding a tie behind one arbitrary reported location. The default sequence1,2,3,4,8,7,6,5 separates low and high observations halfway through. Its maximum absolute cumulative rank score is K=16 after observation4. Among all8!=40,320 labeled orderings, the exact two-sided probability is2/70. This value differs from the common large-sample exponential approximation, which gives about0.138967 for this very small example. The page uses complete labeled enumeration at length8 specifically to avoid presenting that asymptotic shortcut as exact evidence.
Calibrate the maximum rather than a chosen split
For exact small samples, permute the labeled observations through every ordering and recompute the maximum each time. Ties remain distinct labels.
A larger sample uses seeded permutations with the same maximum statistic. Testing only the selected split after viewing the sequence would omit selection over candidate splits.
Work through the checked default example
Ranks yield U=[−7,−12,−15,−16,−9,−4,−1], so K16 and split after4. Every one of8! labeled permutations is included; ties remain distinct labels. All tied yields K0,p1 and every split maximizes.
Among the40,320 labeled orderings, the exact two-sided maximum-rank probability is2/70, approximately0.0285714. The common exponential approximation is about0.138967, so the two calibration labels must remain distinct. For each candidate split t, sum the pooled midranks through t and compute U_t=2 cumulativeRank−t(n+1). The maximum absolute value searches both upward and downward changes. The search over all split locations is already part of the null statistic; computing a single two-sample probability only at the selected split would ignore that selection. If several locations tie for the maximum, the output retains every maximizing split rather than arbitrarily labeling the first as the uniquely determined event time.
Distinguish exact and asymptotic probabilities
The common exponential Pettitt formula is an approximation and can differ substantially from a complete small-sample randomization distribution.
Use the displayed method label to interpret the probability. The eight-point benchmark deliberately reports both references so a numerical mismatch is not mistaken for a coding error.
Check the exchangeability assumption
Unrestricted permutation assumes observations can exchange positions under the no-change null. Serial dependence can invalidate that assumption even without a change.
A time series with autocorrelation may need block resampling or another model. This page does not estimate a dependence correction from the sequence. For larger inputs the page shuffles the observation ordering with a fixed seed and recalculates the maximum each time. Its plus-one probability has simulation resolution1/(B+1), so a value at that floor means no more-extreme simulated ordering was observed, not a zero population probability. The null assumes exchangeable observations. Serial correlation, seasonality or repeated-subject structure can produce apparent changes and need a dependence-aware procedure. A detected split describes a rank-distribution change under that null; it neither establishes a causal intervention date nor estimates several simultaneous change points or their confidence intervals.
Read a candidate location with restraint
The maximizing split is the strongest rank departure among the tested positions. A small p value supports departure from the specified no-change model.
It does not locate an exact physical event or prove an abrupt mechanism. Report the observation spacing, any ties and the full rank-score curve alongside the selected split. The split index counts how many observations lie before the candidate boundary, so splitAfter4 separates positions1–4 from positions5–8. It does not mean the fourth observation itself is corrupted. If observations have irregular calendar spacing, attach the corresponding dates after interpreting this index; the rank statistic does not infer an unobserved transition time between measurements.
A few questions, answered
Should I sort my data first?
No. Input order defines the candidate change positions; sorting would create an artificial trend.
Can several split locations be returned?
Yes. Every position attaining the same maximum absolute rank score is a maximizing candidate.
Why differ from the usual Pettitt formula?
The common exponential tail is asymptotic; exact permutation calibration can differ sharply for small samples.
Does permutation correct autocorrelation?
No. Unrestricted permutations require exchangeability; serial dependence needs a separately justified null model.