Skip to content

hasancatalgol/quadratic-programming

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tracking-Error Portfolio Optimization (QP) — Problem Statement

This README describes a realistic active portfolio optimization problem formulated as a convex quadratic program (QP). The goal is to build a portfolio that tracks a benchmark closely while earning at least 60 bps of expected active return (alpha), and respecting simple diversification rules.


Scenario

You manage a portfolio of 5 assets against a benchmark. Let:

  • $w \in \mathbb{R}^5$ be the portfolio weights (decision variables),
  • $b \in \mathbb{R}^5$ be the benchmark weights (given),
  • $\alpha \in \mathbb{R}^5$ be the expected active returns (alphas),
  • $\Sigma \in \mathbb{R}^{5 \times 5}$ be the return covariance matrix.

The optimization minimizes tracking error variance $;(w-b)^\top \Sigma (w-b);$ while delivering expected active return $;\alpha^\top (w-b) \ge 0.006;$ (i.e., $\ge 60$ bps per year).


Data

Assets: Tech, Health, Industrials, Utilities, Consumer

Benchmark weights ($b$):

  • Tech: $0.30$, Health: $0.20$, Industrials: $0.20$, Utilities: $0.10$, Consumer: $0.20$

Expected active returns (alphas, $\alpha$):

  • Tech: $0.012$, Health: $0.006$, Industrials: $0.004$, Utilities: $-0.001$, Consumer: $0.005$

Volatilities (annual stdev, $\sigma$):

  • Tech: $0.25$, Health: $0.18$, Industrials: $0.20$, Utilities: $0.12$, Consumer: $0.16$

Correlations ($\mathrm{Corr}$):

Tech Health Ind Util Cons
Tech 1.00 0.60 0.50 0.20 0.40
Health 0.60 1.00 0.40 0.20 0.30
Ind 0.50 0.40 1.00 0.20 0.30
Util 0.20 0.20 0.20 1.00 0.10
Cons 0.40 0.30 0.30 0.10 1.00

Covariance ($\Sigma$): $$ \Sigma = \operatorname{diag}(\sigma), \mathrm{Corr}, \operatorname{diag}(\sigma) $$


Decision Variables

  • Portfolio weights $w_a$ for each asset $a \in {\text{Tech, Health, Ind, Util, Cons}}$.
  • Box bounds: $0 \le w_a \le 0.50$.

Objective

Minimize tracking error variance: $$ \min_{w} (w-b)^{\top} \Sigma (w-b) $$

(Note: tracking error stdev is $\sqrt{(w-b)^\top \Sigma (w-b)}$; minimizing variance is equivalent and keeps the problem quadratic.)


Constraints

  1. Expected active return target (alpha): $$ \sum_{a} \alpha_a,(w_a - b_a) \ge 0.006 $$

  2. Fully invested: $$ \sum_{a} w_a = 1 $$

  3. Box bounds: $$ 0 \le w_a \le 0.50 \quad \forall a $$

  4. Cyclicals cap: $$ w_{\mathrm{Tech}} + w_{\mathrm{Ind}} + w_{\mathrm{Cons}} \le 0.75 $$

  5. Defensives floor: $$ w_{\mathrm{Health}} + w_{\mathrm{Util}} \ge 0.20 $$


Why This Is a Convex QP

  • The objective $(w-b)^\top \Sigma (w-b)$ is quadratic and convex because $\Sigma$ is a covariance matrix (positive semidefinite).
  • All constraints are linear.
  • There are no integer variables.

Notation Recap

  • $w$: portfolio weights (decision vector).
  • $b$: benchmark weights (given).
  • $\alpha$: expected active returns (per asset) — i.e., expected excess return vs. the benchmark.
  • $\Sigma$: covariance matrix computed from volatilities and correlations.
  • Tracking error variance: $(w-b)^\top \Sigma (w-b)$.

Simple Variants (still QP)

  • Frontier: sweep the target active return level, e.g. $0$ to $0.02$, to trace a TE–alpha efficient frontier.
  • Absolute return version: replace the alpha constraint with a target on total expected return, $\sum_a \mu_a w_a \ge R_{\text{target}}$ (requires expected returns $\mu$).
  • Tracking error budget: maximize $\alpha^\top (w-b)$ subject to $(w-b)^\top \Sigma (w-b) \le \tau^2$.

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages