Thursday, 2 July 2015

Correlations Between Canadian ETFs

June was a difficult month for world equity markets. China was down double digits and most European markets fell between 3% and 5%. Canadian equity markets got caught up in the downdraft.

We know that equity correlation increased during the 2008-2009 financial crisis, but how does current equity correlation compare with the past. In order to investigate further, I took the position of a Canadian investor with a diversified portfolio of ETFs. For the analysis, I used daily data pulled from Yahoo Finance.

  "XIU.TO", # Canadian equities,
  "XRE.TO", # Canadian REITS,
  "XSP.TO", # US equities, SP500
  "XIN.TO", # EAFE equities,
  "XBB.TO"  # Canada bonds,


Here is how the ETFs have performed. Except for bonds, the other assets took a big hit during the financial crisis.




Here are what the correlations look like from 2002 until the end of June 2015. Bonds are negatively correlated with each of the equities with the largest negative correlation with the US. The largest positive correlation is between the US and other developed markets.



Here are what the correlations look like from 2002 until the end of December 2007. Each equity correlation is smaller (in absolute value) than the corresponding value over the full sample indicating greater diversification benefits over this first sub-sample. Notice that during this time period, bonds correlated positively with REITs.

 

Here are what the correlations look like during the financial crisis. Notice that correlations between equity ETFs were much higher during the financial crisis then during the previous period (2002 - 2007). For example, the correlation between XIU and XIN went from 58.6% to 85.9%!

 

Here are what the correlations look like over the post-crisis period (July 2009 until the end of June 2015). Correlations for the equity ETFs are smaller than they were during the financial crisis, but they have not yet returned to pre-crisis values. In some cases, bonds have actually gotten more negatively correlated with equities. The correlations between Canada and the US or Canada and developed international markets are very high (over 70%)

 

The overall takeaway is that in the post-crisis period, correlations between Canada, the US, and other developed markets remains high. This makes it difficult to diversify risk between these asset classes. The correlation between bonds and equities in the post-crisis period has, in some cases, gotten even more negative (possibly in anticipation of Central Bank interest rate increases).



Here is the R code.

#########################################################
#  Economic forecasting and analysis
#  Perry Sadorsky
#  Heat Map for a Canadian ETF portfolio
#  June 2015
##########################################################


rm(list=ls())
library(fpp)
library(quantmod)
library(gplots)



## define symbols
symbols = c(
  "XIU.TO", # Canadian equities,
  "XRE.TO", # Canadian REITS,
  "XSP.TO", # US equities, SP500
  "XIN.TO", # EAFE equities,
  "XBB.TO"  # Canada bonds,
)


## get data
getSymbols(symbols, from="1970-01-01")
m = length(symbols)
Y = Ad(XIU.TO)
for (i in 2:m) Y = cbind(Y, Ad(get(symbols[i])))
head(Y)
tail(Y)


## plots
par(mfrow = c(3, 2))
for (i in 1:m) plot(Y[, i],  main = symbols[i])
par(mfrow = c(1, 1))


## returns
ret <-  (na.omit(1.0 * diff(log(Y)) *
                    100))
colnames(ret) = c("XIU", "XRE", "XSP", "XIN", "XBB")
head(ret)
tail(ret)


## helper function from
## http://blog.revolutionanalytics.com/2014/08/quantitative-finance-applications-in-r-8.html
generate_heat_map <- function(correlationMatrix, title)
{
 
  heatmap.2(x = correlationMatrix,      # the correlation matrix input
            cellnote = correlationMatrix,    # places correlation value in each cell
            main = title,            # heat map title
            symm = TRUE,            # configure diagram as standard correlation matrix
            dendrogram="none",        # do not draw a row dendrogram
            Rowv = FALSE,            # keep ordering consistent
            trace="none",            # turns off trace lines inside the heat map
            density.info="none",        # turns off density plot inside color legend
            notecol="black")        # set font color of cell labels to black
 
}




# Convert each to percent format
corr1 <- cor(ret) * 100
corr2 <- cor(ret['2002-10/2007-12']) * 100
corr3 <- cor(ret['2008-10/2009-05']) * 100
corr4 <- cor(ret['2009-07/2015-06']) * 100

heatmap.2(corr1)

corr1 = round(corr1, digits = 1)
corr2 = round(corr2, digits = 1)
corr3 = round(corr3, digits = 1)
corr4 = round(corr4, digits = 1)

par(cex.main=.8)

generate_heat_map(corr1, "Correlations of Canadian ETF Returns, Oct 2002 - June 2015")
generate_heat_map(corr2, "Correlations of Canadian ETF Returns, Oct 2002 - Dec 2007")
generate_heat_map(corr3, "Correlations of Canadian ETF Returns, Oct 2008 - May 2009")
generate_heat_map(corr4, "Correlations of Canadian ETF Returns, July 2009 - June 2015")
par(cex.main=1.0)



No comments:

Post a Comment