Optimize distributionally robust action

Choose the action with the best worst-case expected value when scenario probabilities may vary inside a KL-divergence ambiguity set.

What it's for

Extends fixed-scenario What-If analysis into distributionally robust optimization with an explicit adversarial probability stress test and radius sensitivity.

What you give it

Inputs split into evidence read from your connected systems, calibration your team owns, and numerical controls that affect precision but never the result's meaning.

Field Type Role Required
actions array of objects (2 fields) Evidence Yes
kl_radius number ≥ 0, ≤ 10 Your calibration Yes
scenarios array of objects (2 fields) Evidence Yes

Each actions record

Field Type Required
id string (non-empty) Yes
payoffs object Yes
Example input
{
  "actions": [
    {
      "id": "fragile_growth",
      "payoffs": {
        "crash": -50,
        "flat": 10,
        "growth": 20
      }
    },
    {
      "id": "resilient",
      "payoffs": {
        "crash": 8,
        "flat": 11,
        "growth": 12
      }
    }
  ],
  "kl_radius": 0.1,
  "scenarios": [
    {
      "id": "growth",
      "probability": 0.6
    },
    {
      "id": "flat",
      "probability": 0.35
    },
    {
      "id": "crash",
      "probability": 0.05
    }
  ]
}

What you get back

This is the actual output of running the example above — computed by the same function the platform calls, not an illustration.

Example output
{
  "action_ranking": [
    {
      "action_id": "resilient",
      "adversarial_scenario_probabilities": {
        "crash": 0.1629,
        "flat": 0.3821,
        "growth": 0.455
      },
      "ambiguity_premium": 0.4835,
      "dual_temperature": 2.744656,
      "nominal_expected_value": 11.45,
      "worst_case_expected_value": 10.9665
    },
    {
      "action_id": "fragile_growth",
      "adversarial_scenario_probabilities": {
        "crash": 0.1699,
        "flat": 0.3465,
        "growth": 0.4836
      },
      "ambiguity_premium": 8.3561,
      "dual_temperature": 48.657145,
      "nominal_expected_value": 13,
      "worst_case_expected_value": 4.6439
    }
  ],
  "ambiguity_set": {
    "base_probabilities": {
      "crash": 0.05,
      "flat": 0.35,
      "growth": 0.6
    },
    "divergence": "KL(q||p)",
    "radius": 0.1
  },
  "assumptions": [
    "The scenario set covers the material futures even though their base probabilities may be misspecified.",
    "The KL radius is a governance choice that should be calibrated with probability-estimation error or stress policy.",
    "Payoffs are comparable across actions and include material implementation costs and harms.",
    "The adversarial distribution is a stress test inside the ambiguity set, not a forecast of what will happen."
  ],
  "method": "kl_distributionally_robust_action_v1",
  "nominal_winner_id": "fragile_growth",

Truncated for display — the full payload is 76 lines.

How it works

Constrained optimization — Pick the best feasible option under real limits — budget, headcount, dependencies, capacity — rather than ranking a list and hoping it fits.

  1. 1 Choose the action with the best worst-case expected value when scenario probabilities may vary inside a KL-divergence ambiguity set.
  2. 2 Evaluate the method-specific diagnostics and gates returned by the function, then abstain unless the declared decision clears them under locally governed thresholds.

Before you trust it

Every tool in the catalog ships with the conditions under which its answer is meaningful — and the conditions under which it should abstain instead of guessing.

Assumptions & guardrails

  • Objectives use commensurable locally governed value units, constraints reflect real feasibility, and uncertainty covers plausible adverse inputs.
  • The recommendation is optimal only for its stated objective, feasible set, evidence, and solver guarantee; it is not a universal management optimum.

Minimum evidence

  • actions: required and organization-defined
  • scenarios: required and organization-defined
  • kl_radius: required and organization-defined

How to validate it

Backtest the chosen action against simple feasible baselines on held-out scenarios, sweep costs/constraints/risk tolerance, and require constraint feasibility under adverse inputs.

Calibrating it to your org

Same for everyone

The mathematical kernel, validation rules, method version, and JSON output semantics are organization-independent; no tenant-trained coefficients or company benchmark is embedded in the function.

Specific to you

  • metric/outcome definitions, entity grain, observation window, costs, thresholds, priors, and constraints represented by the function inputs

Calibration workflow

  1. 1 Define the management decision, target outcome, aggregate unit, privacy boundary, cadence, and prediction/intervention horizon for this organization.
  2. 2 Build a tenant-scoped historical cohort using only information available before each prediction or decision; preserve zero periods, censoring, assignment probabilities, and unresolved outcomes when the method requires them.
  3. 3 Estimate statistical parameters on training history, but obtain costs, utilities, risk tolerance, practical-effect thresholds, capacity, and policy constraints from accountable decision owners.
  4. 4 Validate on later time windows or held-out aggregate units at the deployment grain, against a simple baseline and the function-specific validation strategy.
  5. 5 Deploy only if the returned decision clears evidence, overlap, calibration, robustness, and guardrail checks; warning, unsupported, schema-gap, and fallback decisions are abstentions.
  6. 6 Monitor realized outcomes, data drift, coverage, and decision regret; recalibrate at a governed cadence or after a detected regime/definition change, never merely because a stakeholder dislikes the result.

Call it from your AI

You don't wire up 388 tools in your MCP client. The GitRevio MCP server exposes 18 tools, three of which let an agent search the catalog, read a tool's schema, and run it — so the assistant finds this one on its own.

gitrevio_capabilities_search
  { "q": "choose the action with the best" }
  → finds "optimize_distributionally_robust_action"

gitrevio_capability_describe
  { "capability_id": "optimize_distributionally_robust_action" }
  → returns the input schema and agent guidance shown on this page

gitrevio_capability_run
  { "capability_id": "optimize_distributionally_robust_action", "arguments": { ... } }
  → returns the result shown above

Works in Claude Desktop, Claude Code, Cursor, Cline, Continue.dev, Goose and Aider. See the MCP server.

Related tools

Aggregate risk register copula

Aggregate risk-register occurrence and lognormal severity marginals through a validated Gaussian copula into expected loss, VaR, CVaR, dependence amplification, and tail shares.

Statistical audit & measurement

Allocate restless bandit interventions

Allocate scarce recurring interventions across evolving Markov units with Whittle indices, explicit indexability checks, and paired policy simulation.

Sequential Bayesian & bandits

Attribute commercial dependency tail loss

Calculate expected loss, VaR and CVaR for commercial value concentrated in shared technical components, then allocate every modeled tail-loss dollar exactly once across components with normalized negative-log survival hazard rather than overlapping leave-one-out sensitivities.

Forecasting & survival

Audit commercial resilience claim integrity

Audit resilience ROI claims against a unique commercial-source to technical-component graph: recompute each action's avoided loss under joint failure scenarios, cap support at graph-derived value, detect duplicate effects, probability drift and weak evidence, and prevent overlapping component benefits from being sold twice.

Network & dependency analysis

Audit decision rank robustness smaa

Measure rank acceptability, regret, pairwise dominance, and central winning weights under uncertain criterion scores and bounded stakeholder weights.

Statistical audit & measurement

Audit extreme metric tail dependence

Detect extreme metric co-exceedances beyond independence with empirical tail coefficients, permutation inference, practical magnitude gates, and FDR control.

Statistical audit & measurement

See every tool in Risk, tails & resilience →

Ready to See Your Engineering work clearly?

Request a free demo