Changepoint Dataset Generator
A changepoint is the moment a series stops behaving one way and starts behaving another. Detecting one is easy when the shift is large and genuinely hard when it is not, and the only honest way to see where that boundary lies is to plant a shift you control and watch a detector try to find it. This does exactly that: the planted point and the recovered point are both shown, and they do not always agree.
What this generator does
Places a level shift at a random point in the middle half of the series and draws normal noise around the two levels. It then searches every possible split independently of where the shift was planted, choosing the one that minimises the total squared error within the two segments, and reports both positions so they can be compared.
How to use this tool
- Choose a length and how large a shift to plant, in standard deviations.
- Generate and try to spot the shift in the chart before reading the answer.
- Compare the planted point with the recovered one — the dashed line marks the recovery.
- Lower the shift until the detector starts missing it, and note how large that shift still is.
Understanding the controls
- How many rows
- Between 20 and 400. The changepoint is always placed away from the ends, where a segment would be a single point.
- Shift size
- How far the level moves, as a percentage of a standard deviation. Small shifts are genuinely hard to locate and often recovered in the wrong place.
- Seed
- Any word reproduces the same series, the same planted point and the same recovery.
Common use cases
- Teaching changepoint detection with ground truth available
- Showing how large a shift must be before it is reliably findable
- Test data for a breakpoint or structural-break implementation
- Monitoring and alerting exercises with a known answer
- Setting a reproducible exercise from a seed
How this generator works
The search tries every index as a candidate split, computes each segment's mean, and sums the squared deviations within both. The split with the lowest total wins. That criterion is exactly the one a single-changepoint detector uses, and it is computed from the values alone — it has no access to where the shift was actually planted, which is what makes the comparison meaningful rather than circular.
Randomness and fairness
The noise and the changepoint location are random; the recovery is computed from the finished series. A seed reproduces everything exactly and is therefore explicitly not cryptographically secure. Without a seed the browser's cryptographically secure generator is used.
For how randomness is produced across the whole site, see how Generate Random works.
Limitations and good to know
- Exactly one changepoint — multiple shifts need a different and much harder search.
- The shift is in the level only; changes in variance or trend are not covered.
- No significance test is offered: the search always returns its best split, even on a series with no shift at all.
- Noise is independent between points, so a persistent series may fool the detector in ways this does not show.
- Series are not stored between visits; seed one you want again.
Privacy and your data
The series and the search run entirely in your browser. Nothing about the data or your seed is transmitted or kept.
Related generators
- Autocorrelated Series GeneratorTime series with a chosen serial correlation, showing the measured lag-1 correlation against the process value and what differencing does to it.
- Seasonal Time Series GeneratorA series built from a trend and a season you specify, with each point's parts recorded so a decomposition can be checked rather than trusted.
- Outlier Dataset GeneratorContaminated samples where the planted outliers are labelled, so a detection rule can be scored on both kinds of error.
- Time-to-Event Dataset GeneratorReliability-style lifetimes with right-censoring at a horizon you set, showing how badly a plain average of completed rows underestimates the truth.
- ANOVA Dataset GeneratorGrouped data with a known separation, and the full ANOVA table whose sums of squares are checked to split exactly.