In a recent WSJ editorial, Bill & Melinda Gates predicted that there would be “almost no poor countries” left by 2035. “Poor” is an essentially relative concept, but let's use the World Bank's classification. “Poor” countries have GDP per capita of less than $1035, and “lower middle” countries have GDP per capita between $1035 and $4085 (in 2012 dollars). Let's see if a simple time series forecasting model agrees with the Gates' prediction. First, we grab the Penn World Tables data using the pwt library.
require(forecast)
## Loading required package: forecast
## This is forecast 4.8
require(pwt8)
## Loading required package: pwt8
require(ggplot2)
## Loading required package: ggplot2
library(plyr)
# Add PWT data to global environment
data("pwt8.0")
# Calculate RGDP per cap.
pwt8.0$gdppc <- pwt8.0$rgdpe/pwt8.0$pop
countries <- unique(as.character(pwt8.0$country))
Then, we need to generate forecasts for future GDP for each country in the PWT. A large literature on economic forecasting suggests that relatively simple ARIMA models forecast much better than structural or more complicated multivariate models. In keeping with this, we'll use the forecast library to estimate ARIMA models for each country using the auto.arima function (this will select the “best” model according to the Akaike Information Criterion). Using these, we forecast out to 2035 (that is to say, 24 periods).
forecast2035 <- function(data, fraction = 1/length(data[, 1]), result = "last") {
n <- length(data[, 1])
# Fit an ARIMA(p,d,q) for each country automatically (via AIC selection),
# using last (1-fraction) of sample only
data <- data[as.integer(fraction * n):n, ]
fit.temp <- auto.arima(data$gdppc, ic = "aicc")
# forecast out to 2035 (24 years, since PWT only goes to 2011)
forecast.temp <- forecast(fit.temp, 24)$mean
if (result == "last") {
return(forecast.temp[24])
} else if (result == "full") {
return(as.numeric(forecast.temp))
}
}
# For example, let's see what the forecast for Argentina's GDPPC in 2035
forecast2035(pwt8.0[which(pwt8.0$country == "Argentina"), ])
## [1] 24177
GDP <- sapply(countries, function(x) forecast2035(pwt8.0[which(pwt8.0$country ==
x), ], fraction = 0.5))
GDP.2035 <- data.frame(countries, GDP, year = rep(2035, length(GDP)))
GDP.2011 <- data.frame(countries = pwt8.0[which(pwt8.0$year == 2011), ]$country,
GDP = pwt8.0[which(pwt8.0$year == 2011), ]$gdppc, year = rep(2011, length(GDP)))
GDP.combined <- rbind(GDP.2011, GDP.2035)
Now, let's compare the forecasted distribution of countries in 2035 to the actual in 2011.
# 2011 vs. 2035 counts of World Bank categories print('Low')
c(length(GDP.2011[which(GDP.2011$GDP <= 1035), ]$GDP), length(GDP.2035[which(GDP.2035$GDP <=
1035), ]$GDP))
## [1] 15 15
# print('Mid-Low')
c(length(GDP.2011[which(GDP.2011$GDP > 1035 & GDP.2011$GDP < 4085), ]$GDP),
length(GDP.2035[which(GDP.2035$GDP > 1035 & GDP.2035$GDP < 4085), ]$GDP))
## [1] 36 28
# print('Middle')
c(length(GDP.2011[which(GDP.2011$GDP > 4085 & GDP.2011$GDP < 12615), ]$GDP),
length(GDP.2035[which(GDP.2035$GDP > 4085 & GDP.2035$GDP < 12615), ]$GDP))
## [1] 52 43
# print('High')
c(length(GDP.2011[which(GDP.2011$GDP > 12615), ]$GDP), length(GDP.2035[which(GDP.2035$GDP >
12615), ]$GDP))
## [1] 64 81
So, we can see that there are slightly fewer poor and lower-middle countries in 2035, and quite a few more rich countries, but its hardly a case of “almost no poor countries”. We see the same thing when examining the distribution of GDP per capita in 2011 vs. 2035.
print(ggplot(GDP.combined, aes(GDP, group = year, colour = year)) + geom_density())
There are more sophisticated ways of doing this, of course, but for now, just consider that the Gates' prediction is rather more rosy than a simple model-based forecast would suggest.