Education, Science, Technology, Innovation and Life
Open Access
Sign In

A Machine Learning–Augmented Gravity Model for Predicting Bilateral Trade Flows

Download as PDF

DOI: 10.23977/infse.2025.060305 | Downloads: 2 | Views: 90

Author(s)

Jiacheng Mao 1

Affiliation(s)

1 School of Economics, Heilongjiang University of Finance and Economics, Harbin, Heilongjiang, China

Corresponding Author

Jiacheng Mao

ABSTRACT

Accurate prediction of bilateral trade flows is crucial for trade policy design, export risk management, and firms' international market strategies. Traditional gravity models, typically estimated by ordinary least squares or Poisson pseudo–maximum likelihood, impose linear functional forms and struggle to capture complex nonlinear interactions among macroeconomic fundamentals, trade policies, and historical trade dynamics. This paper proposes a machine learning–augmented gravity framework that integrates standard gravity variables—such as GDP, geographic distance, population, exchange rates, tariffs, and free trade agreements—with high-capacity predictive models including Random Forests, XGBoost, and fully connected neural networks. A unified data preprocessing and feature engineering pipeline is developed to handle panel data of bilateral trade, including treatment of zero trade flows, construction of lagged trade indicators, normalization of heterogeneous features, and time-aware train–test splitting. The models are evaluated using root mean squared error, mean absolute error, and out-of-sample R2, with a classical gravity regression serving as the baseline. Experimental results on multi-year bilateral trade data show that the proposed machine learning models consistently outperform the traditional gravity specification in predictive accuracy, particularly for country pairs with volatile or rapidly changing trade patterns. Furthermore, model interpretation techniques based on permutation importance and SHAP values reveal that machine learning not only preserves core gravity insights—such as the positive role of economic size and the negative role of distance—but also uncovers nonlinear effects and interaction patterns involving tariffs, trade agreements, and exchange rate fluctuations. These findings suggest that machine learning–enhanced gravity models provide a promising tool for international economics and trade forecasting.

KEYWORDS

International Trade; Bilateral Trade Flows; Gravity Model; Machine Learning; Xgboost; Neural Networks

CITE THIS PAPER

Jiacheng Mao, A Machine Learning–Augmented Gravity Model for Predicting Bilateral Trade Flows. Information Systems and Economics (2025) Vol. 6: 41-53. DOI: http://dx.doi.org/10.23977/infse.2025.060305.

REFERENCES

[1] Leitão N C. Gravity model and international trade: A survey of the literature[J]. Administrative Sciences, 14(9): 219, 2024. DOI: 10.3390/admsci14090219.
[2] Rincon-Yanez D, Ounoughi C, Sellami B, Kalvet T, Tiits M, Senatore S, Ben Yahia S. Accurate prediction of international trade flows: Leveraging knowledge graphs and their embeddings[J]. Journal of King Saud University – Computer and Information Sciences, 35(3): 101789, 2023. DOI: 10.1016/j.jksuci.2023.101789.
[3] Tiits M, Kalvet T, Ounoughi C, Ben Yahia S. Relatedness and product complexity meet gravity models of international trade[J]. Journal of Open Innovation: Technology, Market, and Complexity, 10(2): 100288, 2024. DOI: 10.1016/j. joitmc. 2024.100288.
[4] Sellami B, Ounoughi C, Kalvet T, Tiits M, Rincon-Yanez D. Harnessing graph neural networks to predict international trade flows[J]. Big Data and Cognitive Computing, 8(6): 65, 2024. DOI: 10.3390/bdcc8060065.
[5] Jošić H, Žmuk B. A machine learning approach to forecast international trade: The case of Croatia[J]. Business Systems Research, 13(3): 142–157, 2022. DOI: 10.2478/bsrj-2022-0030.
[6] Morland C, Tandetzki J, Schier F. An evaluation of gravity models and artificial neuronal networks on bilateral trade flows in wood markets[J]. Forest Policy and Economics, 172: 103457, 2025. DOI: 10.1016/j.forpol.2025.103457.
[7] Weidner M, Zylkin T. Bias and consistency in three-way gravity models[J]. Journal of International Economics, 132: 103513, 2021.
[8] Felbermayr G, Heid B, Larch M, Yotov Y V. A solution to the mystery of the excess trade balances[J]. European Economic Review, 137: 103786, 2021.
[9] Brynjolfsson E, Hui X, Liu M. Does machine translation affect international trade? Evidence from a large digital platform[J]. Management Science, 65(12): 5449–5460, 2019.
[10] Gulzar Y, Oral C, Kayakuş M, Erdoğan D, et al. Predicting high technology exports of countries for sustainable economic growth by using machine learning techniques: The case of Turkey[J]. Sustainability, 16(13): 5601, 2024.
[11] Gómez A C, Bejarano L A, Espitia H E. Artificial neural network model to predict the exportation of traditional products of Colombia[J]. Computation, 12(11): 221, 2024.
[12] Suler P, Rowland Z, Krulický T. Evaluation of the accuracy of machine learning predictions of the Czech Republic's exports to China[J]. Journal of Risk and Financial Management, 14(3): 76, 2021.
[13] Dai C. A method of forecasting trade export volume based on back-propagation neural network[J]. Neural Computing and Applications, 35: 8775–8784, 2023.
[14] Bin J, Tianli X. Forecast of export demand based on artificial neural network and fuzzy system theory[J]. Journal of Intelligent & Fuzzy Systems, 39(2): 1701–1709, 2020.
[15] Gopinath M, Nalluru G, Beckman J, Batarseh F A. International agricultural trade forecasting using machine learning[J]. Data & Policy, 3: e21, 2021.
[16] Tong Y. Literature review in international trade forecasting based on machine learning[C]. SHS Web of Conferences, 163: 02020, 2023.
[17] Saka U M, Habel C, Wittmer J. Analysis of world trade data with machine learning to enhance policies of mineral supply chain transparency[J]. Resources Policy, 89: 104207, 2024.
[18] Kummaraka U, Srisuradetchai P. Time-series interval forecasting with dual-output Monte Carlo dropout: A case study on durian exports[J]. Forecasting, 6(4): 616–636, 2024.
[19] Liu D. Spatial–temporal analysis of the international trade network based on graph neural networks[J]. Geo-spatial Information Science, (early access), 2025.
[20] Rincon-Yanez D, Sellami B, Tiits M, Kalvet T. A complement graph-based approach applied to bilateral trade[J]. Procedia Computer Science, 219: 540–547, 2023.
[21] Nelson C, Unger S. Machine learning for detection of trade in strategic goods: An approach to support future customs enforcement and outreach[J]. World Customs Journal, 13(2): 3–26, 2019.
[22] Agrawal A K, Gans J S, Goldfarb A. Exploring the impact of artificial intelligence: Prediction versus judgment[J]. Information Economics and Policy, 47: 1–6, 2019. DOI: 10.1016/j.infoecopol.2019.05.001.
[23] Breiman L. Random forests[J]. Machine Learning, 45(1): 5–32, 2001.
[24] Chen T, Guestrin C. XGBoost: A scalable tree boosting system[C]. Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, 785–794, 2016.
[25] Kingma D P, Ba J. Adam: A method for stochastic optimization[C]. International Conference on Learning Representations, 2015.
[26] Lundberg S M, Lee S I. A unified approach to interpreting model predictions[C]. Advances in Neural Information Processing Systems, 30: 4765–4774, 2017.

Downloads: 21038
Visits: 562724

All published work is licensed under a Creative Commons Attribution 4.0 International License.

Copyright © 2016 - 2031 Clausius Scientific Press Inc. All Rights Reserved.