Portfolio Intelligence Engine
8 Optimization Algorithms. One Architecture.
A deliberate spectrum, not a kitchen sink. One naive baseline. Six ways to engineer risk. One return-aware engine, stabilized with shrinkage. Each algorithm targets a distinct portfolio construction goal — and the imbalance between risk-engineering and return-engineering is intentional, because return forecasts are noisier than risk estimates.
Tier 1 — Foundation
The Naive Baseline
Every optimizer in finance is benchmarked against equal weight. DeMiguel, Garlappi & Uppal (2009) showed that 14 of 14 sophisticated optimization strategies failed to consistently beat 1/N out of sample. We start here — not as a gimmick, but as the honest reference point against which the rest of the engine library must justify itself.
Equal Weight
1/NAssigns identical weight to every eligible asset. The simplest allocation rule — and the hardest to beat. No optimization, no estimation error, no model risk. The DeMiguel et al. (2009) benchmark that 14 of 14 'optimal' strategies failed to consistently outperform out of sample. With asset class bounds, the platform applies partitioned construction: equal weight within each class, with cross-class allocation at preset midpoints.
Best for: Maximum simplicity. Zero estimation risk. The honest baseline.
Tier 2 — Risk Engineering
Six Ways to Engineer Risk
Six engines, six distinct philosophies of how to control risk without forecasting return. Minimize total volatility. Equalize risk contribution. Allocate risk by class. Cluster by correlation. Maximize diversification benefit. Or target the tail. Each uses only the covariance structure — eliminating the largest source of estimation error in quantitative finance.
Minimum Variance
MinVarFinds the portfolio with the lowest possible volatility — the leftmost point on the efficient frontier. Pure risk minimization using only the covariance structure. SLSQP solver minimizes ½·w'Σw subject to full investment, long-only, position bounds, and bucket bounds. Uses analytical gradients (∇ = Σw) for fast convergence. Supports vol targeting via quadratic inequality constraint and turnover penalty via L1 regularization.
Best for: Capital preservation. Defensive allocation. The lowest-risk portfolio achievable within your constraint set.
Risk Parity (ERC)
CCDEqualizes every asset's contribution to total portfolio risk. Each position carries the same marginal risk — true balance. The mathematical foundation of all-weather portfolios used by Bridgewater and other institutional allocators. Solves via Spinu's Cyclical Coordinate Descent on ½·x'Σx − Σ(1/N)·ln(x_i), then normalizes. High-volatility assets receive lower weight; low-volatility assets receive higher weight.
Best for: Balanced risk allocation. All-weather portfolios. Investors who believe risk balance matters more than return optimization.
Risk Budgeting
BudgetGeneralizes Risk Parity: where ERC sets all budgets equal, Risk Budgeting lets you choose the allocation of risk per asset class. Minimizes Σ_{i<j}(RC_i/b_i − RC_j/b_j)² so that risk contributions are exactly proportional to the chosen budgets. Key insight: a 60% equity risk budget does NOT produce 60% equity weight — because equities are more volatile, the engine allocates less weight to hit the 60% risk contribution target.
Best for: Custom risk profiles. Bucket-level risk control. Specifying how much risk comes from each asset class.
Hierarchical Risk Parity
HRPLópez de Prado's machine-learning-inspired allocation: cluster assets by correlation distance d = √(½·(1−ρ)), build a Ward-linkage dendrogram, quasi-diagonalize the covariance matrix, then allocate via recursive bisection weighted by inverse cluster variance. Works when Markowitz fails — never inverts the covariance matrix, so it's immune to the matrix instability that plagues classical methods on large universes.
Best for: Robust diversification. Unstable markets. Large universes where covariance matrix inversion is unreliable.
Maximum Diversification
MaxDivMaximizes the diversification ratio DR = (σ'w) / √(w'Σw) — the ratio of weighted average asset volatilities to total portfolio volatility. A higher ratio means more diversification benefit is captured. Equals 1.0 for a single-asset portfolio and increases as imperfectly correlated assets are combined. Assets with low correlation to the rest of the portfolio receive higher weight; highly correlated assets are consolidated.
Best for: Diversification-seeking allocation. Maximizing the structural benefit of combining imperfectly correlated assets.
Minimum CVaR
CVaRWhere volatility measures average dispersion, CVaR focuses on tail risk: the expected loss in the worst (1−β) fraction of historical scenarios. Default β=95%, so the engine minimizes the average loss conditional on being in the worst 5% of return outcomes. Uses the Rockafellar-Uryasev linear programming reformulation: minimize α + (1/(T·(1−β)))·Σ_t z_t with auxiliary loss variables. Directly targets catastrophic drawdowns rather than average volatility.
Best for: Tail risk protection. Drawdown minimization. Investors who care more about worst-case losses than average dispersion.
Tier 3 — Return Engineering
One Engine. Two Layers of Shrinkage.
The platform deliberately ships only one return-aware engine. Why? Return forecasts are notoriously unstable: small input changes produce large weight swings, and historical means are poor predictors of future returns. Robust Mean-Variance attacks both estimation problems at the source — Ledoit-Wolf shrinks the covariance matrix toward stability, James-Stein shrinks return estimates toward the grand mean. The result is the only mean-variance optimization we trust to ship.
Robust Mean-Variance
LW+JSThe only return-aware engine in the platform — and it's stabilized for a reason. Classical mean-variance fails out of sample because both inputs (returns and covariance) are noisy. Robust MV addresses both at the source. Σ is shrunk via Ledoit-Wolf Oracle Approximating Shrinkage toward a structured target; μ is shrunk via James-Stein toward the grand mean. The risk-aversion parameter λ (configurable 0.1–1.0) tunes how aggressively the engine seeks return versus minimizes variance. The result degrades gracefully when estimates are imprecise.
Best for: Growth-oriented allocation with statistical guardrails. Investors who want to target returns but distrust raw historical estimates.
Risk Estimation
EWMA Covariance (λ=0.97)
Exponentially weighted covariance with ~23-day half-life. Captures recent market structure while maintaining stability. 504-day estimation window. Annualized. Used by every risk-aware engine.
Ledoit-Wolf OAS Shrinkage
Oracle Approximating Shrinkage for covariance matrices. Automatically determines optimal shrinkage intensity toward a structured target. Used exclusively by Robust Mean-Variance to stabilize the covariance input.
James-Stein Return Shrinkage
Shrinks expected returns toward the grand mean, reducing extreme outliers that produce concentrated portfolios. Shrinkage intensity scales with estimation uncertainty. Used exclusively by Robust Mean-Variance.
Constraint Framework
Every optimization runs through a constraint system that enforces allocation discipline. Per-asset position bounds. Asset-class bucket bounds (equities, bonds, credit, real assets, cash). Concentration limits (HHI cap, effective N floor, top-5 weight cap). Volatility targeting via dual-path — solver constraint for SLSQP engines, post-optimization scaling to cash for structural engines like HRP and CVaR. Turnover penalty via L1 regularization in the objective (SLSQP engines only). Pick a preset for a ready-made bundle, or run Unconstrained for pure engine behavior — every solve is logged and auditable.
Defensive
Constraint Preset
Balanced
Constraint Preset
Growth
Constraint Preset
Unconstrained
Constraint Preset
8.5-Stage Pipeline
From raw market data to versioned artifacts. Every stage is deterministic and reproducible.