Quantitative Finance Stack Exchange is a question and answer site for finance professionals and academics. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have m assets, and have estimated their future returns and covariance matrix.

I would like to invest in an evenly weighted n product basket from this universe, where 0<n<m.

How do i find the basket with the highest sharpe, without having to calculate the sharpe for every possible portfolio?

share|improve this question

If $Q$ is your covariance matrix, and $r$ is a vector of your expected returns, then the maximum Sharpe ratio is given by the following math program. $${\rm maximize} \frac{r^t x}{\sqrt{0.5 x^t Q x}}$$ subject to $$ 1^t x = m$$ $$ x \in \{0,1\}^n$$ Where $x$ is a vector of indicators of which of the $n$ assets are part of the $m$ selected assets. While the objective is not convex, its solution lies of the efficient frontier of $$\rm{maximize}\ r^t x, -0.5 x^t Q x.$$ You can compute the efficient frontier of the return/variance by solving the following mixed-integer convex-quadratic program for multiple values of $r^*$. $$ {\rm minimize} \frac{1}{2} x^t Q x - \epsilon r^t x$$ subject to $$ r^t x \ge r^*$$ $$ 1^t x = m$$ $$ x \in \{0,1\}^n$$

where $r$ is a vector of expected returns, and $r^*$ is a target expected return. The optimal value for any any value of $r^*$ that is feasible will yield a point on the efficient frontier. The portfolio with the best Sharpe ratio will be on the efficient frontier, so by iteratively solving the above problem for multiple values of $r^*$, you can find the value of $r^*$ that yields the best Sharpe ratio. The highest feasible value for $r^*$ can be computed by taking the top $m$ expected returns.

share|improve this answer
Wouldn't it be better to invest in the GMV portfolio which is not based on expected returns - since returns change through time and are unpredictable? – PEL Dec 28 '13 at 21:27
LEP - Perhaps you are right, but I am mainly looking for a method to help me select which assets to invest in, as I can't feasibly invest small amounts in my whole investment universe. – user847663 Dec 29 '13 at 16:16

For such a problem ("selecting n out of m") you can use optimisation heuristics. These algorithms work well even for large n and m, and they are flexible: you may as well select a portfolio that minimises some other function, for instance, the portfolio's drawdown. The downside is that you may have to do some programming yourself.

An example very similar to your problem is described in "Heuristic Methods in Finance" ( http://ssrn.com/abstract=1794290 ) The R code for the example is here http://cran.r-project.org/web/packages/NMOF/vignettes/LSselect.pdf

share|improve this answer
Very nice! Thanks – user847663 Dec 31 '13 at 10:48

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.