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?


2 Answers 2


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.

  • $\begingroup$ 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? $\endgroup$
    – user6430
    Dec 28, 2013 at 21:27
  • 1
    $\begingroup$ 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. $\endgroup$
    – user847663
    Dec 29, 2013 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


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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