# Mean-Variance optimization with no short selling

I am wondering how I can find the vector of Lagrange multipliers $$\mu$$ for the non-negativity constraint of the following problem:

$$L(w,\lambda, \mu) = w^{T}\Sigma w - \lambda(w -1) + \mu w$$

So far what I cam up with is, that $$\mu$$ can be isolated with first order condition $$\frac{\partial L }{\partial w}$$:

$$\Sigma w - \lambda = - \mu$$ $$\mu = \lambda - \Sigma w$$

Is there a way I can find a explicit solution for $$\mu$$?

I have no background in finance nor optimization, every suggestion or comment is appreciated, thanks!

• Is $\mu$ the expected returns vector of the assets? Why do you want to solve this when it's just a given input to the model. you should be interested in $w$ (or $\lambda$) only Apr 14, 2020 at 11:05
• $\mu$ is the Lagrange multiplier of the positivity constraint (i.e. w > 0) Apr 14, 2020 at 13:50

You can use Lagrangian only with equal type constaints. There are inqualities in your problem, namely $$w \ge 0$$ and $$w \le 1$$. Hence Lagrange method cannot be employed here.

According to tags you added to the question, you are solving Markowitz optimization problem. One of its formulation (maximizing profit and minimizing risk at the same time) is

$$f = \mu ^T w - \lambda w^T\Sigma w \rightarrow \text{MAX},$$

subjected to $$0 \le w \le 1$$ and $$\sum w_i =1$$. Vector $$\mu$$ contains expected returns of assets in portfolio, $$\Sigma$$ is covariance matrix of returns and parameter $$\lambda$$ is used for setting averse to risk. Higher $$\lambda$$ means higher risk averse.

This task can be solved by so-called quadratic programming.

However, in practice you can employ MS Excel solver. As a solving method, please select GRG Non-linear. This is so-called gradient method and it can cope with quadratic problem task succesfully (this can be even proven mathematically).

• is there another method that can yield an explicit solution? Apr 14, 2020 at 9:00
• @secretsanta: I expanded the answer. Hope this helps. Apr 14, 2020 at 9:12
• thanks, I know I can get the dual variables from such a solver I just wanted to see if there is another way Apr 14, 2020 at 9:27
• are you calling $r$ what he is calling $\mu$? Apr 14, 2020 at 11:06
• @secretsanta: As I mentioned in my answer, Lagrangian method can be used only for optimization with constraints in form of equalities. In your cae $\mu w$ means condition $w=0$ which does not make sense. Apr 14, 2020 at 16:52