Clustering of stock market returns

I am trying to cluster the companies listed in a stock market on the basis of the risk and returns. I have about 100 companies (categories) and two variables (risk, return) under each category. The data comprises of daily data for the past 10 years. I want to run a cluster analysis to group the companies (categories) but I am unsure about the methodology.
Can anyone suggest?
Thanks!

• What do you mean by "methodology": Clustering algorithm? finding features other that risk/return? Programming language? Jan 8, 2012 at 12:08
• You have (only) 100 data points and (only) two features? Have you started by plotting them to see what they look like? Jan 8, 2012 at 14:47
• I was thinking the same thing, only plotting summary numbers--one variable to represent risk and one to represent return. If you try creating this plot, I hope you'll post it here. It'll be interesting to see. Jan 8, 2012 at 14:57
• Look at unsupervised machine learning algorithms.
– Jase
Nov 13, 2012 at 16:10

This example from the scikit-learn project might give you some ideas on how to combine sparse covariance graph estimation with traditional clustering so as to identify some of the underlying structure of a market from daily price data.

Disclaimer: I contribute to the scikit-learn project even though I am not the one who wrote this example.

• I bet I would find this example pretty interesting if labels were provided for the X- and Y-axis. That would give the viewer something more definite to grapple with. Jan 8, 2012 at 15:05
• The axis are found using a 2D Locally Linear Embedding as explained in the summary and the inline comments. The axis don't mean anything: it's just a data driven way to project the data points on a 2D space for visualization of the nodes. Jan 8, 2012 at 22:37

If you plot the risk vs. reward on a 2d plot and find that there is some separation between regions, there are quite a few approaches that can be used to classify the regions into clusters. A common unsupervised algorithm is the k-means algorithm.

In addition, there is a good tutorial on using clustering methods to classify hedge funds into groupings of returns vs volatility in this book (p 94 cluster analysis):

"Hedge funds: quantitative insights" By François-Serge Lhabitant