Skip to content
All library documents

Why Clipping Negative GMV Weights Does Not Solve the Long-Only Problem

Article Quant Q&A · Author: Eiffelbear

Summary

The document assesses a shortcut for obtaining a global minimum-variance portfolio under a no-short-sale constraint. The shortcut first computes the unconstrained closed-form portfolio, sets negative weights to zero, and renormalizes the remaining weights to sum to one. The responses explain why this generally fails: the unconstrained solution chooses its long positions in combination with short positions, which can hedge risk, so removing the shorts changes the portfolio’s covariance structure and need not leave the best long-only allocation.

The long-only problem is a constrained variance minimization problem and does not share the unconstrained closed-form solution. The document points to convex optimization or iterative procedures as ways to seek a valid constrained solution. One suggested iterative approach repeatedly excludes assets with negative weights and recomputes; another adjusts allocations when a small blend lowers portfolio volatility. These suggestions are presented informally, and the document does not establish their convergence or optimality guarantees.

Key ideas

  • The unconstrained minimum-variance formula allows negative weights and does not solve the long-only problem.
  • Clipping negative weights and renormalizing can discard hedges while leaving a suboptimal allocation.
  • The long-only objective requires solving the variance minimization with nonnegative weight constraints.
  • Iterative adjustments are suggested, but the document does not prove their convergence or global optimality.

Tags

Full text
# Is my python solution good? : Global Minimum Variance portfolio with 'no-short sale' constraint


# Is my python solution good? : Global Minimum Variance portfolio with 'no-short sale' constraint












#### Question

- Is my python code an answer (at least a close answer) to get the weight vector of the Global Minimum Variance portfolio problem? My codes are shown below after some explanations.

#### Details to add

The GMV with no-short sale constraint portfolio problem can be described as below :

$$\boldsymbol{w}_{G M V}=\arg \min \left\{\boldsymbol{w}^\top \Sigma \boldsymbol{w} \enspace : \enspace \boldsymbol{w}^\top \mathbf{1}_{N}=1, \enspace w>0\right\}$$

- $\boldsymbol{w}=\left(w_{1}, \ldots, w_{n}\right)^\top$ is a vector of portfolio weights

- $\Sigma$ is a variance covariance matrix of assets (stocks)

- $\mathbf{1}_{N}$ is a $N$ dimensional vector of ones

The answer to the problem if the short sales are allowed, can be calculated as below :

$$ \boldsymbol{w}_{G M V}=\frac{\sum^{-1} \mathbf{1}_{N}}{\mathbf{1}_{N}^\top \Sigma^{-1} \mathbf{1}_{N}} $$

- According to the question 'Tangent portfolio weights without short sales?' from mathematics stack exchange, we do not have an analytical solution to the GMV problem with no short-sales constraints.

- My python code answer to this is simple ; Set the negative weights in $\boldsymbol{w}_{G M V}$ coming out of the calculation above to 0, and with the rest positive weights, make them sum up to 1. The code is shown as below.

```
cov_df = stock_data_df.cov()
inverse_cov_df = np.linalg.pinv(cov_df)

numerator = np.matmul(np.ones(20).T, inverse_cov_df)
denominator = np.matmul(np.ones(20), (np.matmul(inverse_cov_df, np.ones(20))))
GMV_weight_vector = numerator / denominator

GMV_weight_vector[GMV_weight_vector < 0] = 0
GMV_weight_vector = GMV_weight_vector/(GMV_weight_vector.sum())
```

- The `stock_data_df` has 20 stocks' 252 day-long daily return.

- The last 2 line at the bottom is the line that suffice the 'no-short selling constraint'.

- I am curious to know if these 2 lines are good enough to be consider an answer to the GMV portfolio problem without short-selling constraint.

#### Disclaimer

- Many python libraries such as Pyportfolioopt uses the scipy.minimize function to solve this problem of 'no short-selling constraint', but I am not allowed to use any solver in my assignment.

## Answer by demully (score 2)

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

Sorry to be the bearer of bad news, but this approach is not guaranteed to be the MinVol solution ;-(

The problem is that the long weights are only MV and weighted thus alongside the shorts (which the model thinks it can short-sell to hedge). If you ignore the shorts, then the longs won't then be MV in isolation. There is probably a long-only portfolio with a lower vol. That is not to say your algo isn't a "low vol" solution, of course.

To solve this, there are two possible iterative methods: 1) Run the equation above exactly as you have. Re-sample excluding any assets with a negative weight; and re-run until none are negative.

Else: 2) For each asset, calculate the volatility of a portfolio 1 basis point long that asset and 99.99% the current portfolio. Switch for every asset where the blended mix has a lower vol than the current mix; until none do anymore.

I don't know of any closed-form solutions to this kind of problem; so I suppose what kind of iterative solution qualifies as a "solver" is moot here.

## Answer by develarist (score 1)

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

There is no closed-form analytical solution for the long-only minimum-variance portfolio. Only the the unconstrained (short-sales allowed) portfolio. See here.

Modifying the unconstrained portfolio to become the constrained portfolio in the manner you described is not going to be equal to the true constrained portfolio solution, which must be obtained by convex optimization (quadratic programming).

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.