Yield curve is the spread, i.e. the difference between yields on longer dated Treasury securities with shorter-term Treasury securities. In this analysis, we will focus on the difference between US treasury 30-year zero-coupon yield and 1-year zero-coupon yield. This spread tells us about the slope of the Treasury yield curve.
When the 30 Year is yielding more than the 1 Year, the yield curve is described as positively sloped, or steep. However, when they are equal, the yield curve is flat, and when the 30 Year is yielding less than the 1 Year, the yield curve will be inverted.
The shape of the yield curve is a widely accepted leading indicator of the economy. A steep yield curve is viewed as a positive for the economy; financial institutions are encouraged to lend, as they can borrow at a low short-term cost and then lend that money at a higher level, capturing the spread. This increased lending, and hence investment, help to facilitate economic growth. Thus yield is an indicator of interest rate and inflation expectations. When the difference in yields is negative, it may imply a possibility of recession in the near future.
The Standard & Poor’s 500, often abbreviated as the S&P 500, is an American stock market index based on the market capitalizations of 500 large companies having common stock listed on the NYSE or NASDAQ. It reflects economic expectations and is useful as a leading indicator on general economic conditions and business and investors’ confidence.
Therefore, yield curve reflects the profit for fixed income securities, while S&P 500 corresponds to the stock market. We are going to show the association between S&P 500 and yield curve.
##install.packages("devtools")
library(devtools)
##install_github('quandl/R-package')
library(Quandl)
##install.packages("mFilter")
library(mFilter)
##install.packages("forecast")
library(forecast)
##read data "yield" and "sp500"
mydata=Quandl("FED/SVENY",start_date="2011-02-26")
yield=mydata$SVENY30-mydata$SVENY01
sp500=Quandl("SPDJ/SPX",start_date="2011-02-26")
t <- intersect(mydata$Date,sp500$`Effective date`)
yield <- yield[mydata$Date %in% t]
sp <- sp500$`S&P 500`[sp500$`Effective date` %in% t]
t=as.Date(t)
plot(as.Date(t),yield,type="l",col="blue",xlab="Year",ylab="",ylim=c(1.0,9),
main="Yield curve and S&P 500 Index")
par(new=TRUE)
plot(as.Date(t),sp,col="red",type="l",axes=FALSE,xlab="",ylab="")
axis(side=4, col="red")
legend("topleft",legend=c("Yield","S&P 500"),col=c("blue","red"),
cex=0.8,lty=1,bty="n")
spectrum(yield,spans=c(3,5,3), main="Smoothed periodogram of Yield")
spectrum(sp,spans=c(3,5,3), main="Smoothed periodogram of S&P 500")
yield_hp <- hpfilter(yield, freq=12960000,type="lambda",drift=F)$cycle
sp500_hp <- hpfilter(sp, freq=12960000,type="lambda",drift=F)$cycle
plot(t,yield_hp,type="l",xlab="Year",ylab="",col="blue",
main="Detrended yield (blue; left axis) and detrended S&P 500 (red; right axis)")
par(new=TRUE)
plot(t,sp500_hp,col="red",type="l",axes=FALSE,xlab="",ylab="")
axis(side=4, col="red")
legend("bottom",legend=c("Yield","S&P 500"),col=c("blue","red"),
cex=0.8,lty=1,bty="n")
From the plot, we see that yield and S&P 500 index cycle together, which is very clear between 2011 and 2013. And during 2013 and 2016, the change of yield has a larger amplitude than S&P 500.
We intend to make a test to check that. We can analyze \(yield^{HP*}_{1:N}\) using a regression with ARMA errors model, \[Yield^{HP*}_n = \alpha + \beta sp500^{HP*}_n + \epsilon_n,\] where \(\epsilon_n\) is a Gaussian ARMA process. We use an ARMA(1,0) model, as discussed in supplementary analysis.
arima(yield_hp,xreg=sp500_hp,order=c(1,0,0))
##
## Call:
## arima(x = yield_hp, order = c(1, 0, 0), xreg = sp500_hp)
##
## Coefficients:
## ar1 intercept sp500_hp
## 0.9642 -0.0056 0.0016
## s.e. 0.0075 0.0365 0.0001
##
## sigma^2 estimated as 0.002232: log likelihood = 2048.79, aic = -4089.58
log_lik_ratio <- as.numeric(
logLik(arima(yield_hp,xreg=sp500_hp,order=c(1,0,0))) -
logLik(arima(yield_hp,order=c(1,0,0)))
)
LRT_pval <- 1-pchisq(2*log_lik_ratio,df=1)
plot(as.Date(t),yield_hp,type="l",xlab="Year",ylab="",col="blue",
main="Yield and fitted value")
par(new=TRUE)
plot(as.Date(t),fitted(arima(yield_hp,xreg=sp500_hp,order=c(1,0,0))),col="red",type="l",lty=2,axes=FALSE,xlab="",ylab="")
aic_table <- function(data,P,Q,xreg=NULL){
table <- matrix(NA,(P+1),(Q+1))
for(p in 0:P) {
for(q in 0:Q) {
table[p+1,q+1] <- arima(data,order=c(p,0,q),xreg=xreg)$aic
}
}
dimnames(table) <- list(paste("<b> AR",0:P, "</b>", sep=""),paste("MA",0:Q,sep=""))
table
}
e_aic_table <- aic_table(yield_hp,4,5,xreg=sp500_hp)
require(knitr)
kable(e_aic_table,digits=2)
MA0 | MA1 | MA2 | MA3 | MA4 | MA5 | |
---|---|---|---|---|---|---|
AR0 | -783.14 | -2095.25 | -2813.78 | -3223.26 | -3477.90 | -3610.37 |
AR1 | -4089.58 | -4089.49 | -4089.90 | -4088.01 | -4090.00 | -4090.06 |
AR2 | -4089.32 | -4089.27 | -4090.76 | -4088.77 | -4084.92 | -4088.47 |
AR3 | -4089.66 | -4087.73 | -4086.19 | -4091.56 | -4088.28 | -4086.96 |
AR4 | -4087.71 | -4085.82 | -4086.81 | -4082.90 | -4053.45 | -4086.93 |
r <- resid(arima(yield_hp,xreg=sp500_hp,order=c(1,0,0)))
plot(r)
acf(r,lag=100)
qqnorm(r)
qqline(r)
t=as.numeric(t)
u_low <- ts(loess(yield~t,span=0.05)$fitted,start = 2011,frequency=312)
u_hi <- ts(yield - loess(yield~t,span=0.1)$fitted,start = 2011,frequency=312)
u_cycles <- yield - u_hi - u_low
plot(ts.union(yield, u_low,u_hi,u_cycles),
main="Decomposition of yield as trend + noise + cycles")
sp_low <- ts(loess(sp~t,span=0.05)$fitted,start = 2011,frequency=312)
sp_hi <- ts(sp - loess(sp~t,span=0.1)$fitted,start = 2011,frequency=312)
sp_cycles <- sp - sp_hi - sp_low
plot(ts.union(sp, sp_low,sp_hi,sp_cycles),
main="Decomposition of sp500 as trend + noise + cycles")
plot(as.Date(t),u_cycles,type="l",xlab="Year",ylab="",col="blue",ylim=c(-0.2,0.5),
main="Detrended yield (blue; left axis) and detrended S&P 500 (red; right axis)")
par(new=TRUE)
plot(as.Date(t),sp_cycles,col="red",type="l",axes=FALSE,xlab="",ylab="",ylim=c(-81,90))
axis(side=4, col="red")
legend("topleft",legend=c("Yield","S&P 500"),col=c("blue","red"),
cex=0.8,lty=1,bty="n")
arima(u_cycles,xreg=sp_cycles,order=c(2,0,1))
##
## Call:
## arima(x = u_cycles, order = c(2, 0, 1), xreg = sp_cycles)
##
## Coefficients:
## ar1 ar2 ma1 intercept sp_cycles
## 1.9615 -0.9752 -0.732 0.0002 1e-03
## s.e. 0.0072 0.0071 0.020 0.0022 1e-04
##
## sigma^2 estimated as 1.527e-05: log likelihood = 5174.81, aic = -10337.62
plot(as.Date(t),u_cycles,type="l",xlab="Year",ylab="",col="blue",
main="Yield and fitted value")
par(new=TRUE)
plot(as.Date(t),fitted(arima(u_cycles,xreg=sp_cycles,order=c(2,0,1))),col="red",type="l",lty=2,axes=FALSE,xlab="",ylab="")
r <- resid(arima(u_cycles,xreg=sp_cycles,order=c(2,0,1)))
plot(r)
acf(r,lag=100)
qqnorm(r)
qqline(r)
In this project, we do find evidence for the association between yield curve and S&P 500 index.
Generally, previous analysis believe that yield curve tends to lead the S&P 500 by some time. Thus the situation that yield curve “causes” S&P 500 is possible. And they mostly focused on the “trend”, which reflects a long term change of these two indexes, and came to the conclusion that yield and S&P 500 have a negative correlation. This conclusion is also confirmed by the trend components in our analysis.
However, in our project, we mainly analyzed the association between the detrended indexes. In this way, we ignored the long term change and had a deeper understanding of the short term changes, which is more important for making investment decisions.
From the results of our analysis, yield and S&P 500 has a significant positive correlation and their cyclical components are cycling synchronizely. Possible interpretation of this conclusion is below.
When yield is increasing, the spread between long-term and short-term bond yields is becoming larger, which suggests interest rate is likely to increase in the future. Improving the profit of fixed income securities might be a measure of Federal Reserve to prevent the potential economy inflation, which is often accompanied by active stock market and high S&P 500 at present. On the contrary, when yield curve is decreasing, interest rate tends to be lower, which can be seen as a stimulus of the economy. And thus the economy at present is likely to be weak and S&P 500 is low.
[1] Constable, Simon and Wright, Robert E. 2011. The Wall Street Journal guide to the 50 economic Indicators that Really Matter: From Big Macs to “Zombie Banks,” the Indicators Smart Investor Watch to Beat the Market
[2] Edward Ionides. 2016. Case study: An association between unemployment and mortality? http://ionides.github.io/531w16/notes10/notes10.html#some-supplementary-analysis
[3] Jeff DeMaso. 2012. The Yield Curve and Equity Markets. http://adviserinvestments.com/pdf/contentmgmt/Analyst-Spotlight-Yield-Curve-and-Equity-Markets.pdf