Banque de France Bulletin

Nowcasting world trade in real time with machine learning

Published on 22 November 2023
Authors : Menzie Chinn , Baptiste Meunier, Sebastian Stumpner

Bulletin n°248, article 5. A key problem in economic assessment is that many time series arrive with long lags, posing a policy challenge. We address it for international trade in volumes by building a monthly “nowcast” (contemporaneous forecast). Using a dataset of 600 variables, our paper uses an innovative machine learning algorithm, the macroeconomic random forest – found to perform better than other linear and non-linear techniques. We employ a three-step approach composed of (i) variable pre-selection, (ii) factor extraction and (iii) machine learning regression. This approach delivers a substantially more accurate prediction compared to a Stock and Watson (2002) method based on factor extraction and OLS, with accuracy gains in between 15-30%. Compared to an autoregressive model, accuracy gains are around 30-40%. We illustrate the performance of the model during the Covid-19 pandemic.

Image Evolution of predictive accuracy (out-of-sample RMSE)
Evolution of predictive accuracy (out-of-sample RMSE)

1. Official trade data are published with delay

Real time economic analysis is often complicated by the fact that economic time series are published with significant lags. This is also the case for international trade: even though some countries publish data on trade in values quickly, trade in volumes is less timely. The Dutch Centraal Plan Bureau (CPB) issues estimates widely used among economists, but which are published roughly eight weeks after month end – meaning March data is available around 25 May. This poses a challenge from a policy perspective, as decisions should rely on timely information.

The delay in data availability is a particularly important problem in a fast changing economic environment. Recent years have witnessed several rapidly evolving crises, such as the 2020 Covid pandemic or Russia’s invasion of Ukraine since 2022. The goal of this project is to develop a tool that allows to accurately predict the evolution of world trade in volumes with no or very short delay, even during large crises episodes.

While official data are published with delay, numerous indicators are available in the meantime. The purpose of our recent paper (Chinn et al., 2023) is to exploit such information to provide advance estimates of trade in volumes. Given publication delays, the purpose is not only to predict trade for the current month t (“nowcasting”) but also in previous months (“back casting” at months t – 2 and t – 1 for which CPB data have not yet been released). We also “forecast” at t + 1 to assess the informative content of our method about future developments.

We identify 600 variables that provide timely information. To build our dataset, we screen through the literature on nowcasting trade, notably Keck et al. (2010), Guichard and Rusticelli (2011), Jakaitiene and Dees (2012), Bahroumi et al. (2016), Martinez Martin and Rusticelli (2021), Charles and Darné (2022). This provides variables covering different aspects of the trade outlook (e.g. customs data, shipping costs, freight traffic) and more broadly the macroeconomic outlook, both industrial activity (e.g. steel production) and households’ consumption (e.g. retail sales). Finally, commodity prices and financial indicators are included.

[To read more, please download the article]

Download the PDF version of this article

Updated on 12 April 2024