Time Series Lab
Keep chronology visible while trend, seasonality, lag relationships, smoothing, train/test cutoffs, and one-step forecasts change.
A deterministic synthetic time series exposes its generating components, trailing moving averages, lag relationships, chronological evaluation split, and a small lag-regression forecast. Playback keeps the learner oriented in time instead of treating ordered data like shuffled rows.
Step by step
- Generate an ordered signal with trend, seasonal structure, and noise.
- Reveal observations through time and overlay a trailing moving average.
- Inspect the known synthetic trend, seasonality, and noise components separately.
- Plot yₜ against yₜ₋lag and calculate training-period lag correlation.
- Create a chronological train/test cutoff without shuffling.
- Fit a lag regression before the cutoff and evaluate MAE/RMSE only on later observations.
Core formulas
Moving average
MAₜ = (1/w) Σₖ₌₀^{w−1} yₜ₋ₖA trailing window smooths recent observations without using future values.
Lag relation
(yₜ₋ₖ, yₜ)Lag plots reveal whether past values have a useful relationship with current values.
Lag regression
ŷₜ = a + b·yₜ₋ₖThe educational forecast learns a linear relationship using only pre-cutoff lag pairs.
When to use Time Series Lab
- Understanding why chronological data cannot usually be randomly shuffled for evaluation.
- Learning trend, seasonality, smoothing, and autocorrelation intuition.
- Connecting lagged features to simple forecasting.