Deep Learning for Multi-Country GDP Prediction: A Study of Model Performance and Data Impact
Huaqing Xie Xingcheng Xu Fangjia Yan Xun Qian Yanqing Yang

	
	Low-Resolution Object Recognition with Cross-Resolution Relational Contrastive Distillation
    Kangkai Zhang,
        Shiming Ge, Senior Member, IEEE,
        Ruixin Shi,
        and Dan Zeng, Senior Member, IEEE
Kangkai Zhang is with the Institute of Information Engineering, Chinese Academy of Sciences, Beijing 100084, China, and with Baidu Inc., Beijing 100080, China. Email: zhangkangkai99@gmail.com.
Shiming Ge and Ruixin Shi are with the Institute of Information Engineering, Chinese Academy of Sciences, Beijing 100084, China, and with School of Cyber Security at University of Chinese Academy of Sciences, Beijing 100049, China. Email: {geshiming, shiruixin}@iie.ac.cn.
Dan Zeng is with the Department of Communication Engineering, Shanghai
University, Shanghai 200040, China. E-mail: dzeng@shu.edu.cn.
Shiming Ge is the responding author. Email: geshiming@iie.ac.cn.
    
=================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================

§ ABSTRACT 
GDP is a vital measure of a country's economic health, reflecting the total value of goods and services produced. Forecasting GDP growth is essential for economic planning, as it helps governments, businesses, and investors anticipate trends, make informed decisions, and promote stability and growth. While most previous works focus on the prediction of the GDP growth rate for a single country or by machine learning methods, in this paper we give a comprehensive study on the GDP growth forecasting in the multi-country scenario by deep learning algorithms. For the prediction of the GDP growth where only GDP growth values are used, linear regression is generally better than deep learning algorithms. However, for the regression and the prediction of the GDP growth with selected economic indicators, deep learning algorithms could be superior to linear regression. We also investigate the influence of the novel data – the light intensity data on the prediction of the GDP growth, and numerical experiments indicate that they do not necessarily improve the prediction performance. Code is provided at https://github.com/Sariel2018/Multi-Country-GDP-Prediction.git. 

	






§ INTRODUCTION


Gross Domestic Product (GDP) is a critical measure of a country's economic health, reflecting the total value of all goods and services produced over a specific period. It serves as a comprehensive indicator of a nation's economic activity, influencing government policy, investment decisions, and international comparisons. GDP is a key metric for assessing economic performance, guiding fiscal and monetary policy, and shaping economic development strategies.

Forecasting GDP growth rate is crucial for economic planning and decision-making. It provides valuable insights into the future direction of an economy, helping governments, businesses, and investors make informed decisions. Accurate GDP growth predictions allow policymakers to anticipate economic trends, adjust fiscal and monetary policies accordingly, and implement measures to promote stability and growth. For businesses, understanding expected economic conditions helps in strategic planning, resource allocation, and risk management. Investors rely on GDP growth forecasts to assess market conditions and make investment choices. Thus, GDP growth rate predictions are essential for shaping economic strategies and fostering sustainable development.



Machine learning has advanced GDP forecasting by building on Dynamic Factor Models (DFMs), first applied by <cit.> for real-time GDP forecasting, influencing Federal Reserve policy. Central banks like the ECB <cit.> and institutions such as the World Bank <cit.> have since adopted similar models.

The integration of machine learning has further enhanced forecasting accuracy. <cit.> showed that a machine learning model using over 600 variables outperformed traditional AR and DFM models in forecasting New Zealand's GDP, particularly during the COVID-19 pandemic. <cit.> also found that machine learning models using Google data significantly improved GDP growth rate forecasts for OECD countries. <cit.> highlighted these benefits by applying machine learning models like gradient boosting trees, random forests, and kernel ridge regression to forecast China's GDP, demonstrating their superior performance over traditional methods.



There are many works on the prediction of GDP growth by deep learning methods as well. In <cit.>, four key economic indicators were utilized to predict Indonesia's quarterly GDP growth using Multiple Linear Regression (MLR), K-Nearest Neighbours (K-NN), and Artificial Neural Network (ANN) models, with MLR outperforming the others based on RMSE values. Similarly, <cit.> employed ANN regression models to forecast GDP growth rates of 15 industrialized economies between 1996 and 2016, demonstrating that ANN provided more accurate and flexible predictions compared to linear models, especially in capturing time trends. In <cit.>, various models, including SARIMA, Holt-Winters, dynamic linear models, and neural networks, were compared for Brazilian GDP forecasting. The Multilayer Perceptron (MLP) outperformed others in both in-sample and out-sample predictions, effectively capturing GDP growth rates.

To address both linear and nonlinear components in GDP forecasting, <cit.> introduced hybrid models combining ARIMA and ANN techniques for Nepal's GDP prediction, where the hybrid models achieved superior accuracy over standalone approaches. Focusing on deep learning methods, <cit.> applied Long Short-Term Memory (LSTM) and Recurrent Neural Network (RNN) architectures to predict Indonesia's GDP fluctuations during the COVID-19 pandemic, achieving accuracy rates between 80% and 90%, thus highlighting their effectiveness in handling sudden economic changes.

In <cit.>, autoregressive deep learning networks were developed to model Türkiye's GDP and per capita income from 1960 to 2021 using past values of the target variables, resulting in high accuracy as evidenced by performance metrics like R^2, MAE, MAPE, and RMSE. Exploring machine learning algorithms further, <cit.> conducted a comprehensive comparison between models such as BART, GLMNET, GBM, and XGBoost against traditional time series methods like ARIMA and VAR across multiple economies, concluding that multivariate VAR models were generally superior, though XGBoost provided valuable insights by emphasizing different influential variables.

For scenarios with limited data, <cit.> demonstrated that K-Nearest Neighbour regression could effectively predict Indonesia's GDP during the 1998 economic crisis, outperforming both backpropagation neural networks and MLR models. Addressing variable selection, <cit.> utilized stepwise regression techniques on 14 sub-sectors of Pakistan's economy to construct an appropriate time series model for GDP growth prediction, resulting in a model with nine significant predictors validated through various diagnostic tests.

<cit.> applied a multi-layer ANN model to forecast the COVID-19 pandemic's impact on the GDP of eight major economies for the April–June 2020 quarter, achieving forecasting errors of less than 2% and revealing substantial GDP declines necessitating urgent policy responses. In <cit.>, a novel multimodal approach combined historical GDP data with Twitter activity using a two-stage architecture involving a multi-task autoencoder and a multimodal network, providing timely and accurate regional GDP predictions in Spain and effectively capturing the economic effects of the COVID-19 pandemic.

Among these works, most of them aimed to predict the GDP growth rates of one single country. For the multi-country case, <cit.>, <cit.>, and <cit.> adopted machine learning algorithms, while <cit.> and <cit.> predicted the GDP growth by MLP, but only previous GDP growth rates were used there. 


There are also some works on the time series forecasting. Some of them are the variants of the Transformer model, such as Informer <cit.>, Autoformer <cit.>, FEDformer <cit.>, PatchTST <cit.> et al. There are also some time series forecasting works based on large language models (LLMs). For instance, LLMTime <cit.>, Time-LLM <cit.>, GPT4TS <cit.>. There are also some foundation models for time series forecasting which are pretrained on a large corpus of time series data, such as Lag-Llama <cit.>, TimesFM <cit.>, Chronos <cit.>, and UniTS <cit.>. 

In this paper, we study the prediction of GDP growth in the multi-country regime by deep learning algorithms with multiple economic indicators and novel data. We propose the representation transformer model for the regression of the GDP growth which is a combination of representation in LLM and transformer. For the regression of the annually GDP growth, MLP has
comparable performance with linear regression, but for the regression of the quarterly GDP growth, MLP is better than the linear regression. For the regression of the annually GDP growth, representation transformer is worse than MLP. However, representation transformer can deal with the case where the number of economic indicators of data is variable, while MLP and linear regression could not. 

For the prediction of the quarterly GDP growth by autoregression where only GDP growth values are used, with filtered data by some selected economic indicators, LSTM has comparable performance with linear regression. But  linear regression is better than LSTM for all GDP growth data. TimeFM,Time-LLM, and PatchTST are generally worse than linear regression. 

For the prediction of the quarterly GDP growth with multi-indicator data, LSTM is generally better than linear regression. Time-LLM and PatchTST are actually comparable and are both better than LSTM generally, but they actually could not characterize the impacts of these economic indicators during the inference time. 

In all cases, the light intensity data do not necessarily improve the prediction performance.






§ PROBLEM FORMULATION


Denote the economic indicator at time t as x_i^t ∈, and the GDP growth at time t as y^t. There are two regimes for the prediction of GDP growth rate. One is using { x_i^t }_i=1^n to predict y^t, which is also called regression. The other is predicting the GDP growth y^t by previous economic indicators x_i^k and/or previous GDP growth y^k for k<t. 

In this paper, we consider these two regimes respectively. In Section  <ref>, we study the regression of both annually and quarterly GDP growth. In Section <ref>, we study the prediction of the quarterly GDP growth y^t by using (y^t-h, ..., y^t-1), where h is the sequence length. Denote 

    z^t  (x_1^t, ..., x_n^t, y^t)^⊤∈^n+1.

In Section <ref>, we study the prediction of the quarterly GDP growth y^t by utilizing (z^t-h, ..., z^t-1). In all these cases, we also study the influence of the novel data – the light intensity. The nighttime lights data is derived from monthly night-time remote sensing images captured by the Visible Infrared Imaging Radiometer Suite (VIIRS) onboard the NPP satellite. This data has a spatial resolution of 0.004 degrees and covers the period from the launch of the NPP satellite in 2012 to the present. The data has undergone stray light correction, which allows for an accurate representation of temporal changes in local lighting brightness. Nighttime lights data encompasses comprehensive information such as population, transportation, and economic development levels, making it suitable for various development economics research. The raw data is stored in the widely used GeoTIFF format for geographic information and is converted to brightness values using the Rasterio library of Python.


For all the experiments, we divide the train and test sets by time. The test set for the period 2013–2019 consists of the data in the last year, and for the other periods consists of the data of the last two years. For all the deep learning algorithms, we use k-fold cross-validation method and get two checkpoints. One checkpoint is the best validation checkpoint, which is the best of the k checkpoints with the best average validation loss. The other checkpoint is the checkpoint which is trained on the full train set with all the hyperparameters used by the best validation checkpoint. We use k=5 in this paper. For all the deep learning algorithms, we search the best hyperparameters by grid search. For all models, the input data are normalized by the minimum and maximum values of the train and test sets. 





§ REGRESSION FOR THE GDP GROWTH


In this section, we study the regression for the annually and quarterly GDP growth, i.e., predicting y^t by (x_1^t, ..., x_n^t). We first describe the data we used. 

Based on the 2023 GDP rankings from the World Bank, we selected 21 countries: the United States, China, Germany, Japan, India, the United Kingdom, France, Brazil, Italy, Canada, Russia, Mexico, Australia, South Korea, Spain, Indonesia, the Netherlands, Turkey, Saudi Arabia, Switzerland, and Poland.

We manually selected 13 annual economic indicators from the WEO database of the IMF. These indicators are: `Rural population growth (annual %)', `General government final consumption expenditure (annual % growth)', `Consumer price index (2010 = 100)', `Exports of goods and services (annual % growth)', `Urban population growth (annual %)', `GDP growth (annual %)', `Population growth (annual %)', `Inflation, GDP deflator (annual %)', `Imports of goods and services (annual % growth)', `Final consumption expenditure (annual % growth)', `Unemployment, total (% of total labor force) (national estimate)', `Inflation, consumer prices (annual %)', `Gross fixed capital formation (annual % growth)' and `Households and NPISHs Final consumption expenditure (annual % growth)'.

For the quarterly data, we selected 20 economic indicators, including `Export Value', `Industrial Added Value', `Stock Market Capitalization', `Balance of Payments - Financial Account Balance', `Balance of Payments - Current Account Balance', `Balance of Payments - Current Account Credit', `Balance of Payments - Current Account Debit', `Balance of Payments - Capital Account Balance', `Balance of Payments - Capital Account Credit', `Balance of Payments - Capital Account Debit', `Overall Balance of Payments', `International Investment Position - Assets', `International Investment Position - Liabilities', `Net International Investment Position', `Import Value', `Nominal Effective Exchange Rate', `Retail Sales', `CPI (Consumer Price Index)', `Unemployment Rate' and `Central Bank Policy Rate'. The data was sourced from the financial institution WIND, with the original sources traceable to the World Bank, IMF, and national statistical offices.


We use there models for the regression of the GDP growth rate, i.e., the linear regression, MLP, and representation transformer(RT). We introduce the representation transformer model next. 




  
Representation Transformer.
Large language models have significant influence in the field of artificial intelligence since the emergence of ChatGPT <cit.>. LLMs can provide good representations for the text. For the limited data in the prediction of the GDP growth, the information contained in the meaning of variable names could be used by the adoption of LLMs. Hence, we first write a description for every selected economic indicator, and then input the text description into a LLM to get a representation vector. Since the representation by LLMs is usually a high dimensional vector, we use a projection layer to reduce the dimension. Then we also concatenate the value of the corresponding variable with multiple times to the projected vector. At last, we use transformer <cit.> to obtain the predicted GDP growth. The detailed neural network architecture of RT is described as follows. 

For each economic indicator x_i^t, we write a text description Text_i^t and input it to the InternVL-Chat-V1-5[https://huggingface.co/OpenGVLab/InternVL-Chat-V1-5. We use VLM since it can handle images as well in case we may need to deal with vision data.] model, whose dimension of representation vectors is 6144. For instance, the description for `Exports of goods and services' is: The index “Volume of exports of goods and services" with the unit “Percent change" measures the percentage change in the quantity of goods and services that a country sells to other nations over a specific period, usually a year, compared to the previous period. In this year, the index is {value} percent change. The “{value}" in the description is replaced by x_i^t. The descriptions of all the economic indicators are in the Appendix. We choose the representation vector of the last token in Text_i^t before the last fully-connected layer as Rep_i^t. Then, 

    v_i^t    =    W_1 Rep_i^t + b_1,
     
    u_i^t    =    (x_i^t, ..., x_i^t)^⊤∈^dim, 
     
    c_i^t    =    concat(v_i^t, u_i^t) + PositionEmbedding, 
     
    (o_1^t, ..., o_n^t)      =    TransformerEncoder(c_1^t, ..., c_n^t), 
     
    O^t    =    mean(o_1^t, ..., o_n^t), 
    
    y^t    =    W_2 O^t + b_2,

where dim is a hyperparameter. 

The regression of the GDP growth rates for linear regression, MLP, and RT are in Tables <ref> and <ref>. For the light column, × denotes the light intensity data were not used. The “sum" refers to the total light intensity of all pixels within a specific country or region. The “mean" indicates the average light intensity, while the “std" represents the standard deviation of light intensity values. For each time period, we calculate the average values of these light indicators. Therefore, “every month mean" refers to the average light intensity for every month. 














From Table <ref>, we can see that for the regression of the annually GDP growth,  MLP has comparable results with linear regression, but for the regression of the quarterly GDP growth, MLP is better than the linear regression. Furthermore, the usage of the light intensity data do not always make the results better. Table <ref> shows that for the regression of the annually GDP growth, representation transformer is worse than MLP.  However, representation transformer can deal with the case where the number of economic indicators of data is variable, while MLP and linear regression could not. Moreover, the performance of RT could be improved by the development of LLMs, and by finetuning the part at the beginning of the LLM like Time-LLM <cit.>, which could be future work. 








§ PREDICTION OF THE QUARTERLY GDP GROWTH BY AUTOREGRESSION




In this section, we predict the quarterly GDP growth y^t by previous GDP growth rates (y^t-h, ..., y^t-1). For the period between 2013 and 2019, we also add the light intensity dimension to investigate the influence of the light data. We use five models in this section, i.e., linear regression, LSTM, TimesFM <cit.>, Time-LLM[We use GPT-2 for the LLM in Time-LLM in our experiments.] <cit.>, and PatchTST <cit.>. For the GDP growth sequence data, we consider two scenarios. The first scenario involves directly using the GDP data from the multidimensional dataset, which allows for comparison with the results obtained using multidimensional data. The second scenario involves using all historical GDP data to capture the cyclical changes and long-term trends inherent in GDP itself. Due to the availability of data from other dimensions, the data used in the first scenario is a subset of the data used in the second scenario. When the light data are used, the data type is actually the same as that in Section <ref>, and the setups are the same as that in Section <ref> as well. For simplicity, we omit the setups here. 






Table <ref> shows the prediction of the quarterly GDP growth results for linear regression and LSTM. We can see that for the first scenario, LSTM has comparable performance with linear regression, but linear regression is better than LSTM in the second scenario. Table <ref> is the performance of TimesFM by zero shot. TimesFM works for the univariable time series, hence the light data were not used. In the data type column, “LSTM data" refers to using the data LSTM used as the input. “Continuous data" refers to using all historical data before the label as the input. We can see that in all cases, TimesFM works best with all historical data before the label, but it is still worse than linear regression. 









Table <ref> shows the prediction of the quarterly GDP growth results for Time-LLM and PatchTST. We can see that generally Time-LLM and PatchTST are worse than linear regression. Tables <ref>, <ref>, and <ref> also show that the light data do not necessarily improve the prediction performance. 















§ PREDICTION OF THE QUARTERLY GDP GROWTH WITH MULTI-INDICATOR DATA



In Section <ref>, we predict the quarterly GDP growth by autoregression, but models there could not characterize the impacts of previous economic indicators on GDP growth. Hence, in this section, we predict the quarterly GDP growth by previous economic indicators, i.e., predict y^t by (z^t-h, ..., z^t-1), where z^i is defined in (<ref>). We use four models in this section, i.e., linear regression, LSTM, Time-LLM <cit.>, and PatchTST <cit.>. For linear regression, LSTM, and PatchTST, we actually predict z^t by vector autoregression. Since the goal is predicting y^t, hence we give more weight to the GDP growth in the loss function for LSTM and PatchTST. The loss function actually has the following form 

    f_loss = ∑_i=1^n (x_i^t - x̂_i^t)^2 + W_GDP (y^t - ŷ^t)^2,

where (x̂_1^t, ..., x̂_i^t, ŷ^t) is the prediction for z^t and W_GDP > 0 is the weight for the GDP growth which is a hyperparameter. For the validation loss for LSTM, Time-LLM, and PatchTST, we only calculate the GDP growth part. 







Table <ref> shows the prediction of the quarterly GDP growth with multi-indicator data results for linear regression and LSTM. It indicates that LSTM is generally better than linear regression in the multi-indicator case. 








Table <ref> shows the prediction of the quarterly GDP growth with multi-indicator data results for Time-LLM and PatchTST. They are actually comparable and are both better than LSTM generally. It should be noticed that, Time-LLM deals with each channel independently and PatchTST has an individual head for each channel and also deal with each channel independently, hence they actually could not characterize the impacts of economic indicators during the inference phase. Tables <ref> and <ref> also indicate that the light data do not necessarily improve the prediction performance. 


















	









	
	unsrtnat
	
	
	
	
	
		
		
	

PART: 
*Appendix
	
	
	
	
	
	

§ DESCRIPTIONS USED BY RT AND TIME-LLM


 


	


















	
		
	
	
	
	
	
	

