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

May 4, 2011

[This article was first published on Timely Portfolio, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

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”)

To leave a comment for the author, please follow the link and comment on their blog: Timely Portfolio. offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

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.

Search R-bloggers


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)