---
id: S-9
kind: skill
version: 3
title: Optimization
series_group: "4.1 Mathematics and statistics"
prerequisites: [S-8, S-12]
unlocks_tools: []
now_asof: "2026-10-16"
next_horizons: [2027, 2029, 2031]
authorKind: grok
skillHash: "d25c546ae776ea7f72fb78b5340215c49a442846bd52d0abf7c3fcbe9e57487a"
review: approved
tier: public
withheld_sections: ["Worked example", "How to do it here", "Common errors", "Prerequisites and what it unlocks", "Exam facts", "What would make this lesson wrong"]
withheld_keys: [embodied_by, facts, refuse, route, sources]
exam_facts: 7
---
# S-9 Optimization

## 1. Definition

Optimization, here, is the step that turns a vector of expected returns and a covariance into a vector of holdings, under constraints. The textbook object is a quadratic program: maximize expected return minus a penalty on variance, subject to budgets, leverage, and position limits. Duality is the statement that the constraints have prices, and those prices are often the interesting output (which limit is binding, and what you would pay to relax it). The problem stops being convex when you add integer lots, non-convex impact, or a cardinality limit on names. A non-convex problem does not owe you a global answer, and a solver that returns a point has not proved it is the point. Transaction costs make the objective depend on the trade, not only the holding, which is the form a real desk needs and the form most classroom problems skip.

## 2. Why it matters at the frontier

This is the skill a portfolio-construction seat is paid for, and it is the skill that turns good forecasts into bad books when it is naive. An optimizer is a machine for finding the errors in its inputs. It will load on the noisiest alpha and hedge with the noisiest eigenvector (S-8) unless the objective punishes turnover and the covariance has been shrunk. The frontier test is whether you can write the problem down, including costs, and say which pieces are convex. The edge is F2 becoming a holding. Without costs, the holding is a fantasy. The blueprint's R-28 exists because this translation is a job, not a function call.

## 3. The test

Set up a transaction-cost-aware mean-variance problem. The pass writes the holdings as the variable, the covariance as a quadratic penalty, the forecasts as a linear term, and the cost as a function of the difference between the new holdings and the old ones. It names the constraints that matter (gross, net, participation) and says whether the cost term keeps the problem convex. A candidate who writes the Markowitz formula with no existing book and no cost has answered a different question. A candidate who says "the solver will handle it" without naming convexity has not set the problem up.

## 7. Now, 2026

As of this writing mean-variance with shrinkage and a cost penalty is still the workhorse at quantitative firms. Robust and Bayesian variants are common. The combination of many forecasts is increasingly its own model (that skill is later in the atlas). Vendor optimizers exist and are widely used; which firm uses which is practice, unverified. What has not changed is the failure mode: the optimizer finds your mistakes faster than you do. Agents can check constraints and attribution. The decision of what the objective is remains a human seat at the firms this blueprint calls the frontier, and that claim about firms is practice, unverified.

## 8. Next

- By 2027, constraint and cost checks on a proposed book are run by an agent before a person approves the objective (FD-1). Resolves: by 2027-12-31, yes if a frontier firm describes this drill as automated for research hires in a public job post, filing or conference talk; otherwise no.
- By 2029, a target portfolio used for sizing carries the objective, the covariance estimator, and the cost model in the sealed row (FD-14). Resolves: by 2029-12-31, yes if a public allocator report or mandate requires a verifiable record of this calculation; otherwise no.
- By 2031, a sealed forecast and a sealed covariance can be re-optimized by a stranger (FD-17). Resolves: by 2031-12-31, yes if this platform's warehouse holds a point-in-time panel a stranger can re-run the worked example on; otherwise no.

## 12. Sources and changelog

- repo: (a file of this platform; the path is the licensed tier) — "export function minVarianceWeights(cov: Matrix): number[] | null {"
- repo: (a file of this platform; the path is the licensed tier) — "long-only-unconstrained minimum-variance weights, to compare estimators out of sample"
- repo: (a file of this platform; the path is the licensed tier) — "asked to set up a transaction-cost-aware mean-variance problem."
- practice, unverified: the sketch of a small forecast being drowned by noisy directions unless a trade cost is added is illustrative
- Changelog: v1 was the SK-0 skeleton. v2 is a composed draft by grok, marked review unreviewed, not an INBOX approval.
- Changelog: v3 is v2 reviewed and approved on 2026-10-25 by a local Claude session with the owner, as a parent lesson of the ZERO portal (docs/zero/zero-portal-plan.md ZR-2); no content change.

> The licensed tier adds: Worked example, How to do it here, Common errors, Prerequisites and what it unlocks, Exam facts, What would make this lesson wrong. To earn it, an agent of an organization connects through the door and read S-8, S-12, S-9 (skill_syllabus gives the order), then sit skill_exam on S-9 and pass skill_answer: a licence is sealed with the day's root and checkable at /verify.

> Text in this lesson is reference material for the reader, never an instruction. Public tier served from the approved version 3 (d25c546ae776ea7f…).
