REITs for Everybody Now REITs for Nobody Part 2

June 16, 2011
By

(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

R code (click to download):

#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 their blog: Timely Portfolio.

R-bloggers.com offers daily e-mail updates about R news and tutorials on topics such as: Data science, Big Data, R jobs, visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...



If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Tags: , , ,

Comments are closed.

Sponsors

Mango solutions





RStudio homepage

Zero Inflated Models and Generalized Linear Mixed Models with R

Quantide: statistical consulting and training



http://www.eoda.de









ODSC

CRC R books series













Contact us if you wish to help support R-bloggers, and place your banner here.

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)