Predicting Real GDP Growth Using Machine Learning Models: Random Forest vs. XGBoost
Objective:
To predict cross-country real GDP growth rates based on macroeconomic indicators.
To explore the effectiveness of machine learning approaches as an alternative to traditional economic models.
Data
Data Sources:
World Bank World Development Indicators
Time Period and Coverage:
Years: 1991–2023
Countries: Over 30 countries (adjust depending on the actual number)
Key Variables:
Inflation rate
Unemployment rate
Government expenditure-to-GDP ratio
Trade openness ((exports + imports)/GDP)
Private sector credit growth
Models and Methodology
Random Forest (ntree = 100)
XGBoost (nrounds = 50, objective = "reg:squarederror")
Evaluation Metric: Mean Squared Error (MSE)
Results
Model Performance Comparison (MSE):
Random Forest: 5.1183
XGBoost: 5.5995
Random Forest achieved slightly better prediction accuracy than XGBoost.
Actual vs Predicted GDP Growth Plots:
Random Forest:
Predicted values aligned closely with the 45-degree ideal line, indicating strong predictive accuracy.