A hands-on Python example showing how to build a momentum-based economic forecast using ARIMA (AutoRegressive Integrated Moving Average) time-series models for key macroeconomic variables.
This repository accompanies the blog post:
How to Create a Big-Picture Economic Forecast Using Time-Series (ARIMA) Models in Python
While structural regression models tell us why spending changes, time-series models like ARIMA tell us where the individual economic drivers are headed based on their own internal momentum.
This project demonstrates how to:
- Use ARIMA to forecast the "Big Five" economic variables: GDP/Income, Inflation, Unemployment, Sentiment, and Interest Rates.
- Automate parameter tuning (p, d, q) for multiple time series using
pmdarima. - Bridge the gap between statistical momentum and institutional consensus (Goldman Sachs, CBO, etc.).
- Generate objective, data-driven inputs to power secondary regression models.
The goal is to move from subjective guesswork to Scenario Intelligence.
- Pulls historical macroeconomic data directly from the Federal Reserve (FRED) API.
- Conducts stationarity testing (ADF) and automated data transformation.
- Iteratively fits and optimizes ARIMA models for five distinct economic indicators.
- Compares pure statistical "momentum" forecasts against professional institutional consensus.
- Visualizes the "Momentum Gap" using a consolidated dashboard of fan plots.
Conceptually, ARIMA ignores external "causes" and focuses strictly on the pattern of the data itself. It identifies the economy's "DNA" by analyzing three components:
- AR (Autoregression): The relationship between an observation and a specific number of lagged (past) observations.
- I (Integrated): The differencing of raw observations to make the time series "stationary" (stable mean/variance).
- MA (Moving Average): The dependency between an observation and a residual error from a moving average model applied to lagged observations.
By forecasting the "Big Five" variables independently, we create a statistically sound baseline for 2026 that can be used as a standalone forecast or as the validated input for more complex structural models.
economic_forecast_using_ARIMA_ver3.ipynb: The main notebook containing the data pipeline, ARIMA optimization, and visualization dashboard.economic_data_snapshot.csv: The "Time Capsule" dataset used for the analysis in the blog post.README.mdLICENSE
This analysis was originally generated on January 10, 2026.
Because this project relies on live economic data from the Federal Reserve (FRED), results generated in the future may differ slightly due to official government data revisions and updates.
- Live Mode (Default): The notebook is set to query the FRED API for the most current data.
- Static Mode (Reproducible): To reproduce the exact results and the "Momentum Gap" dashboard found in the article, load the provided
economic_data_snapshot.csvfile.
- Clone the repository using your preferred Git client.
- Install the necessary Python dependencies: pandas, matplotlib, statsmodels, pmdarima, and fredapi.
- Launch your Jupyter environment.
- Open the
economic_forecast_using_ARIMA_ver3.ipynbfile.
Click the "Open in Colab" badge at the top of this README to run the code in a cloud environment with no local setup required.
This project is the second part of a series on DIY econometrics. If you are interested in how these ARIMA forecasts can be used to predict consumer behavior, check out the first project:
MIT License. See LICENSE for more details.