Skip to content
All library documents

Controlling Portfolio Leverage with an L1 Penalty

Article Quant Q&A · Author: renato

Summary

The document explains how to manage leverage in a mean-variance portfolio optimization with active weights. It reframes holdings as total portfolio weights and adds a penalty proportional to the sum of their absolute values. This absolute-value term is an L1 or lasso penalty: increasing its strength discourages portfolios with larger gross exposure, including short positions.

The answer also shows how to rewrite an active-risk objective in terms of total holdings while preserving linear constraints. It suggests that varying the penalty parameter can control leverage indirectly within a quadratic optimization setup. The discussion is conceptual and includes assumptions about the benchmark and constraints; it does not provide solver-specific implementation details or demonstrate numerical results. The original question’s proposed leverage equality and the answer’s penalty formulation are not identical: a penalty encourages lower gross exposure but does not guarantee a particular leverage level, so an exact target may require additional optimization machinery.

Key ideas

  • An absolute-value penalty on total portfolio weights discourages high gross exposure.
  • The penalty strength controls the tradeoff between the original objective and leverage reduction.
  • Rewriting active weights as total holdings can put the optimization into a lasso-style form.
  • A lasso penalty encourages lower leverage but does not by itself enforce an exact leverage target.

Tags

Full text
# Leverage constraints


# Leverage constraints












I am trying to complete my project on Mean-Variance Leverage Optimization, and I have found lots of helpful advice on this forum. I wanted to ask you if you have some idea on how to implement a leverage constraint, I will try and explain myself in more detail.

My starting point: I have a starting set of constraints for the Optimization is to build an EAE portfolio like the one proposed by Jacob and Levy here Traditional Optimization is not optimal for Lvg Averse investor. So I did try to implement this using a QP optimization in Matlab and my code so far it seems working...

However when I perform my quadratic optimization I don't use any constraints on the leverage term, thus I get a set of active weights constrained by dollar neutrality and market neutrality plus some lower bound and upper bound that is +- 0.1 of the benchmark weight. -this gives different level of leverage associated with different expected active return-. Now my question is ...how do I impose constraints on the level of leverage maintaining the constraints imposed by the EAE portfolio construction? i.e I want to find different efficient frontier for different level of lvg for example setting lvg = 0.10-0.20-0.30 ecc

$\sum_{i=1}^N x_i = 0$

$\sum_{i=1}^N x_i \beta_i= 0$

$b_i-0.10 \le x_i \le b_i+0.10$

$\sum_{i=1}^N |h_i| -1 =\Lambda$

Edit: I uploaded a picture to make it clearer..hope it works..So in the first 3 lines there are my constraints.. where x stands for the active weight and b for the benchmark weight. I forgot to mention that h = x + b; So what i would like to achieve is to impose different level of leverage..leverage is the last equation with the h in absolute value.

// [2]: https://i.sstatic.net/hP9ap.png

## Answer by Attack68 (score 1)

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

Since you are running a QuadraticProgram (QP) I'll assume your objective function is of the form:

$$ \min_x \quad f(x) = (b+x)^T Q (b+x) + P (b+x) \;,$$

where $b$ are the known market weights and thus $\delta^T b = 1$. $x$ is interpreted as a deviation in asset holding from the given market portfolio.

You have specified the constraints as:

- 1) $ \delta^T x = 0 $: the sum of $x_i$ is zero.

- 2) $ \beta^T x = 0 $: unknown, no definition of $\beta$ given.

- 3) $ b - 0.1 \leq x \leq b + 0.1$: I think this should be: $-0.1 \leq x \leq 0.1$

Now you want to have some control over your leverage which you define as:

$$ \Lambda = \delta^T|b-x| - 1 \;.$$

Personally, I would re-express this solving for $y=b+x$:

$$ \min_y \quad f(y) = y^TQy + Py + \gamma |y|$$ subject to: $$ \delta^T y = 1 $$ $$ \beta^T y = \beta^T b $$ $$ b-0.1 \leq y \leq b + 0.1 $$

Notice the inclusion of the term $\gamma |y|$. In common optimization terminology this is known as a lasso term. It is a form of regularisation and its strength can be controlled by the hyper-parameter $\gamma$.

The lowest this term will ever be is $\gamma$ when all elements of $y$ are positive. However, when an asset is short sold, permitting an increase in holding of another asset then this value will increase (and is thus factored into the minimisation). Note that I assume for $b$ no asset is short sold. Practically this might also make your third constraint moot, since it seems to me that is a manual attempt at regularisation to ensure you don't get much leverage, but you can achieve the same result by using only the lasso term.

#### edited for comment:

you are concerned about total variance or active variance. However, consider the problem of active variance (which is only a slight variant of the above and I assume is related to the following form):

$$ \min_x \quad f(x) = x^TQx + Px + \gamma |b + x| $$

subject to: $g_i(x) = 0$, $h_i(x) \leq 0$.

Again you can quickly and easily reconfigure this to:

$$ \min_y \quad f(y) = (y-b)^TQ(y-b) + P(y-b) + \gamma |y|$$ $$ \quad \implies f(y) = y^TQy + (P -2b^TQ)y + \gamma |y| \quad [+ const.]$$ subject to: $g_i(y-b) = 0$, $h_i(y-b)=0$,

and again you have the traditional lasso format, which I only mention since some optimizers are specifically build to handle this kind of problem optimally, (although for a small scale problem it won't matter)

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.