Trading Dev AcademyFree quant education

Free lesson · Optimization

Read a binding constraint through its shadow price

Open interactive lessonPractice calculationsExplore labs

Start with the idea

A shadow price measures how much the objective could improve if a binding restriction were relaxed slightly.

Symbols, units & horizon
  • λ_u: local objective improvement per extra unit of upper-bound weight
  • μ: expected holding-period return fraction
  • a>0: quadratic penalty
  • u: binding upper weight bound
  • objective is μw−aw²/2 with a nonbinding lower bound

When and why to use this

Explain which portfolio restrictions are costly under the current model before proposing changes.

A shadow price measures how much the objective could improve if a binding restriction were relaxed slightly.

For the scalar quadratic objective, a binding upper bound prevents moving toward the unconstrained optimum. Its local multiplier is the marginal objective benefit at that bound. It is positive when the limit restricts an otherwise attractive increase.

This is sensitivity of a modeled objective, not cash that will certainly be earned. Compare a small finite relaxation against the derivative and recognize that a large relaxation may change which constraints bind.

λu=μ−auwhenu<μa
Local calculus sensitivity and finite-change comparison

Read a binding constraint through its shadow price

  1. For a binding upper limit, substitute w=u into the objective.
  2. Differentiate optimized value μu−au²/2 with respect to u.
  3. Obtain μ−au; it is positive only while the upper limit is below the frictionless optimum.
Work it by hand

μ=.03, a=.1 and u=.2 give λ_u=.01. Raising u by .01 improves objective by approximately .0001; the exact change is .000095.

Apply it in a strategy

  • Freeze inputs at the stated decision time and record their units.
  • Explain which portfolio restrictions are costly under the current model before proposing changes.
  • Recompute the example, then change the material assumption and explain the difference.

Research deliverable

Read a binding constraint through its shadow price: produce the worked calculation, a timestamped input record and a written decision addressing this limitation: A multiplier is local and model-dependent; relaxing a risk rule can introduce unmodeled loss exposure.

These are synthetic mechanics examples, not historical performance or paper replications. Module evidence and research boundaries record the 12 September 2026 review.

Python implementation

Self-contained teaching example. Python 3.10+; dependencies and input conventions are shown in the code and notation. Run in your own Python environment.

# Python 3.10+; standard library and NumPy only.
# Synthetic teaching inputs; conventions and units are defined in the notation above.
def upper_bound_sensitivity(mean,penalty,bound,relaxation):
    if penalty<=0 or relaxation<0 or bound+relaxation>mean/penalty: raise ValueError('Upper bound must remain binding')
    exact=mean*relaxation-penalty*((bound+relaxation)**2-bound**2)/2
    return mean-penalty*bound,exact

shadow,change=upper_bound_sensitivity(.03,.1,.2,.01)
assert abs(change-.000095)<1e-12
print(shadow,change)

Continue learning

Optimization: Feasibility, Costs & Robust Decisions — all lessons
  1. Exposure constraints before optimization
  2. Curvature and a bounded quadratic decision
  3. Derive the fully invested minimum-variance portfolio
  4. Project a desired allocation onto the long-only simplex
  5. Trading costs and a no-trade decision
  6. An uncertainty bound becomes a position penalty
  7. Read a binding constraint through its shadow price
  8. Numerical residuals and independent solution checks

Quantitative finance and development glossary · Python resources and libraries · Research sources and limitations