Introduction: Predicting the Future
Stock prices, weather temperatures, website traffic, energy consumption – all change over time. Time series data has a temporal dimension that traditional ML ignores!
Key Challenge: Past values influence future values. We need models that capture temporal dependencies.
Learning Objectives
- Understand time series components (trend, seasonality, noise)
- Master ARIMA models for forecasting
- Apply exponential smoothing
- Handle temporal cross-validation
- Build forecasting pipelines
- Evaluate forecast accuracy
1. Time Series Components
Decomposition
Any time series can be decomposed into:
- Trend: Long-term increase or decrease
- Seasonality: Regular patterns (daily, weekly, yearly)
- Residual: Random noise
2. Simple Forecasting Methods
Moving Average
Exponential Smoothing
3. ARIMA Models
ARIMA(p, d, q): AutoRegressive Integrated Moving Average
- p: Order of autoregression (AR)
- d: Degree of differencing
- q: Order of moving average (MA)
AR (AutoRegressive)
MA (Moving Average)
4. Temporal Cross-Validation
Critical: Never shuffle time series data! Use forward chaining (walk-forward validation).
5. Forecast Evaluation Metrics
Key Takeaways
✅ Time series has temporal dependencies – order matters!
✅ Components: Trend + Seasonality + Residual
✅ ARIMA models: Flexible framework for time series forecasting
✅ Temporal CV: Use forward chaining, never shuffle
✅ Metrics: MAE, RMSE, MAPE for forecast accuracy
What's Next?
Next lesson: Reinforcement Learning Introduction – agents, rewards, and learning optimal policies!
Further Reading
Interactive Visualizations
- Forecasting: Principles and Practice (3rd ed.) — Hyndman & Athanasopoulos. Free, open-access textbook with R companion. Run the code in your browser.
- Distill — Visual Information Theory — neighbor topic; deepens your intuition for residuals and entropy.
- Facebook NeuralProphet — Live Demo — interactive time-series notebooks combining classical decomposition with deep learning.
Video Tutorials
- StatQuest — Time Series Forecasting Series (Josh Starmer).
- Rob Hyndman — Forecasting Lectures — author of Forecasting: Principles and Practice.
Papers & Articles
- Forecasting at Scale (Prophet paper) — Taylor & Letham, Facebook 2017. The model behind
prophet. - N-BEATS: Neural Basis Expansion Analysis for Time Series Forecasting — Oreshkin et al., ICLR 2020. Strong neural baseline.
- Temporal Fusion Transformers for Interpretable Multi-horizon Time Series Forecasting — Lim et al., 2021. The state-of-the-art transformer for time series.
- Are Transformers Effective for Time Series Forecasting? — Zeng et al., AAAI 2023. The provocative paper that brought back simple linear baselines (
DLinear). - Chronos: Learning the Language of Time Series — Ansari et al., 2024. Foundation models for time series.
Documentation & Books
- Book: Forecasting: Principles and Practice — Hyndman & Athanasopoulos (free online).
- statsmodels — Time Series Analysis — Python's classical-stats workhorse.
- Nixtla
statsforecast,neuralforecast— modern, fast forecasting libraries. - Darts — unified Python API for classical + deep-learning time series models.