You are on page 1of 3

Economics 411 ∼ Forecasting

Yield Curve Discussions


Spring 2019

As mentioned in class an inverted yield curve is thought to be a good predictor of a general economic
recession in the next 1-3 quarters. In this way the yield curve is a leading indicator for recession. This is a
predictor that comes under constant scrutiny and reevaluation and for good reason. In predicting recession
the inverted yield curve gives us the direction of the overall economy which is important for all types of
decisions regarding wages, hiring, investments, elections, and so on.
The value added of this could be potentially enormous but it hinges on two specific questions that require
answers, but cannot be answered in a universal fashion as far as I can tell. The questions are:

• What do we mean by an inverted yield curve?


• What do we mean by recession?

While somewhat definitional in nature there are widely varying opinions about the definitions, meaning
there is not a precise definition. This leaves a great deal of margin for error and discussion about the theory
and its usefulness. Let’s start with the yield curve.

Figure 1: Yield Curve 24 Jan 2019

You can see there is some variability in the yields, though the y-axis indicates the spread is much smaller
than you might think. The normal shape for the yield curve is upward sloping which means an inverted yield
curve would be downward sloping.We are clearly not inverted but we are getting close to a flat situation.
The code for this graph in R is:

1
> library ( ggplot2 )
> rates <- c (2.37 ,2.41 ,2.51 ,2.59 ,2.58 ,2.57 ,2.59 ,2.66 ,2.76 ,2.93 ,3.07)
> labels <- c ("1 - month " ,"3 - month " ,"6 - month " ,"1 - year " ,"2 - year " ,"3 - year " ,"5 -
year " ,"7 - year " ,"10 - year " ,"20 - year " ,"30 - year ")
> yc <- data . frame ( rates , labels )
> yield <- ggplot ( data = yc , aes ( x = labels , y = rates , group =1) ) + geom_line (
color =" blue " , size =1) + theme_bw () + labs ( x =" Maturity " , y =" Percent " , fill
= NULL , title =" Treasury Yield Curve " , subtitle =" Constant Maturity , Nominal
" , caption = paste (" Data : Board of Governors of the Federal Reserve " ,"
Selected Interest Rates ( Daily ) , H .15" ," Downloaded : 24 January 2019" ,
sep ="\ n ") ) + theme ( text = element_text ( family = " Arial Narrow " , size =
8) , plot . title = element_text ( size = 12 , face = " bold ") , plot . margin =
unit ( c (0 , 0.25 , 0.0 , 0.25) , " in ") , panel . border = element_rect ( fill =
NA , colour = "# cccccc ") , legend . text = element_text ( size = 8) , legend .
position = " bottom ")
So in attempting to tackle the yield curve we end up with a graphics questions. The x–axis is clearly not
right in terms of its layout. The question is how we fix it with the code generated above?
The problem is that R is basically reading the leading digit of what we intend to be labels on the x–axis
as a number and is sorting based on that. This is really unhelpful. My simple solution is the following: let’s
give R a different value to use for the plotting and use what we want to be labels as labels. Try the following:
> yc$index <-c (1:11)
> yc
rates labels index
1 2.37 1 - month 1
2 2.41 3 - month 2
3 2.51 6 - month 3
4 2.59 1 - year 4
5 2.58 2 - year 5
6 2.57 3 - year 6
7 2.59 5 - year 7
8 2.66 7 - year 8
9 2.76 10 - year 9
10 2.93 20 - year 10
11 3.07 30 - year 11
> yield <- ggplot ( data = yc , aes ( x = index , y = rates , group =1) ) + geom_line (
color =" blue " , size =1) + theme_bw () + labs ( x =" Maturity " , y =" Percent " , fill
= NULL , title =" Treasury Yield Curve " , subtitle =" Constant Maturity , Nominal
" , caption = paste (" Data : Board of Governors of the Federal Reserve " ,"
Selected Interest Rates ( Daily ) , H .15" ," Downloaded : 24 January 2019" ,
sep ="\ n ") ) + theme ( text = element_text ( family = " Arial Narrow " , size =
8) , plot . title = element_text ( size = 12 , face = " bold ") , plot . margin =
unit ( c (0 , 0.25 , 0.0 , 0.25) , " in ") , panel . border = element_rect ( fill =
NA , colour = "# cccccc ") , legend . text = element_text ( size = 8) , legend .
position = " bottom ") + scale_x_discrete ( breaks =1:11 , labels = c ("1 - month
" ,"3 - month " ,"6 - month " ,"1 - year " ,"2 - year " ,"3 - year " ,"5 - year " ,"7 - year " ,"10 -
year " ,"20 - year " ,"30 - year ") )
> yield
With yc$index I created an index value from 1 to 11 that allows me to tell ggplot to use those values to
sequence the different interest rates. Now we have the figure laid out in the logical format, from shortest to
longest maturity along the x–axis. The only real difference between the outcome for figure 2 and figure 1 is
the use of an index value for the position of the yield values and the use of labels.

2
Figure 2: Fixed Yield Curve 24 Jan 2019

You might also like