Where to start
Learn rolling-origin evaluation and penalised regression on a large macro panel first, since they show when many predictors beat a simple autoregression. Then learn how double machine learning places flexible models inside a causal estimate.
How machine learning is used in economics
Forecasting inflation, output and unemployment
Forecasters predict macroeconomic series from hundreds of monthly indicators. Regularised regression, random forests and boosting handle many correlated predictors, and every model is compared with an autoregressive benchmark.
Real example: How is machine learning useful for macroeconomic forecasting? (Goulet Coulombe et al.). Separated machine learning into four features, nonlinearity, regularisation, cross-validation and alternative loss functions, and tested which of them improve macroeconomic forecasts in data-rich and data-poor settings.
Nowcasting the current quarter
Official GDP figures arrive weeks after a quarter ends. Nowcasting models estimate the figure early from faster data such as surveys, prices and trade, updating as each release arrives.
Real example: Nowcasting GDP using machine-learning algorithms (Reserve Bank of New Zealand authors). Tested common machine learning algorithms on real-time vintages of New Zealand GDP growth and around 600 predictors, and found they improved on an autoregressive benchmark and a dynamic factor model.
Estimating causal effects with many controls
Double machine learning uses flexible models to predict the outcome and the treatment from many controls, then estimates the causal effect from what those predictions leave unexplained. It keeps valid standard errors while letting the controls enter nonlinearly.
Real example: Double/debiased machine learning (Chernozhukov et al.). Shows that plugging machine learning estimates directly into causal estimating equations introduces regularisation bias, and removes that bias by solving auxiliary prediction problems and splitting the sample.
Finding who benefits most from a policy
Average effects can hide large differences between groups. Causal forests estimate how a treatment effect varies with characteristics such as age, income or region, which helps target programmes.
Real example: Causal forests (Wager and Athey). Introduced causal forests, an extension of random forests that estimates heterogeneous treatment effects, with a practical method for building confidence intervals.
Measuring the economy from text
News, central bank statements and company reports can be turned into indicators of sentiment or uncertainty that arrive daily, long before official statistics.
Real example: Daily News Sentiment Index (Federal Reserve Bank of San Francisco). A high-frequency measure of economic sentiment based on lexical analysis of economics-related news articles, published and updated by the San Francisco Fed.
Can economists learn machine learning?
Yes. Economists already know regression, identification and inference, which covers much of what machine learning needs. Add Python, regularisation and cross-validation, then learn where prediction tools help causal work and where they do not.
- Python for economic data. Pull series from FRED or national statistics offices, align frequencies and keep track of data revisions with pandas. Taught in the Python track of Foundations of AI
- Statistics and inference. Regression, standard errors and hypothesis tests, which every machine learning based estimate in economics is still judged by. Taught in the Statistics track of Foundations of AI
- Prediction with regularisation and trees. Lasso, ridge, random forests and boosting, tuned with time-aware cross-validation and compared with an autoregressive benchmark. Taught in the Machine Learning track of Foundations of AI
- Causal machine learning. Double machine learning and causal forests, practised with the DoubleML or EconML libraries on a public programme evaluation dataset.
- Text as data. Turn reports and news into indicators with language models, and validate them against known events before using them in analysis. Covered by the Generative AI course (planned)
Moving into machine learning for economics
If you already work in the field
Economists and policy analysts already have econometrics, a feel for data quality and the habit of asking what a coefficient means. Add Python and the prediction toolkit, then rerun a forecast or evaluation you know well with a regularised or tree-based model alongside the original method.
If you come from data science or ML
Data scientists should learn identification, the difference between prediction and causal estimation, and how official statistics are revised. Mullainathan and Spiess's Journal of Economic Perspectives article and an applied econometrics text such as Angrist and Pischke are common starting points.
Roles that do this work: Research economistData scientist, economicsForecasting economistEconometricianApplied scientist, economics
Tools you will use
| Tool | What you use it for |
|---|---|
| statsmodels | Fit autoregressions, VARs and other econometric baselines with full inference output. |
| scikit-learn | Fit lasso, ridge and random forest forecasts on many macro predictors. |
| DoubleML | Estimate treatment effects with double machine learning and cross-fitting. |
| EconML | Estimate heterogeneous treatment effects, such as how a policy's effect varies across groups. |
| linearmodels | Fit panel, instrumental-variable and fixed-effects models common in applied economics. |
Public data to practise on
- FRED-MD and FRED-QD: Large monthly and quarterly panels of US macro indicators, prepared for forecasting and factor-model research.
- FRED (Federal Reserve Economic Data): Free economic time series from many sources, for building forecasting targets and predictors with release dates.
- NSW job-training data (Dehejia and Wahba): Versions of the LaLonde job-training experiment data, a standard benchmark for estimating a programme's effect on earnings.
Your first project
Download FRED-MD, forecast next-month industrial production growth with a lasso on lagged predictors, and compare it with an AR(1) baseline using out-of-sample RMSE from a rolling origin.
Keep the result, your code and a short note on what didn't work. That record is worth more than the score.