🎯 Mathematical Formulation

Decision Variable
Portfolio Weights: \( w \in \mathbb{R}^n \) = portfolio weights vector
Objective Function
$$\min \; \tfrac{1}{2}\,\lVert R_{6m} w - r_{6m}^{\mathrm{bench}}\rVert_2^2 \;+\; \tfrac{1}{2}\,\lVert R_{12m} w - r_{12m}^{\mathrm{bench}}\rVert_2^2 \;+\; \lambda \sum_{i \in \mathcal{I}} \lvert w_i - w_{\mathrm{prev},i} \rvert$$
Where: ℐ = Intersection set of stocks present in both current and previous universes
Turnover penalty applies only to intersection stocks — new stocks and delisted stocks do not contribute to turnover
📈 Roll Forward Logic for \( w_{\mathrm{prev}} \)
Step 1: Starting Point (Previous Rebalance Date)

Previous rebalance date: 2024-01-22 → Portfolio weights from optimization

gvkeywgt_sol
0010010.40
0010020.35
0010030.25
Step 2: Performance Between Rebalance Dates

Period: 2024-01-22 → 2024-04-22 (next rebalance date)

Calculate cumulative growth for each stock:

cum_growth = ∏(1 + daily_return) over the period
gvkeyCum GrowthNew Weight
0010011.080.40 × 1.08 = 0.432
0010020.950.35 × 0.95 = 0.333
0010031.120.25 × 1.12 = 0.280
Step 3: Renormalization

Renormalize to sum = 1.0:

Sum = 0.432 + 0.333 + 0.280 = 1.045
gvkey\( w_{\mathrm{prev}} \) (rolled forward)
0010010.432 / 1.045 = 0.413
0010020.333 / 1.045 = 0.319
0010030.280 / 1.045 = 0.268
🔗 Intersection Logic for Turnover Control
Current vs Previous Universe Comparison
📊 Previous Universe (\( w_{\mathrm{prev}} \))
001001: 0.413
001002: 0.319
001003: 0.268
001004: 0.000 (delisted)
🎯 Current Universe (\( w \))
001001: \( w_1 \) (solving for)
001002: \( w_2 \) (solving for)
001003: (filtered out)
001005: \( w_3 \) (new stock)
⬇️ Intersection Calculation
📍 Intersection Set \( \mathcal{I} = \{001001,\,001002\} \)
Only these stocks appear in BOTH current and previous universes
Turnover penalty and constraint apply ONLY to intersection stocks
📊 Matrix and Vector Construction (Vector-First Approach)
Step 1: Raw Input Data
📈 data_bench (TIPS yields)
DateT10YIE
2024-01-010.0234
2024-01-020.0241
......
2024-01-080.0237
2024-01-090.0245
📅 126/252 trading days needed for lookback
📊 data_tr (Stock returns)
Dategvkeytr
2024-01-080010010.015
2024-01-080010020.009
2024-01-080010030.021
🔍 Thousands of rows, filtered by baseline
🎯 baseline (Universe filter)
gvkeywgt
0010010.40
0010020.35
0010030.25
⚡ Only selected stocks from data_tr
Step 2: Build Benchmark Vector FIRST (Establishes Master Calendar)

🎯 TIPS Yield Vector Construction

🏛️ TIPS Benchmark: Treasury Inflation-Protected Securities (10-Year Breakeven Inflation Rate)

Input: data_bench, rebal_date=2024-01-22, lookback_days=126

lookback_dates = last 126 trading days before 2024-01-22
IndexDateTIPS Yield
[0]2024-01-080.0237
[1]2024-01-090.0245
[2]2024-01-100.0239
.........
[125]2024-01-220.0241

✨ Output:

  • \( r_{6m}^{\mathrm{bench}} \in \mathbb{R}^{126} \) = Last 126 trading days of TIPS yields before rebalance date
  • \( r_{12m}^{\mathrm{bench}} \in \mathbb{R}^{252} \) = Last 252 trading days of TIPS yields before rebalance date
Step 3: Build Stock Matrix Using Same Dates (Forced Alignment)

📊 Stock Return Matrix Construction

Input: data_tr, baseline, required_dates (from TIPS vector!)

1. Filter universe: baseline selects only 3 stocks from available data_tr

2. Initialize matrix: (126 dates × 3 stocks) filled with zeros

3. Fill column by column using EXACT same dates as TIPS vector:

Date001001 (Stock A)001002 (Stock B)001003 (Stock C)
2024-01-080.0150.0090.021
2024-01-09-0.0120.0180.005
2024-01-100.008-0.0030.000
............
2024-01-220.0060.0160.012
  • \( R_{6m} \in \mathbb{R}^{126 \times n} \) = Stock returns matrix using exact same 126 dates as benchmark vector
  • \( R_{12m} \in \mathbb{R}^{252 \times n} \) = Stock returns matrix using exact same 252 dates as benchmark vector
  • Missing stock data on any date → filled with zeros
  • Only stocks in baseline universe included (filtered from larger data_tr)
Constraints
1. Fully Invested
$$\sum_{i=1}^{n} w_i = 1$$
2. Long-Only
$$w_i \ge w_{\min} \quad \forall i$$
3. Position Limits
$$w_i \le w_{\max} \quad \forall i$$
4. Baseline Multiplier Bounds
$$\ell_i \, w_i^{\mathrm{base}} \le w_i \le u_i \, w_i^{\mathrm{base}} \quad \forall i$$
(DISABLED: multiplier_bounds = None)
5. Portfolio Beta Constraints
$$\beta_L \le \sum_{i=1}^{n} \beta_i\, w_i \le \beta_U$$
(DISABLED: beta_bounds = None)
6. Sector Allocation
$$\left|\sum_{i \in S} w_i - \theta_S\right| \le \delta\,\theta_S \quad \forall \text{ sectors } S$$
(DISABLED: sect_max_diff = None)
7. Turnover Constraint (Intersection Only)
$$\sum_{i \in \mathcal{I}} \left|\,w_i - w_{\mathrm{prev},i}\,\right| \le T_{\mathrm{cap}}$$
Where: ℐ = Intersection of current and previous stock universes
Example: \( |w_1 - 0.413| + |w_2 - 0.319| \le 0.05 \)
📊 Strategy Performance Results
Rolling Portfolio Metrics Dashboard
Performance Dashboard showing Rolling Beta, Tracking Error, and Turnover metrics

Key Performance Insights:

  • Rolling Beta Analysis: Strategy maintains variable inflation beta, with notable spikes during crisis periods (2008-2009, 2020). The 252-day beta provides more stable long-term exposure while 126-day beta captures short-term regime shifts.
  • Tracking Error Control: Annualized tracking error ranges from 5-40%, demonstrating effective inflation tracking. Higher volatility during market stress periods is expected for this type of strategy.
  • Turnover Management: Excellent adherence to 5% turnover cap across most periods, with one notable exception around 2013 (~11%) likely due to significant inflation regime change.
Solution Method
Convex Quadratic Programming (QP):
  • Solver: ECOS (primary), OSQP, SCS, CLARABEL (fallback)
  • Tolerance: feastol = 1e-3, abstol = 1e-3, reltol = 1e-3
  • Max iterations: 100,000
  • Warm start: Disabled for stability
📊 Strategy Performance Results
Rolling Portfolio Metrics Dashboard
Performance Dashboard showing Rolling Beta, Tracking Error, and Turnover metrics

Key Performance Insights:

  • Rolling Beta Analysis: Strategy maintains variable inflation beta, with notable spikes during crisis periods (2008-2009, 2020). The 252-day beta provides more stable long-term exposure while 126-day beta captures short-term regime shifts.
  • Tracking Error Control: Annualized tracking error ranges from 5-40%, demonstrating effective inflation tracking. Higher volatility during market stress periods is expected for this type of strategy.
  • Turnover Management: Excellent adherence to 5% turnover cap across most periods, with one notable exception around 2013 (~11%) likely due to significant inflation regime change.
Sector Evolution Analysis
Sector Weight Evolution showing dynamic allocation across GICS sectors over time

Sector Allocation Strategy:

  • Consumer Staples Dominance (30): Consistently largest allocation (15-35%), reflecting defensive positioning and pricing power during inflationary periods. Peak allocation during 2009-2011 crisis demonstrates flight-to-quality behavior.
  • Energy Sector Cyclicality (10): Highly variable allocation (0-12%) driven by oil-inflation correlation. Zero weights during certain periods suggest complex energy-inflation dynamics requiring careful timing.
  • Technology Sector Decline (45): Reduced allocation over time from ~27% to ~10%, reflecting growth stock vulnerability to inflation and rising rates. Strategy correctly identifies tech's inflation sensitivity.
  • Defensive Sector Focus: Utilities (55), Health Care (35), and Real Estate (60) maintain steady allocations, providing inflation hedging through regulated pricing mechanisms and essential service characteristics.
  • Industrial Sector Growth (20): Increasing allocation over time, likely capturing infrastructure benefits and commodity exposure that correlate with inflation expectations.
  • Financial Sector Volatility (40): Moderate but variable allocation reflecting complex relationship between inflation, interest rates, and financial sector performance.

🎯 Strategic Insights from Sector Evolution

The sector allocation patterns reveal a sophisticated understanding of inflation hedging:

  • Defensive Tilt: Heavy weighting toward sectors with pricing power and essential products/services
  • Growth Stock Avoidance: Systematic reduction in growth-sensitive sectors vulnerable to rising rates
  • Regime Awareness: Dynamic allocation adjusts to changing inflation environments and market cycles
  • Quality Focus: Concentration in established sectors with predictable cash flows and inflation pass-through ability
Risk Management Framework
Position Risk Controls
  • Min weight: \(1\times 10^{-5}\) (effectively zero)
  • Max weight: 7% (concentration limit)
Quality Filters
  • GRR (Geographic Risk Rating) ≥ 1.5
  • Quarterly rebalancing (Jan, Apr, Jul, Oct)
  • Last trading day of each quarter
Transaction Cost Management
  • Turnover penalty: \( \lambda = 10^{-4} \)
  • L1 norm penalty on weight changes
Data Integrity
  • Missing data → zero fill
  • Negative weights → clamp to zero
  • Weight sum validation (= 1.0)

🎯 Inflation-Tracking Portfolio Optimization

A sophisticated quantitative strategy for hedging inflation risk through equity portfolio construction