Skip to content

Calibration Constants

Hoda Rezvanjoo edited this page May 28, 2026 · 1 revision

Every hand-tuned numeric constant in the engine, where it lives, what it does, and what changes when it moves. See docs/CALIBRATION.md for the long-form companion.

Module 1

Constant Value Where Effect when changed
MAX_REASONABLE_BUDGET 1 × 10⁹ module1.py Catches unit errors. Raise only if you legitimately run >£1bn campaigns.
test_and_learn_pct max 0.5 wizard_state.py Cap on carve-out. Higher leaves the LP with nothing to do.
seasonality_index clamp [0.1, 10.0] module1.py Out-of-range multipliers are usually unit errors.

Module 4

Constant Value Effect
CPU_OUTLIER_MULTIPLE 100.0 CPU > 100× the per-goal median is dropped. Lower = more aggressive filtering.

Module 5

Constant Value Effect
YIELD_BRACKETS [(0.25, 1.0), (0.35, 0.65), (0.40, 0.35)] Diminishing returns. Steeper drop-off → more diversification.
SHRINKAGE_KAPPA 30 Days at which a platform's own history weights 50/50 against the prior.
DEFAULT_MC_TRIALS 200 Monte Carlo default. Slider exposes 50–1000.
DEFAULT_INSTABILITY_CV 0.20 Allocation CV above this flags a platform as unstable.
Scenario multipliers conservative 1/1.2, base 1.0, optimistic 1.15 Budget scaling per scenario.

Module 6

Constant Value Effect
DEFAULT_UNCERTAINTY_BAND 0.30 Fallback band when no observations and no history.
_REFERENCE_WINDOW_DAYS 30.0 The window the default band represents.
_MIN_BAND 0.05 Floor — below this is false precision.
_MAX_BAND 1.00 Ceiling — above this is useless.

Module 7 (Module7Policy)

Field Default Effect
corner_concentration 0.90 Top-platform share for "Corner-dominant" classification.
balanced_concentration 0.75 Top-platform ceiling for "Balanced".
corner_max_nonzero_cells 2 Max funded cells for a corner solution.
confidence_floor 40 Confidence never goes lower.
dq_small_kpi_share 0.50 Triggers data-quality flag when ≥50% of count-KPI forecasts are below threshold.
dq_small_kpi_threshold 5.0 Forecast count below this is "small".
plan_b_top_platform_cap 0.70 Diversification cap on Plan B.
plan_b_meaningful_tradeoff_pct 5.0 Trade-off (%) above which Plan B is surfaced prominently.
All confidence_*_penalty fields various Deductions from the 100-point starting score.

Changing a constant safely

  1. Run pytest -q first to record the green baseline.
  2. Make the change.
  3. Run pytest -q again — note which tests fail. Most "regressions" are the engine doing what you asked.
  4. Run PYTHONPATH=. python tests/behavioural_check.py and skim the end-to-end output for any sign the change broke the story the engine tells, not just the numbers.

Clone this wiki locally