Deriving Maximum-Sharpe Portfolio Weights with Covariance
Summary
The discussion seeks a derivation for the portfolio weights often written as the inverse covariance matrix multiplied by expected returns. One answer applies Lagrange multipliers to a Sharpe-ratio objective with weights summing to one. Another uses the Cauchy–Schwarz inequality to show that, when the covariance matrix is positive definite, the unconstrained Sharpe-maximizing direction is proportional to the inverse covariance matrix times the expected-return vector. A normalization can then impose weights summing to one.
For singular covariance matrices, the answers mention dimensionality reduction with principal component analysis or using a pseudoinverse. However, the original question also requires nonnegative weights and a unit-norm constraint, while the proposed derivations do not consistently handle those constraints. The accepted response's claim about when a correlation matrix is invertible is also incorrect. Thus, the inverse-covariance result is useful under its standard assumptions, but the proof and singular-matrix discussion here should be treated cautiously and do not establish the constrained solution in every case.
Key ideas
- For a positive-definite covariance matrix, the unconstrained maximum-Sharpe direction is proportional to the inverse covariance matrix times expected returns.
- The Cauchy–Schwarz inequality provides a way to derive that direction.
- Weights can be rescaled to meet a sum-to-one constraint when the resulting portfolio permits it.
- Nonnegative-weight constraints generally require additional optimization and are not resolved by the simple inverse formula.
- A pseudoinverse or dimensionality reduction may help with singular covariance estimates, but the document's treatment is incomplete.
Tags
Full text
# Proof of weights maximizing sharpe of a portfolio
# Proof of weights maximizing sharpe of a portfolio
Given a portfolio of $n$ assets with mean vector $\mu$ and correlation matrix $\Sigma$, the optimal weights $w$ on the $n$ assets to maximize overall sharpe is found by $$\max_{w:||w||=1}{\dfrac{\mu^T w}{\sqrt{w^T\Sigma w}}}$$ and the entries of $w$ are nonnegative. I have seen in this post (and various other places) that the weights solving this optimization problem are given as
$$w=\Sigma^{-1}\mu$$
However, I have not been able to find a reference as to why this is true.
Question: What is the proof that these are the optimal weights? Bonus: what if $\Sigma$ is not-invertible (strictly positive semidefinite)?
## Answer by THATS MY QUANT MY QUANTITATIVE (score 3, accepted)
https://quant.stackexchange.com/a/79794
If the optimization problem is:
$\max_{w} \frac{w'\boldsymbol{\mu}}{(w'\boldsymbol{\Sigma}w)^{\frac{1}{2}}}$
constrained to $w\textbf{1}=1$, then we just use Lagrange multipliers:
$$L = \frac{w'\boldsymbol{\mu}}{(w'\boldsymbol{\Sigma}w)^{\frac{1}{2}}} + \lambda(w\textbf{1} - 1)$$
Then taking the partials wrt $w$ and $\lambda$, we have:
$$\frac{\partial L}{\partial w} = \boldsymbol{\mu} (w'\boldsymbol{\Sigma}w)^{-\frac{1}{2}} - (w'\boldsymbol{\mu}(w'\boldsymbol{\Sigma}w)^{-\frac{3}{2}}\boldsymbol{\Sigma}w + \lambda\textbf{1}=0$$
$$ \frac{\partial L}{\partial \lambda} = w'\textbf{1} - 1 = 0$$ Then the result follows.
For your 2nd question, A matrix is invertible if and only if it has a non-zero determinant. But from the definition of a correlation matrix, the only way for a correlation matrix to have a non-zero determinant is for the correlations to all equal $1$ or $-1$. Of which case, the optimal portfolio is trivially obvious. If there are less datapoints than dimensions, you can perform PCA analysis, or you can use singular value decomposition to compute the pseudoinverse of a matrix.
## Answer by Aleksandar Milivojević (score 1)
https://quant.stackexchange.com/a/82449
As an alternative to the accepted solution, one can use the Cauchy-Schwarz inequality: denote by $A$ the square root of $\Sigma$, and consider the vectors $A w$ and $A^{-1} \mu$. Then we have $${\langle A w , A^{-1} \mu \rangle}^2 \leq \langle A w, A w \rangle \langle A^{-1} \mu, A^{-1} \mu \rangle.$$ Now, since $\Sigma$ is symmetric, so is $A$, and we have $$\langle Aw, A^{-1} \mu \rangle = \langle (A^{-1})^\tau A w, \mu \rangle = \langle A^{-1} A w, \mu \rangle = \langle w, \mu \rangle$$ and similarly $$\langle Aw, Aw \rangle = \langle A^2 w, w \rangle = \langle \Sigma w, w \rangle,$$ so $$\langle w, \mu \rangle^2 \leq \langle \Sigma w, w \rangle {\left\lVert A^{-1}\mu \right\rVert}^2.$$
Now, the squared Sharpe ratio of our portfolio is $$\frac{(w^\tau \mu)^2}{w^\tau \Sigma w} = \frac{{\langle w, \mu \rangle}^2}{\langle \Sigma w, w \rangle},$$ which we now know is $\leq \left\lVert A^{-1}\mu \right\rVert$, with equality achieved when $Aw = cA^{-1}\mu$ for some constant $c$. Solving for $w$ we get $w = c (A^{-1})^2 \mu = c \Sigma^{-1} \mu$. If you want $w$ to have entries summing up to 1, you can then solve for $c$ from that condition.Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.