Skip to content
All library documents

Cardinality-Constrained Minimum-Variance Stock Selection

Article Quant Q&A · Author: Disciple

Summary

The note reframes the search for an equal-weighted basket of a fixed number of stocks with minimum volatility as a portfolio optimization problem rather than an ordinary knapsack problem. Portfolio variance depends on the full covariance matrix, including cross-asset correlations. Without a return requirement or another constraint, minimizing volatility can lead to an unhelpful solution such as holding cash or concentrating in a single low-volatility asset. The proposed formulation minimizes covariance-based portfolio variance subject to a target expected return, long-only weights that sum to one, and a limit on the number of holdings.

Without a cardinality limit, mean–variance optimization is a convex quadratic program. Requiring a fixed number of selected assets adds integer constraints and makes the problem harder. Suggested practical approaches include solving the unconstrained problem first, then applying search or heuristics to meet the holding limit. For equal weights, a local search can replace one selected stock at a time and keep a replacement if it lowers portfolio variance. These methods can find satisfactory candidates but do not guarantee a global optimum; the note also cautions that search effort grows with the universe size.

Key ideas

  • Portfolio variance depends on covariances among holdings, not just individual volatilities.
  • A return target and portfolio constraints make minimum-variance selection a more useful objective.
  • A fixed limit on the number of holdings adds cardinality constraints to mean–variance optimization.
  • Local search can iteratively replace holdings when the new basket has lower variance.
  • Heuristics may find useful solutions without guaranteeing a global optimum.

Tags

Full text
# Do perpetual futures have initial and variation margins?


# Do perpetual futures have initial and variation margins?












When trading perpetual futures (for example, on crypto), do the concepts of initial and variation margins take place?

I'll expand on my point:

- Perpetual futures without leverage. For example, we want to long on BTC/USDT futures.We first pay some amount of money, let's call it as X, to get into the contract. Further, funding fees should be paid three times a day (00:00, 08:00 and 16:00 UTC): if the funding rate is positive, then longs pay shorts and vice versa. Let the market go against us at the funding time and we have to pay funding fees. Does the system reserve some amount Y at the beginning as an initial margin? Or X plays this role? Further, as we approach the funding time, this margin increases/decreases depending on the market movement? Or do we only add some money if X is not enough in these moments?

That is, in fact, we have different two mechanisms: price X here and "margin". Or am I wrongly thinking of a mechanism to protect against liquidation and it is the SAME mechanism?

- Perpetual futures with leverage.If in the first case it is possible to sell part of the contracts in order to pay funding fees (if the market went against us and we do not have free money), then in the second case leverage can multiply losses. Therefore, it seems that a margin mechanism is necessary here.

Please explain how margin works in perpetual futures, if it exists at all.

## Answer by quantinho (score 1)

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

Your position gets liquidated when Collateral < Maintenance Margin.

Here Collateral = Initial Collateral + Realized PnL + Unrealized PnL. In your example, X = Initial Collateral. After the first funding fee gets credited/debited to your account Realized PnL changes (when price moves Unrealized PnL changes). Suppose, your position is open and you have to pay funding fee for 10 times, your Collateral keeps reducing at each funding fee payment (that will be part of your Realized PnL but essentially X us paying for it).

All you have to do it post collateral and make sure your Margin Ratio is low, the rest will be handled. You do not need any actions for paying funding fee and nothing will be initially reserved.

## Answer by user68819 (score 0)

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

There is definitely a concept of initial margin on crypto exchanges. It is the way they can liquidate you on a leveraged position and 'guarantee' to remain solvent. At most places your IM amount at all times should also cover the upcoming funding payment/receipt, if not, you will be liquidated.

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.