Time Series Analysis and Forecasting
Introduction
What Question Does It Ask?
Time series analysis studies measurements whose order matters: yesterday's value affects today's. The course teaches how to split a series into trend, seasonality and noise, how to model autocorrelation, and how to forecast the future together with its uncertainty.
At a glance
time-dependent statistical models
timestamped measurements
forecast, trend, seasonality
forecast error (MAE, RMSE)
medium-high
long history
Introduction
A Short History
Yule explains sunspot numbers with an autoregressive (AR) model.
The Kalman filter is published: it estimates a hidden state step by step from noisy measurements.
Box and Jenkins's book establishes ARIMA models and how to build them.
Engle proposes the ARCH model, in which volatility changes over time.
Hochreiter and Schmidhuber introduce the LSTM; long dependencies become learnable.
Facebook open-sources Prophet, which separates seasonality and holidays.
The Course
Core Concepts
Long-run direction and regularly repeating cycles.
Mean and variance do not change over time.
Correlation of a series with its own past.
Removing the trend to make a series stationary.
Autoregression, differencing and moving average together.
A forecast that weights the recent past more.
A forecast with its uncertainty, not a single number.
The test set always comes after training; no shuffling.
The Course
A Typical Workflow
The Course
What Does the Course Cover?
- Components of a series: trend, seasonality, noise
- Visualization and STL decomposition
- Stationarity, differencing and unit root tests
- Autocorrelation and partial autocorrelation
- Exponential smoothing and Holt-Winters
- AR, MA and ARMA models
- ARIMA and seasonal ARIMA (SARIMA)
- Regression with external regressors, dynamic models
- Forecast evaluation and rolling-origin validation
- Volatility models: ARCH and GARCH
- State space models and the Kalman filter
- Forecasting with machine learning and deep nets
Skills you will gain
A typical semester; the order and coverage vary between universities.
Try It
Planning Next Summer's Ice Cream
An ice cream maker plans the coming months' production from three years of monthly sales. Pick a method and a horizon; the last year's real sales are held out and the forecast is scored on them.
Context
Prerequisites
Courses worth knowing before this one, and why they are needed.
| Course | Why it is needed |
|---|---|
| Probability and Statistics | stationarity, autocorrelation, ARIMA |
| Calculus | series, derivatives and integrals: the language of models and filters |
| Programming | reading files, handling dates and plotting in Python |
Context
Are You Ready for This Course?
Ask yourself; for every "no", the right-hand column shows where to start.
| Ask yourself | If not, start with |
|---|---|
| Can you explain mean, variance and the correlation coefficient? | Probability and Statistics |
| Can you fit a linear regression and interpret its coefficients? | Machine Learning |
| Can you compute the sum of a geometric series? | Sequences and series from calculus |
| Can you read a CSV file with a date column in Python and plot it? | An intro programming course, then a short pandas tutorial |
Context
Neighbouring Courses
Overlap
Overlapping Courses
| Relation | Course | Shared ground |
|---|---|---|
| builds on | This course builds on Probability and Statistics | stationarity, autocorrelation, ARIMA |
| shares methods | Shares methods with Deep Learning | recurrent networks, attention-based forecasting |
| shares methods | Shares methods with Digital Signal Processing | frequency analysis, filtering |
| shares methods | Shares methods with Remote Sensing | multitemporal image series |
Differences
Where It Differs (1/2)
| Criterion | Time Series | Probability & Statistics | Signal Processing |
|---|---|---|---|
| Core question | How do we find structure in measurements over time and forecast the future? | How is uncertainty measured, and how do we draw reliable conclusions from limited data? | How are sampled signals analyzed, filtered and transformed? |
| Approach | time-dependent statistical models | probability models and inference | mathematical transforms and filters |
| Input | timestamped measurements | sample data | sampled signal |
| Output | forecast, trend, seasonality | estimate, confidence interval, test result | filtered signal, spectrum |
| Success measure | forecast error (MAE, RMSE) | unbiasedness, power, significance | signal-to-noise ratio, frequency response |
| Math load | medium-high | the theory itself | high: complex numbers, Fourier |
| Data needs | long history | a sample | no learning; the signal suffices |
- Probability & Statistics: Statistics usually assumes independent observations; this course deals with ordered data whose observations depend on each other.
- Signal Processing: Signal processing filters a signal and looks at its frequencies; this course uses the same tools to forecast the future.
Differences
Where It Differs (2/2)
| Criterion | Time Series | Deep Learning | Machine Learning |
|---|---|---|---|
| Core question | How do we find structure in measurements over time and forecast the future? | How do many-layered networks learn useful representations from raw data? | How does a program generalize from examples? |
| Approach | time-dependent statistical models | multilayer representation learning | statistical learning |
| Input | timestamped measurements | raw data: images, text, audio | labeled or unlabeled examples |
| Output | forecast, trend, seasonality | learned representation and prediction | a model that makes predictions |
| Success measure | forecast error (MAE, RMSE) | accuracy, loss, scaling | error on unseen data |
| Math load | medium-high | high: derivatives, matrices, probability | high: linear algebra, probability, optimization |
| Data needs | long history | large; needs GPUs | moderate to large |
- Deep Learning: Deep learning offers a powerful family of forecasting models; this course also teaches when a simple model is enough.
- Machine Learning: ML shuffles examples and splits them at random; here time order is kept and the model is trained only on the past.
Practice
Applications
Planning sales, stock and production.
Power consumption and renewable output.
Volatility, risk and return models.
Temperature, rainfall and CO₂ series.
Deviations in server and sensor metrics.
Forecasting inflation, unemployment and growth.
Practice
Risks and Ethics
A random split, or scaling with statistics of the whole series, carries future values into training; test scores become fake.
In the 2020 pandemic, demand and traffic series changed overnight; models that fit the past well were wrong for weeks.
A single number suggests certainty; stock or energy decisions get made without knowing the uncertainty.
When everyone acts on the same price or demand forecast, the series moves; a forecast can fulfil or defeat itself.
In depth: Explainable AI and AI Ethics.
Practice
Tools and Datasets
Tools and libraries
Well-known datasets
Practice
Common Misconceptions
| Common belief | In fact |
|---|---|
| Time series data can be tested with a random split. | Future values leak into training; testing always follows time order. |
| Deep networks beat classic models on every series. | In the M competitions, simple and statistical methods have often been very strong. |
| A good model gives one correct number. | Forecasts are uncertain; for decisions the prediction interval matters at least as much as the point forecast. |
| A model that worked in the past always works. | Structural breaks (a pandemic, a crisis) change the series; models must be monitored and refreshed. |
Next Steps
After This Course
Courses that build on or extend this one
Related careers
Next Steps
Further Reading
- Hyndman and Athanasopoulos, Forecasting: Principles and Practice, 3rd ed., OTexts, 2021.
- Box, Jenkins, Reinsel and Ljung, Time Series Analysis: Forecasting and Control, 5th ed., Wiley, 2015.
- Shumway and Stoffer, Time Series Analysis and Its Applications, 4th ed., Springer, 2017.
- Brockwell and Davis, Introduction to Time Series and Forecasting, 3rd ed., Springer, 2016.