Skip to content
All library documents

Long-Only Mean-Variance Portfolios and Quadratic Programming

Article Quant Q&A · Author: secretsanta

Summary

The document addresses a question about Lagrange multipliers for non-negativity constraints in a mean-variance portfolio problem. The response describes the allocation problem as maximizing expected return less a risk penalty, subject to fully invested and long-only weight constraints. It identifies the covariance matrix as the risk input and the risk-aversion parameter as the control for the return-risk tradeoff.

It recommends quadratic programming for this formulation and mentions a spreadsheet solver as a practical alternative. However, its treatment of the constraints is incomplete: inequality constraints can be handled with Lagrange multipliers through the Karush-Kuhn-Tucker conditions, and the multiplier values depend on which constraints bind at the solution. The document does not derive those conditions or give an explicit multiplier solution, so it offers only a broad optimization direction rather than resolving the original question.

Key ideas

  • Mean-variance allocation combines expected returns with a covariance-based risk penalty.
  • Long-only portfolio weights are constrained to be non-negative and sum to one.
  • The risk-aversion parameter controls the strength of the risk penalty.
  • Quadratic programming is a standard approach for the constrained allocation problem.
  • The answer does not derive the inequality-constraint multipliers or their binding conditions.

Tags

Full text
# Mean-Variance optimization with no short selling


# 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!

## Answer by Martin Vesely (score 4)

https://quant.stackexchange.com/a/53284

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).

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.