(This article was first published on Timely Portfolio, and kindly contributed to R-bloggers)
As a quick follow-up to my first REITs for Everybody Might Now Mean REITs for Nobody, I want to look at REITs and High Yield bonds, which also might simultaneously attract conservative yield buyers and speculative beta chasers.
HYG (iShares High Yield) and IYR (iShares REIT)With R we can statistically analyze the similarity of REITs and High Yield.
![]() |
| From TimelyPortfolio |
![]() |
| From TimelyPortfolio |
![]() |
| From TimelyPortfolio |
#analyze REITs and High Yield require(quantmod)
require(PerformanceAnalytics) #get ML/BAC High Yield Index
MLHY <- getSymbols("BAMLHYH0A0HYM2TRIV",src="FRED",auto.assign=FALSE)
#get Wilshire REIT Index
getSymbols("WILLREITIND",src="FRED") prices <- na.omit(merge(WILLREITIND,MLHY))
colnames(prices) <- c("Wilshire.REIT","MLBAC.HighYield")
returns <- ROC(prices,n=1,type="discrete") charts.PerformanceSummary(returns,ylog=TRUE,
main="Wilshire REIT Total Return and ML/BAC High Yield",
colorset=c("cadetblue","darkolivegreen3")) chart.TimeSeries(runCor(returns[,1],returns[,2],n=250),
main="Wilshire REIT Total Return and ML/BAC High Yield
Rolling 1 Year Correlation",colorset="cadetblue") chart.Correlation(returns)
Created by Pretty R at inside-R.org
To leave a comment for the author, please follow the link and comment on his blog: Timely Portfolio.
R-bloggers.com offers daily e-mail updates about R news and tutorials on topics such as: visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...





Zero Inflated Models and Generalized Linear Mixed Models with R.
Zuur, Saveliev, Ieno (2012).