Finance and economics
Machine learning for economics
Economists use machine learning to forecast inflation, output and unemployment from hundreds of indicators, to nowcast the current quarter before official figures arrive, and to estimate treatment effects with double machine learning. Forecasting and causal estimation are different targets with different checks.
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 exampleHow 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 exampleNowcasting 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 exampleDouble/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 exampleCausal 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 exampleDaily 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 dataPull series from FRED or national statistics offices, align frequencies and keep track of data revisions with pandas.Learn it in Python
- Statistics and inferenceRegression, standard errors and hypothesis tests, which every machine learning based estimate in economics is still judged by.Learn it in Statistics
- Prediction with regularisation and treesLasso, ridge, random forests and boosting, tuned with time-aware cross-validation and compared with an autoregressive benchmark.Learn it in Machine Learning
- Causal machine learningDouble machine learning and causal forests, practised with the DoubleML or EconML libraries on a public programme evaluation dataset.
- Text as dataTurn reports and news into indicators with language models, and validate them against known events before using them in analysis.Learn it in Generative AI
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 workResearch 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.
Common questions
How is machine learning different from econometrics?
Machine learning is built to predict outcomes well on new data, while econometrics usually aims to estimate a parameter, such as an elasticity or a treatment effect, with valid uncertainty. The two now overlap, for example in double machine learning, which uses prediction models inside a causal estimator.
Do economists use machine learning?
Yes. Central banks use it for forecasting and nowcasting, academic economists use it for causal inference and text analysis, and technology firms hire economists to run experiments and pricing studies. It complements economic theory and econometrics rather than replacing them.
Can machine learning do causal inference?
It helps when it estimates the nuisance parts of a model, such as how treatment depends on many controls, inside a research design that is already credible. It cannot fix weak identification, so the design comes first.
What is nowcasting?
Nowcasting estimates the current or just-finished quarter of an indicator such as GDP before the official figure is published, using faster data such as surveys, payments and financial prices. Machine learning models are one option alongside dynamic factor models.
Courses for these skills
- Practical Machine Learning in PythonFit outcome predictors without contaminating the experiment estimate.51 published lessons · more lessons in production
- Data Tools: NumPy, pandas, Matplotlib and scikit-learnAlign observation dates, releases and feature tables.23 published lessons · all planned lessons open
- Statistics and Probability for Machine LearningUnderstand randomisation, variance and confidence intervals.41 published lessons · all planned lessons open
New to programming or maths? Start with Python, or follow the machine learning path in order. Published lessons are free to read; compare Free and Pro.