Wednesday, May 4, 2011

Bank of America Merrill Lynch Bond Returns on St. Louis Fed

After all my complaining about proprietary data, the St. Louis Federal Reserve announced today the availability of Bank of America Merrill Lynch Bond Indicies on their FRED site.  The data is limited in scope and duration, but accessibility especially through R is wonderful.  Thanks to people I normally don’t thank--Bank of America and the Federal Reserve.

I will show a short example with the Bank of America Corp Master and High Yield Master II Indexes.

From TimelyPortfolio

I am really excited about figuring out this ggplot2 of PerformanceAnalytics tables, so here are two other examples for those who might not have seen this technique in my earlier posts.

From TimelyPortfolio
From TimelyPortfolio

Every time I look at bond indicies, I marvel at their unbelievable 30 year run.  2 down years and 12 up years on the BAC ML Corporate Master truly amazes me.  For more on the 30 year secular bull run in bonds, please see my earlier posts.

R code:

#thank you Bank of America Merrill Lynch and St. Louis Fed for this data


#get Bank of America Merrill Lynch bond index data from St. Louis Fed
#use auto.assign = FALSE so we can use shorter names
MLHYMaster<-getSymbols("BAMLHYH0A0HYM2TRIV", src="FRED", auto.assign=FALSE)
colnames(MLBondIndexes)<-c("BAC ML Corporate Master","BAC ML High Yield Master II")

    main="Bank of America Merrill Lynch Bond Indicies from St. Louis Fed")

#do some downside analysis on monthly returns
colnames(MLBondIndexes)<-c("BAC ML Corporate Master","BAC ML High Yield Master II")
ggplot(downsideTable, stat="identity", aes(x=Statistic,y=Value,fill=BondIndex)) + geom_bar(position="dodge") + coord_flip()

ggplot(yearReturns, stat="identity", aes(x=Year,y=Return,fill=BondIndex)) + geom_bar(position="dodge")

No comments:

Post a Comment