Skip to content
All library documents

Modeling L1-Regularized Markowitz Portfolios with Split Weights

Article Quant Q&A · Author: user2405694

Summary

The discussion concerns adding an L1 norm penalty to a Markowitz mean-variance portfolio model and asks how to formulate the optimization in MATLAB. The response proposes splitting each portfolio weight into positive and negative components. With the portfolio weight represented as the sum of those components and their signs constrained, the absolute value can be expressed linearly as the positive component minus the negative component. This converts the absolute-value term into a form that standard optimization methods can handle more directly.

The proposed reformulation increases the number of decision variables, but preserves a structure that can be represented with linear constraints. The document does not provide a complete objective function, MATLAB implementation, or guidance on choosing the penalty strength. It also does not explain solver requirements or the need to ensure the positive and negative components do not both become nonzero for one weight; those details matter when translating the idea into a reliable portfolio optimization.

Key ideas

  • An L1 penalty on portfolio weights can be represented by splitting each weight into positive and negative components.
  • Constraining the signs of the components lets the absolute value be expressed linearly.
  • The split-variable formulation increases the size of the optimization problem.
  • The exchange gives a modeling idea but no complete MATLAB solution or penalty-selection guidance.
  • Implementation details must preserve the intended relationship between split variables and portfolio weights.

Tags

Full text
# L1 norm regularization of Markowitz portfolio in matlab


# L1 norm regularization of Markowitz portfolio in matlab












Markowitz portfolio with L1 norm regularization added L1 norm regularization based on the original model. The constraint equation is as follows:

The following code is the original Markowitz Mean-Variance model in matlab.

```
ExpReturn = [0.1 0.2 0.15];

ExpCovariance = [ 0.0100   -0.0061    0.0042
                 -0.0061    0.0400   -0.0252
                  0.0042   -0.0252    0.0225];
NumPorts = 4;

[PortRisk, PortReturn, PortWts] = frontcon(ExpReturn,ExpCovariance, NumPorts)
```

I have just started with Matlab and I don't know how to solve it in matlab.

Or is there any matlab code/toolbox to solve it? thank you!

## Answer by RFC 2549 (score 1, accepted)

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

You can decompose W in W+ and W- Where W = W+ + W- and W+>0 and W-<0. In that case, abs(W) = W+ - W-. That makes a problem 3x bigger but makes it easy to solve.

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.