What-If Analysis

What-if parametric sweep

Vary one variable parameter across a range and see how outcomes change. All steps run in parallel via Mojo worker pool. Returns a sweep with mean, percentiles, and probability of loss at each step. Automatically computes sensitivity direction and elasticity.

post/v1/simulate/what-if

Request

  • Base URL: https://api.algenta.ai
  • URL: https://api.algenta.ai/v1/simulate/what-if
  • Auth: one of:
    • HTTP bearer
    • API key in header X-API-Key

Request body

variablestring required

Variable name to sweep

paramstring

Which parameter to vary: mean, std, low, high, mode, value

range_pctnumber

Sweep range as fraction of base value (e.g. 0.30 = ±30%)

n_stepsinteger

Number of steps (odd number recommended for symmetric sweep)

runs_per_stepinteger

Monte Carlo runs per step. Lower for faster response.

Example request

{
  "request": {
    "mode": "auto",
    "runs": 10000,
    "scenario": {
      "name": "Product launch decision",
      "objective": "maximize_net_value",
      "variables": {
        "cost": {
          "high": 90000,
          "low": 40000
        },
        "revenue": {
          "high": 200000,
          "low": 80000
        }
      }
    },
    "simulation_model": "monte_carlo"
  }
}

Response

Successful Response

variablestring required
n_stepsinteger required
range_lownumber required
range_highnumber required
param_changedstring required
increasing_directionstring required
sensitivity_labelstring required
elasticitynumber required

Changes

No recorded changes to this operation across all 1 revision of this API.