Gifts from BAC ML and the Federal Reserve

May 17, 2011

(This article was first published on Timely Portfolio, and kindly contributed to R-bloggers)

Bank of America Merrill Lynch and the Federal Reserve Bank of St. Louis Fed continue to surprise me with even more gifts.  This time they added Emerging Market Bond Indexes with history back to 1998 (cannot see Asia Pacific Crisis of 1997-1998 but can see Argentina 2001-2002).  Data like this is extremely difficult to attain without significant subscription costs.

Since BAC ML and the Fed took it a step further, I feel equally obligated to extend my post Bank of America Merrill Lynch Bond Returns on St. Louis Fed to include some of this newly added data.

From TimelyPortfolio
From TimelyPortfolio
From TimelyPortfolio
From TimelyPortfolio

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
MLLatAmEmCorp<-getSymbols(“BAMLEMRLCRPILATRIV”, src=”FRED”, auto.assign=FALSE)
MLUSCorp<-getSymbols(“BAMLCC0A0CMTRIV”, src=”FRED”, auto.assign=FALSE)
colnames(MLBondIndexes)<-c(“BAC ML Asia Emerging Corporate”,”BAC ML Latin America Emerging Corp”,”BAC ML US Corporate Master”)

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

#do some downside analysis on monthly returns
colnames(MLBondIndexes)<-c(“BAC ML Asia Emerging Corporate”,”BAC ML Latin America Emerging Corp”,”BAC ML US Corporate Master”)
ggplot(downsideTable, stat=”identity”, aes(x=Statistic,y=Value,fill=BondIndex)) + geom_bar(position=”dodge”) + coord_flip()

#ggplot annual returns
ggplot(yearReturns, stat=”identity”, aes(x=Year,y=Return,fill=BondIndex)) + geom_bar(position=”dodge”)

#ggplot CAPM statistics
ggplot(capmTable, stat=”identity”, aes(x=Statistic,y=Return,fill=BondIndex)) + geom_bar(position=”dodge”) + coord_flip()

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 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.


Mango solutions

RStudio homepage

Zero Inflated Models and Generalized Linear Mixed Models with R

Dommino data lab

Quantide: statistical consulting and training



CRC R books series

Six Sigma Online Training

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)