Time Series Fundamentals
Data with memory: order is information
Time-series data is ordered, dependent and often trending. Stationarity, components (trend, seasonality, noise) and the forecasting setup decide which models could work — everything else follows.
What you will learn
- Describe trend, seasonality and residual components
- Explain stationarity and why models assume it
- Frame a forecasting problem (horizon, frequency, as-of date)
What is this?
A time series is a sequence of observations indexed by time — daily revenue, hourly CPU, weekly inventory. Unlike tabular rows, these points are ordered and dependent: tomorrow's value correlates with today's. Time-series modeling decomposes the signal into trend (long-duration drift), seasonality (periodic cycles) and residual noise, then extrapolates that structure to future horizons. Whether inference (regression-style) or extrapolation (forecasting) is the goal changes every modeling decision.
Why do you need it?
- Ordering means standard i.i.d. assumptions are wrong — shuffling corrupts the signal.
- Trend and seasonality are modelable structure that naive methods ignore.
- Stationarity determines which statistical machinery (ARIMA, spectral, etc.) is even applicable.
- Choosing the wrong setup (horizon, forecast vs nowcast) silently invalidates results.
Mental model
A trail of footprints in snow
A time series
Each footprint (observation) says something about the one before and after — direction, stride, momentum. You can't 'shuffle' a trail and still read where it goes. Time series reading is about extrapolating from a pattern, not comparing independent samples.
How it works
- Establish the sampling frequency, horizon (h steps ahead) and the exact prediction-time view.
- Plot and split components: moving-average trend, seasonal effect by period, and residuals.
- Check stationarity (constant mean/variance over time) with the Augmented Dickey-Fuller test or visual inspection.
- Estimate autocorrelation (ACF/PACF) to see which lags carry signal.
- Choose modeling family by the components: trend/seasonal → decomposition+exponential/ARIMA; rich calendar features → ML.
From raw series to component-wise forecast.
In production
- An e-commerce planner forecasts daily sales with a weekly seasonality at a 14-day horizon to set inventory buffers.
- An SRE team forecasts error-spike days by decomposing hourly 5xx count into weekly traffic cycles plus incident noise.
- A demand-sensing team retrains nightly so the seasonal effects always reflect last month's calendar.
Best practices
- Pin the horizon and frequency up front; forecast targets drift if either changes.
- Validate on future-only windows (walk-forward), never shuffled folds.
- Inspect ACF/PACF before choosing a model family — the lags say which dependency structure is real.
- Always compare against the best trivial baseline (last value, seasonal naive).
Common mistakes
- Ignoring the calendar (holidays, weekends) treated as uniform seasonality.
- Fitting models on raw trending data without differencing, then complaining about non-stationarity.
- Predicting far-future levels with a 'nowcast' model trained on short memory.
- Holding out a random test slice instead of the most recent — leaks future into training windows.
Common issues
Very high training fit, embarrassing forecastModel captured noise/lagged signal instead of structure
Backtest honestly out-of-sample, difference non-stationary terms, and shrink the model's lag memory.
Forecast repeats last period flatlySeasonality period mis-specified or trend dominated by one event
Decompose and confirm the seasonal period; add explicit calendar features.
Debugging tips
- Plot residuals vs fitted and vs time: a pattern in the residual line = missing component or decree.
- If ACF decays slowly at large lags, the series is trending — difference it and re-inspect.
- Forecast too smooth? Your model overdamps seasonality; verify the seasonal period matches the data.
- Two-step: fix the horizon and 'as-of' timestamp, then rerun — the test setup is usually the bug, not the model.
Interview checkpoint
Quick quiz
The correct way to split time-series data for validation is:
Trend and seasonality are structure that can often be modeled and extrapolated.