Quantitative Research · Machine Learning BCB · IBGE · SGS API
Inflation Forecasting

Brazilian Inflation
Forecast Models

Can a systematic, data-driven model outperform the Central Bank's forecast on Brazilian inflation? This project builds and evaluates four regularised machine learning models trained on over 100 macroeconomic indicators — benchmarking their accuracy against the Focus Report, the official market consensus compiled by the Central Bank of Brazil.

Results
📈
Main Results
  • Best models outperformed the market benchmark for Inflation, with higher prediction power (R²) and less error (MAE).
  • Models showed their greatest edge during inflationary shocks, capturing regime shifts faster than analysts' expectations.
  • Different weights proved critical for variable selection, with exchange rates, monetary dynamics, and lagged inflation components consistently driving forecasts.
  • Linear models outperformed non-linear alternatives (LSTM, Random Forest) for inflation prediction — consistent with the econometrics literature.
⚠️
Limitations & How They Were Addressed
  • Look-ahead & forward-looking bias A strict walk-forward backtest was implemented: models are retrained at every step using only past data, and feature transformations are selected using only the first training window.
  • Dealing with Heterogeneity & Data Transformations The 100+ raw series span different scales and frequencies. A per-feature transformation search normalised signal quality, and StandardScaler was applied within each rolling window.
  • Publication lags Demographic series (IBGE) are released with a delay of 1–2 months after the reference period. Each variable was assigned a structured lag to reflect its real-world availability.
Plotting Predictions Over Time

Select the model(s) you want to compare.

Models
Period
2010 now
CPI Monthly Forecast vs Actual
Month-on-month variation (%) · Walk-forward backtest
Loading data…
Project Overview
Motivation & Approach
Motivation

Inflation forecasting is central to monetary policy, fixed income pricing, and macroeconomic research. In Brazil, the Boletim Focus — a weekly survey of professional economists compiled by the Central Bank — is the dominant benchmark for near-term CPI expectations.

This project asks whether a systematic machine learning approach, trained on a broad set of leading macroeconomic indicators, can produce forecasts competitive with — or superior to — the professional consensus.

Approach

Four regularised linear models are trained on 100+ monthly series from the Central Bank of Brazil (BCB) and the Brazilian Institute of Geography and Statistics (IBGE) — covering inflation components, monetary aggregates, credit, fiscal balances, trade and activity indicators.

Each model is evaluated using a strict walk-forward backtest: the model is trained only on data available at the time of the forecast, eliminating any look-ahead bias. Performance is measured by Mean Absolute Error (MAE) against the realised CPI print.

Technical Details
Performance vs Benchmark
Loading…
Adaptive Lasso
MAE
RMSE
Loading…
Central Bank's Forecast (Market Consensus)
MAE
RMSE
Model MAE RMSE Obs.
Loading metrics…
📝 Other models tested: LSTM (Long Short-Term Memory), Ridge regression, CSR (Cross-Sectional Regression), and Random Forest were also evaluated during development. None produced results competitive with the regularised linear models presented here — likely due to the relatively short time series available, the high dimensionality of the feature space, and the structural instability of Brazilian macroeconomic data over the sample period. Their code remains available in the project notebooks.