Evolution of Natural-logged Financial Assets Return

I have some engagement over the break, and while most of the analysis have been churned out by R after some programming, it will be some time before I  could write about them.

For now, enjoy the clip. 

Financial Assets Return Correlation Heatmap

Diversification is a timeless advice in wealth management. Even Antonio (from Shakespeare’s Merchant of Venice) quipped:
“My ventures are not in one bottom trusted,

Nor to one place; nor is my whole estate
Upon the fortune of this present year;
Therefore, my merchandise makes me not sad.” 
In contrast, David Wilson(from Mark Twain’s Pudd’nhead Wilson) declared, “Put all your eggs in the one basket, and – WATCH THAT BASKET.”
The quantitative revolution had shaped much of today’s financial landscape, yet such contrasting financial proverbs have not been swept away. While Harry Markowitz reshaped the way people think about and manage risks, the counterpoint of Antonio’s and Wilson’s remark still dazzles us in a different guise.
Is tactical asset allocation a good way to manage risk? What is the most efficient portfolio? Should it consist of the entire stock market within a nation’s border? A global portfolio of stock markets? A portfolio across all assets classes imaginable? 
The Global Financial Crisis of 2007-2008 had made me reflect on such questions deeply. In this series of posts I attempt to answer the questions above. This exploration will be done in a model-free and dynamic framework by:
1) Decomposing the eigenvalues/vectors of the correlation matrix of daily natural-logged returns of financial assets. The variation that can be explained by projecting the data in the direction of the first eigenvector is in a sense, the analog of the Beta that investors should think hardly about.
2) Building Asset Price Stress Indices to compare the observed change in asset prices relative to its history.
3) Tracking the evolution of the correlation matrix with heatmaps. 
As a sneak peek, here is the correlation heatmap of daily natural-logged returns across 82 financial assets for the period 6/1/2006-14/12/2012.
The heatmap is graphed with the ggplot2 package in R. 
The packages required are, ggplot,reshape2,scales,and R color Brewer.
Here’s a sample script, inspired by this question in Stackoverflow.
library (scales) 
As an aside, to download the packages above, type the following command in your R prompt.
Likewise for the other packages. 

A Tutorial in Graphing in R

Found an excellent tutorial from Isomorphisems for plotting graphs in R. This really showcases R’s graphing ability, and is definitely of publishing quality.

Here’s the URL.

R’s learning curve can be steep, but it is immensely rewarding.