# How do I find the most diversified portfolio, or least correlated subset, of stocks?

I have a trading system that chooses top 10 stocks in Nasdaq 100 ranked on relative strength and some other factors. However, I'd like to take positions in only 5 of these 10 stocks based on how minimally correlated these are to others for diversification effect. How do I resolve this? I do have the correlation/covariance matrices computed. Literature seems to indicate applying weights to reduce correlations but I felt there should be a simpler solution. That said, the stocks doesn't need to be equally weighted if it is easier to compute these weights.

A computationally easier solution is preferred even if it is not completely accurate since I need to implement this in Amibroker trading software.

-

Weighing by 1-correlation is already a pretty simple method. Could you elaborate on why that's difficult? – chrisaycock♦ Aug 18 '11 at 2:38

## 2 Answers

One simple method, based on the principles of mean-variance optimization, is to set the weights proportional to the product of the inverse of the covariance matrix and a vector of standard deviations. This implicitly assumes that the normalized expected return of each stock is equal. If you wish, you can take only the top 5 weights and set the others to zero. The actual problem you face, of selecting just 5 stocks, can be solved rigorously with an optimizer, but since it is not a quadratic program, may be difficult to solve.

Update

A more sophisticated but very interesting additional possibility is to find the "Maximum Diversification Portfolio (MDP)", as defined in Toward Maximum Diversification (free version, hat tip vonjd). The MDP is defined as the portfolio that maximizes the Diversification Ratio (DR), which in turn is defined as the ratio of the portfolio’s weighted average volatility to its overall volatility. A follow-up paper investigates the properties of this portfolio. From the paper:

This measure [DR] embodies the very nature of diversification whereby the volatility of a long-only portfolio of assets is less than or equal to the weighted sum of the assets' volatilities. As such, the DR of a long-only portfolio is greater than or equal to one, and equals unity for a single asset portfolio. Consider for example an equal-weighted portfolio of two independent assets with the same volatility: its DR is equal to $\sqrt{2}$, and to $\sqrt{N}$ for $N$ independent assets.

$DR(\bf{w})=\frac {\sum_i{\it{w}_i\sigma_i}} {\sigma(\bf{w})}$

-
You could probably use DEOptim() R package to solve this complex objective function. Along the lines suggested, I would add a constraint for the max number of assets. Also, you can include in the objective function a vector corresponding to the expected returns of each stock. Since you are optimizing only over 10 stocks the algorithm would converge rapidly. – Quant Guy Aug 24 '11 at 22:43
@QuantGuy I haven't tried this, but the paper suggests that a long-only MDP will typically have much fewer assets than the total available, so a cardinality constraint may not be necessary here. – Tal Fishman Aug 25 '11 at 1:44
@TalFishman I've looked at replicating TOBAM's results in the past, and you're absolutely correct: an unconstrained MDP portfolio on the R1K universe typically holds 50-200 names. – michaelv2 Mar 21 '12 at 14:32

1
– vonjd May 27 '12 at 17:46

The problem of the selecting the best portfolio (according to some risk measure) with a limited number of assets can be formulated as a mixed integer linear or quadratic program and is reviewed in the recent paper "Portfolio selection problems in practice: a comparison between linear and quadratic optimization models". It can be solved for reasonable sizes by several of the best optimizers like CPLEX or XPRESS. However, in the case of 5 stocks out of 10 there are only 252 possible possible different subsets (namely 10 choose 5) and they could be all exaustively explored with repect to the risk measure of preference by any personal computer.

-
Hi Fabio, welcome to quant.SE and thanks for contributing the link to your paper. I hope you will stay to contribute to the site more broadly. – Tal Fishman Sep 28 '11 at 0:24

1
Hi Tal, thanks for the welcome. Indeed, this site looks actractive to me. I work more on the theoretical side, but I would like to share ideas also with people working on the practical side and this site seems to be a good place for it. – Fabio Sep 28 '11 at 9:28
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 4, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.3, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "github"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "english_confidence": 0.9426578879356384, "perplexity_flag": "middle"}