Thursday, June 14, 2012

Pretty Correlation Map of PIMCO Funds

As PIMCO expands beyond fixed income, I thought it might be helpful to look at correlation of PIMCO mutual funds to the S&P 500.  Unfortunately due to the large number of funds, I cannot use the chart.Correlation from PerformanceAnalytics.  I think I have made a pretty correlation heatmap of PIMCO institutional share funds with inception prior to 5 years ago.  Of course this eliminates many of the new strategies, but it is easy in the code to adjust the list.  I added the Vanguard S&P 500 fund (VFINX) as a reference point.  Then, I orderded the correlation heat map by correlation to VFINX.

As expected there are two fairly distinct groups of funds: those (mostly fixed income) with negative/low correlation to the S&P 500 and those with strong positive correlation.

From TimelyPortfolio

Here is the more standard heat map with dendrogram ordering, which has its purpose but gets a little busy.

From TimelyPortfolio

If we are only interested in the correlation to the S&P 500 (VFINX), then this might be more helpful.

From TimelyPortfolio

R code from GIST:

2 comments:

  1. What is `get="all"` in your `getSymbols` call? You're using `src=yahoo`, right? As a side note, you can use `auto.assign=FALSE` instead of `get(getSymbols(*`

    ReplyDelete
  2. always an honor when the masters comment, thanks. Your comments address remnants of my discovery process. The get="all" is left over from stockPortfolio, and I do not use auto.assign in development, since I like to keep each symbol, so I do not hit Yahoo every time I mess up.

    Thanks so much for reading and commenting.

    ReplyDelete