Do Treasury Yields Forecast Recession?

Plot of yield time series for maturities from 6 months to 20 years.
Data source: US Treasury

Summary

I show how to build a simple model of the real GDP (Gross Domestic Product) for the US economy using data publicly available from the Federal Reserve and US Treasury. I do this using the popular Python programming environment. Although the yield spread has a statistically significant effect on GDP its magnitude is small.

Introduction

The pattern on the chart above looks ominous. It shows the constant maturity yields for US bonds and bills from 1990 until the current day. The multiple curves are for different maturities starting at 3 months (blue) and ending with 20 years (green). The dominant hump feature centred around 2007 is due to the global financial crisis when the short term interest rate rose quickly to equal the long term interest rate. There is a similar feature emerging at the moment. The yield curve inversion that happened in the middle of last year has been much discussed in the financial press and also by the Federal Reserve itself. An inversion happens when the yield on short maturity bonds becomes higher than the yield on long maturity bonds. Normally long maturity bonds have higher yields to reflect the risk of lending money over those timescales. An inversion can happen after either a period when short term rates have been increased to counteract inflationary pressure during a boom or when long term yields decline because of the perception of a lack of investment opportunities. Whichever way it happens observations show that it is often the warning of a recession. The chart below from the US federal reserve website illustrates this. In the middle of last year it became their most popular time series because of the anxiety the inversion was causing.


St Louis Fed chart showing recessions on yield spread graph
It shows the difference between the yield on a 10 year maturity bond and the yield on a 2 year maturity bond. This is often called a yield spread. The vertical grey bands are recessions. You can see that typically grey bands have been preceded by periods with a yield inversion in which the 2 year yield exceeds the 10 year yield. Currently the yield spread is plunging downwards and so expectations are for a US recession. Or are they? How effective is the yield spread as an indicator of economic growth? I shall try to answer this with some statistical analysis using data drawn from both the Treasury and Federal Reserve. First though, we'll take a look at the GDP data used to measure the strength of an economy.

Gross Domestic Product (GDP)

GDP is the total output of goods and services in an economy. In the US it is measured every quarter by the Bureau of Economic Analysis. The figures are normally produced with a delay of a month and so the 2019 Q3 figure was released on October 30th. The figures are revised in subsequent months as better data becomes available. In this blog I'll be using data on the changes in the GDP, which are measure of growth or contraction in the economy. Moreover I'll be looking at real GDP in which inflation has been taken into account. If, for example, GDP increases by 5% but inflation is 10% then real GDP will have shrunk by 5%. A recession is defined as two successive quarters of negative change in GDP but there will usually be other signals such as rising unemployment. The final decision on calling a recession in the US is given by the NBER (National Bureau of Economic Research), so they are responsible for the grey bars on the chart above. In any statistical analysis it's good to see a picture of the data so here it is for the real GDP changes:
US GDP Data downloaded from the St Louis Federal Reserve FRED database.
Data source: St Louis Federal Reserve

The GDP changes fluctuate around a value of about 3% but sometimes plunge downwards as in 2008 or upwards as in 1978. But another clear feature of the chart is the big reduction in the magnitude of the fluctuations after the mid 1980's. This has been called the Great Moderation. As you can imagine central bankers have claimed that this is due to improved economic policies but to be fair nobody seems quite sure of the cause nor whether the Moderation will persist or indeed whether it ended with the 2008 financial crisis. In the analysis that follows I shall leave all of these questions open. From a statistical perspective it is good to use long data series and so I will use the data starting from the 50s. This may mean that there are better models taking into account the Moderation, but there is merit in keeping the model as simple as possible as I do below.

Correlation

Apart from the reduction of the fluctuations after the 1980s the GDP figures seem quite random, but appearances can be deceptive. One way of measuring this is the autocorrelation function. A bit of a mouthful that. Data is correlation of there is a high probability that if one number in a time series goes up then a matching number in another time series will go up. For example, the returns (price changes) of shares are often very correlated. If the price of the oil company BP goes up then Shell is very likely to go up too, but it is not certain. Auto-correlation is about how the changes in a time series correlate with earlier values in the same series. It turns out that GDP changes have quite a large amount of auto-correlation: if the GDP rises in one quarter it is likely to rise in the next. And likewise for drops in the GDP.  The chart below shows how the time series for real GDP changes are auto-correlated.
Auto-correlation of US real GDP changes
Data source: St Louis Fed FRED database
On the horizontal axis are the 'lags'. These are measured in quarters and so for lag 2 the plot shows how the real GDP change is correlated with the change 2 quarters previously. All values within the blue band are not statistically significant and so we cannot be sure if the correlations are non-zero. But for lags one and two we are fairly confident that the GDP is autocorrelated and for lag one the autocorrelation is almost 0.4 (40%). What this means is that the US economy (and most likely other economies too) will continue to expand (or contract) as it has done in the recent past. This is a strong effect because of the high value of the autocorrelations. It's not possible to consider the impact or otherwise of the yield spread without also taking this effect into account.
Yield curves showing inversion and normal upward sloping shape
Data sources: US Treasury, Bundesbank, Japan Ministry of Finance, Bank of Canada
Before looking closely at the impact of the yield spread on changes in GDP I've plotted out above some yield curves for a number of countries. This time the horizontal axis is the maturity of the bond and the yield is plotted on the vertical axis. The data is for the 8th November 2019. The US yield curve is now clearly not inverted whereas in Canada 1 year rates are higher than 7 year rates although the curve bends back up at longer maturities. Both Germany and Japan have similar yield curves with negative yields out to about 10 years and very slight inversions at short maturities. Negative yields are a strange phenomenon in their own right which I don't have space here to discuss. The curves above show though that recent reductions in the US federal funds rate have moved the US yield curve back into a normal shape whereas other countries are still showing evidence of an inversion.  

Downsampling

GDP data is published quarterly whereas yield data is published daily by central banks and intra-day by commercial data vendors. Databases such as the St Louis Federal Reserve FRED do publish weekly and monthly figures for yield spreads but to ease any statistical analysis it's better to have the yield spread at the same quarterly frequency as the GDP data. Using the Pandas data analysis module of the Python language we can do this with a single line of code:
df.field.resample('Q').mean()
where df indicates a DataFrame and 'field' is the column with the yield spread data. This statement works out a quarterly average of the yield curve spread using the monthly or daily data presented to it. This illustrates some of the power of using Pandas to wrangle with financial time series data. Life is so much easier with it!

Influence of Yield Spread on real GDP growth

Now that we know how GDP is affected by auto-correlation and we have the data in the right form, we can try to figure out what the influence of the yield spread is. The US Treasury publishes daily yield curves with 12 maturities ranging from 1 month to 30 years on their website under the Data tab. With the 66 pairs of maturity available selecting a pair to use as the yield spread poses a conundrum. I shall use a slightly non-standard choice of 10 years minus 1 year against a classic choice, often used in the financial press, of 10 years minus 2 year. The reason is that the 2 year data series only extends back to 1977 whereas with 1 year maturity data is available from the early 50s.  Some simple tests show that other pairs give very similar results to the 10 year minus 1 year combination so I'll stick with that. My model for future changes in the real GDP is, then
where the subscript n indicates the quarter and the Greek delta indicates a change in the value of the GDP. There are three constants in the equation A, B and C and we can estimate them by fitting the equation to the historical data. This equation is saying that the change in the real GDP this quarter depends on the real GDP change from the previous quarter and the yield spread from the previous quarter. It's the simplest way to include both the effect of autocorrelation and the yield spread on changes in the real GDP. In the next section we'll see what happens when we fit this equation to the historical data.

Statistical Results

Using the StatsModels Python module I've fitted the model quoted above to historical data starting from 1953Q2 and continuing to the current quarter. The results below show that the constant A is 2.3041 which is very close to the average % annual rise in US real GDP over the period from 1953. B is 0.3277 reflecting the high degree of auto-correlation discussed above whilst C is 1.1024. The positive value of C means that during an inversion when the yield spread is negative the impact on the GDP will be negative. Of course it also means that a strongly upward sloping yield curve will be boosting expectations of economic growth. The column marked 'std err' or standard error in full gives an idea of how well to trust the estimated figures for the coefficients.  
Output from StatsModels Python module for GDP model
Results from time series study of US GDP
The model can be used to make forecasts of GDP and this is shown in the plot below. The green line shows the forecasts which the model shows are all positive and so no recession is forecast for the US.
US GDP forecasts from StatsModels
Forecasts from the US GDP model

Conclusion

This analysis shows that the yield spread is indeed a significant factor in forecasting GDP and hence whether a recession may be imminent. The analysis is only effective if the autocorrelation of the GDP  is also taken into consideration at the same time. The effect is small but a downward sloping yield curve is likely to reduce any future change in the GDP. If the economy is growing well at the time of the inversion it seems quite possible for a recession to be avoided because of the effect of the autocorrelation in the GDP. My model is the simplest possible that takes into account both of these effects so it may well be possible to improve on the results I've shown above. The results are, however, robust in the sense that if another combination of maturities is taken then you get very similar results. 

Python

Most of the charts in this post have been created using the Python computer language. The Pandas module has been used for data wrangling and Matplotlib for the plotting itself. GDP and yield data has been downloaded from the St Louis Federal Reserve FRED database using the Pandas Data-Reader. The statistical analysis was done using the StatsModels Python module mainly from the time-series analysis section. 

Recommended Reading

For a great review on the influence of the yield spread on equity markets and GDP take a look at the article 'Is the yield curve reliable or not' by Russ Mould in Shares magazine published by AJ Bell August 29th 2019.
'What's up (or down) with the yield curve?' August 27 2018, FRED (Federal Reserve Bank of St Louis) Blog
'Does the Yield Curve Really Forecast Recession' Economic Synopses 2018 No30, Federal Reserve Bank of St Louis
'Yield Curve and Predicted GDP Growth'  Federal Reserve Bank of Cleveland
'The importance of an inverted yield curve is overrated' Gillian Tett, Financial Times 15th November, 2019




                                                                                                           

Comments

Popular posts from this blog

Introduction to Quantifying

Book Review: "Material World" by Ed Conway, published WH Allen 2023

Index Linked Gilts