I am aware that the minimum variance portfolio of a market with $n$ securities can be shown to be:

\begin{equation} w^* = (1^T_n\Sigma^{-1}1_n)^{-1}\Sigma^{-1}1_n, \\ s.t. \ \ 1^T_nw = 1 \end{equation}

by using the method of Langrange multipliers or other. I am interested in demonstration of the extension: \begin{equation} w^* = \underset{w}{\mathrm{argmin}}\lbrace w^T \Sigma w + \lambda\sum_{i=1}^n\rho(w_i)\rbrace\\ s.t. \ \ 1^T_nw = 1 \end{equation}

where $\rho(.)$ is some arbitrary penalty function (e.g. $\lvert w_i\rvert$).

Perhaps you could go through the process step by step as I am getting lost when I try.



1 Answer 1


You're not going to get an analytic formula except in special cases of function $\rho(x)$. And you're probably going to want $\rho$ convex.

  • If $\rho$ is convex, the problem is a convex optimization problem and can be efficiently solved numerically. If $\rho$ isn't convex, the optimization problem may be difficult to solve.

    • If $\rho(x) = |x|$ you basically have the LASSO objective which doesn't have an analytic solution (though the solution can be efficiently found numerically).

    • If $\rho(x) = x^2$, you get a clean formula.

Special case $\rho(x) = x^2$

Then $\lambda \sum_i \rho(w_i) = \lambda \mathbf{w}'I\mathbf{w}$. Your optimization problem is then:

\begin{equation} \begin{array}{*2{>{\displaystyle}r}} \mbox{minimize (over $w_i$)} & \mathbf{w}' \left(\Sigma + \lambda I \right)\mathbf{w} \\ \mbox{subject to} & \sum w_i = 1 \end{array} \end{equation}

And it's essentially the same as your original problem. $\Sigma$ is replaced by $\Sigma + \lambda I$.

\begin{equation} w^* = \frac{\left( \Sigma + \lambda I\right)^{-1}\mathbf{1}}{\mathbf{1}'\left( \Sigma + \lambda I\right)^{-1}\mathbf{1}} \end{equation}

(Just to be explicit, I use bold letters for vectors and $I$ is the identity matrix.)

-- Update -- Motivated by the comment from @noob2, I've attached a simulated example showing how security weights (in case $n = 8$) change as $\lambda$ increases. As @noob2 pointed out, higher $\lambda$ pushes weights towards the equal weight portfolio.

enter image description here

(Note: I've used a random covariance matrix, not one based on actual data. So don't over generalize anything besides the long run convergence towards 1/n.)

  • 2
    $\begingroup$ Interesting. What this is saying is as $\lambda \rightarrow \infty$ make the portfolio look more and more like the $\frac{1}{N}$ portfolio. For $\lambda=0$ take the ususal minvar portfolio. And for $\lambda$ in between, a compromise between these two. $\endgroup$
    – nbbo2
    Commented Feb 2, 2018 at 15:28
  • $\begingroup$ @noob2 Yeah, I added a picture from an example simulation. $\endgroup$ Commented Feb 2, 2018 at 15:51
  • $\begingroup$ @MatthewGunn This is very useful thanks. Could you point me towards a resource that demonstrates finding numerical solution in the Lasso case? Maybe an algorithm or pseudocode? Thanks. $\endgroup$ Commented Feb 2, 2018 at 16:04
  • $\begingroup$ Following my above comment am I right in assuming I could use gradient descent or some Newton Raphson based approach to converge on an optimal solution in the convex case? $\endgroup$ Commented Feb 2, 2018 at 16:23
  • 1
    $\begingroup$ @PsychicSteven717 If you use cvx in MATLAB (you'll have to add carriage returns) cvx_begin variables w(k); dual variable u; minimize(quad_form(w, S) + lambda * norm(w, 1)) subject to: u: sum(w) == 1; cvx_end Of course you can find optimization libraries for any language. $\endgroup$ Commented Feb 2, 2018 at 16:27

Your Answer

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

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