Predicting Real GDP Growth. How well do economic leading indicators... | by Joohi Rana | Towards Data Science

If you follow financial news, you may have heard words like “consumer sentiment” or “ISM new orders” being thrown around. These are data points or economic indicators that economists use to gauge where the economy is heading in the future. But how well do they predict economic growth? To find out, I developed a prediction model in Python to see the predictive powers of these economic metrics.
Before, we get to the model, let’s first establish a firm understanding of business cycles. Four phases of the cycle are peak, contraction, trough, and expansion. The peak and trough are turning points in the cycle. During contraction, economic activity or GDP is declining, which may lead to a recession or depression. During expansion, economic activity is accelerating. Peak is when the economy is over-heating, with high inflation and GDP slowing down.
US GDP or gross domestic product is the value of final goods and services produced in US in a certain time frame. It is the sum of consumer spending, domestic investments, government spending, and the difference in export and imports.
GDP = C + I+G+(X-M)
Economists and financial analysts use leading indicators to help understand the future state of the economy. It helps pinpoint where we will be on the business cycle curve. Below are the leading indicators I used in my model:
Average Weekly Initial Claims for unemployment insurance: good measure of initial layoffs and rehiring
Manufacturing Average Hours Worked (Quarterly % Change): businesses are more likely to cut overtime before layoffs and increase overtime before rehiring; therefore, this metric moves first before the business cycle turns
ISM Manufacturers’ New Orders: Nondefense Capital Goods Excluding Aircraft: Monthly new orders offer first signal of movement in industrial sector and good proxy for business expectations
Building permits for private housing units: foretells new construction activity
S&P 500 Index: provides early indications of movement in the economic business cycles
Interest Rate Spread between 10 year Treasury yield and federal funds rate: wider spreads anticipate economic upswings and narrower spreads anticipate downturns
Average Consumer Expectations/Confidence: if consumers are confident, spending will increase. Consumption makes of 66% of the U.S economy
All data points are quarterly aggregates retrieved from St. Louis FRED website. The data is from 1947 to 2020 Q1 with 293 records.
New variables created:
Quarter: created from DateS&P 500_pct: Replaced actual values with percent change of S&P 500, because over time S&P 500 values increase
Quarter: created from Date
S&P 500_pct: Replaced actual values with percent change of S&P 500, because over time S&P 500 values increase
The target variable is the annualized real GDP growth. I calculated this variable using the change in quarterly real GDP as follows: ([Q2/Q1 * 4 ]-1). Real GDP is used because it is adjusted to inflation.
Few of the variables had nulls values because I could not find data dating back to 1947 as I did for the GDP data. To fill up the missing data, I used the k-nearest neighbor algorithm.
from sklearn.impute import KNNImputerimputer = KNNImputer(n_neighbors=2)df_filled = imputer.fit_transform(df2)dataframe=pd.DataFrame(df_filled, columns = cols)
I decided to use an Elastic Net Regression model because it does a better job dealing with highly correlated independent variables. I split the data 30/70 (test/train). Then, I found the best alpha for the model using ElasticNetCV which is a cross validation class.
#Separate Features and targetX_Target = dataframe3[‘GDP_Change’] # the feature_df= dataframe3.loc[:, dataframe3.columns != ‘GDP_Change’]#Split the dataX_train, X_test, y_train, y_test = train_test_split(feature_df, X_Target, test_size=0.3, random_state=0)alphas = [0.0001, 0.001, 0.01, 0.1, 0.3, 0.5, 0.7, 1]elastic_cv=ElasticNetCV(alphas=alphas, cv=5)model = elastic_cv.fit(X_train, y_train)ypred = model.predict(X_test)score = model.score(X_test, y_test)mse = mean_squared_error(y_test, ypred)print("R2:{0:.4f}, MSE:{1:.4f}, RMSE:{2:.4f}"      .format(score, mse, np.sqrt(mse)))
Output:
R2:0.4323, MSE:0.0008, RMSE:0.0275
I then visualized the model’s predicted values with the actual values
x_ax = range(len(X_test))plt.scatter(x_ax, y_test, s=5, color=”blue”, label=”original”)plt.plot(x_ax, ypred, lw=0.8, color=”red”, label=”predicted”)plt.legend()plt.show()
Mean squared error was quite low but root mean squared error was larger because it penalizes the larger errors. These large errors may be due to the volatility in the market resulting from unforeseen events. The R-squared of 0.4323 reveals that the leading indicators only explain 43% of variance in GDP growth. Thus, using only the leading indicators is not enough to forecast GDP growth. To have a better idea of where the economy is heading, we need to look at more metrics such coincident indicators.
Coincident indicators measure the current state of the economy. So, by knowing where we are on the business cycle, we can foretell where we are heading.
I added the following metrics:
Change in monthly unemployment (quarterly average)
Personal Consumption Expenditures Excluding Food and Energy (Chain-Type Price Index), price change from a year ago
Monthly supply of house: ratio of houses for sale to houses sold
Mortgage Debt Service Payments as a Percent of Disposable Personal Income,price change from a year ago
The new Elastic Net Regression model had slightly lower errors and a increased in R-squared. This model explains about 65% of variability in GDP growth. Using both coincident and leading indicators paints a better picture of where we’re headed.
R2:0.6477, MSE:0.0006, RMSE:0.0235
The model’s strong predictors were ISM New Orders, consumer confidence, and unemployment rate changes.
The ISM New order Index is strongly correlated to GDP growth with a correlation of .60. Thus, as new manufacturing orders increases, it contributes to GDP growth. Second strong predictor is consumer confidence (0.34). A large part of the GDP calculation is spending. As consumers are more confident in the state of the economy, they are likely to spend more, increasing GDP. There is also a strong negative correlation between changes in unemployment and GDP growth (-0.65).
From the above correlation matrix, you can see that the independent variables are correlated as well (that is why I used the Elastic Net Regression model). For example, there is a strong negative correlation between consumer confidence and weekly unemployment claims, which makes sense because if one does not have a job to pay the bills, consumers will have less confidence about the economy.
The graph below illustrates the trend between the top two predictors (ISM New Orders and consumer sentiment). For example, in the fourth quarter of 2008, the economy contracted about 8% with new orders and consumer confident dropping as well. In the first quarter of 2020, we experienced another economic contraction (-4.8%). During this time due to growing concerns about the coronavirus, both new order index and consumer confident dropped about 10%.
Using latest data from April to predict GDP growth in quarter 2 of 2020, my model projects a sharp decline of 24.2%. At first, this was eye-dropping. So I compared my results to what other leading organizations projected.
US Congressional Budget Office (CBO) estimates a 12% decline in GDP for the next quarter and an annualized decline of 40%1.
The Federal Reserve Bank of Atlanta estimates a whopping 40% decline in GDP. Blue Chip consensus projections range from -6% to 40%2.
The Conference Board forecasts the US economy to contract by 45% next quarter3. According to Pacific Investment Management Co (PIMCO), one of the world’s largest investment firms, GDP will contract by 30%4. My shocking projection of 24% contraction is actually in range with many of the other’s outlook.
Two consecutive negative GDP growths is a recession. Regardless of the actual GDP growth number, the consensus agrees that second quarter of 2020 will experience a large drop. This indicates that we will be in a recession since first quarter of 2020 contracted as well.
[1]: Phill Swagel. (April 24 2020). CBO’s Current Projections of Output. https://www.cbo.gov/publication/56335
[2]: Federal Reserve bank of Atlanta. GDPNow. www.frbatlanta.org
[3]: The Conference Board. Economic Forecast for the US Economy. https://www.conference-board.org/publications/Economic-Forecast-US
[4]: Kate Duguid (April 8 2020). U.S. GDP will contract 30% in second quarter, 5% in 2020: PIMCO. https://www.reuters.com/article/us-usa-gdp-pimco/us-gdp-will-contract-30-in-second-quarter-5-in-2020-pimco-idUSKCN21Q2VL