what-if-scenario-howto
What-If Scenario Analysis How-To
Compare forecast outcomes under different assumptions using pipeline session diffs.
Overview
What-if analysis lets you answer questions like:
- "What if demand increases 15%?" (optimistic scenario)
- "What if we use a different forecasting method?"
- "What if we change the confidence interval?"
This guide shows how to run multiple scenarios and compare them.
Step 1: Run Base Scenario
Execute the pipeline with default (base) parameters:
source:
fence: wh-demand-history
weeks: 8
chain:
- fence: mw-seasonality
- fence: mw-trend
- fence: mw-forecast
- fence: mw-scenario
scenario: base
edge_mode: deltaThe base scenario uses a 1.0 multiplier - no adjustment to forecasts.
Step 2: Run Optimistic Scenario
Execute with 15% uplift assumption:
source:
fence: wh-demand-history
weeks: 8
chain:
- fence: mw-seasonality
- fence: mw-trend
- fence: mw-forecast
- fence: mw-scenario
scenario: optimistic
edge_mode: deltaThe optimistic scenario applies a 1.15x multiplier to all forecasts.
Step 3: Compare Results
View the diff between the two scenarios:
Or use the CLI to compare:
# List recent sessions
curl "http://localhost:7778/api/pipeline/sessions?limit=4" | jq '.sessions[] | {id: .session_id, fence: .fence_id}'
# Diff two sessions
curl "http://localhost:7778/api/pipeline/diff?a=SESSION_A&b=SESSION_B" | jqUnderstanding the Diff
The diff shows:
| Field | Meaning |
|---|---|
adjusted_forecast |
Final forecast after scenario multiplier |
scenario_multiplier |
The multiplier applied (1.0 base, 1.15 optimistic) |
adjusted_lower/upper |
Confidence bounds after adjustment |
Key Insight
Same source data + different scenario = shows parameter sensitivity.
- If changes are uniform across all SKUs: the scenario multiplier is working as expected
- If changes vary by SKU: there may be item-specific adjustments in play
Edge Modes
Control how much detail is captured:
| Mode | Use Case | Storage |
|---|---|---|
none |
Production, massive datasets | Minimal |
delta |
Standard auditing (default) | Moderate |
snapshot |
Deep analytics, debugging | Full state at each step |
Set in your pipeline definition:
edge_mode: snapshot # or 'delta' or 'none'Advanced: Custom Scenarios
Create item-specific or week-specific adjustments:
source:
fence: wh-demand-history
weeks: 8
chain:
- fence: mw-seasonality
- fence: mw-trend
- fence: mw-forecast
- fence: mw-scenario
scenario: custom
custom_adjustments:
items:
SKU-001: 1.25 # 25% boost for premium headphones
SKU-003: 0.90 # 10% reduction for cables
weeks:
"9": 1.40 # 40% boost in week 9 (planned sale)
edge_mode: snapshotThen diff against base to see exactly which SKUs/weeks were affected.
Provenance
Document
- Status: π΄ Unverified
Changelog
- 2026-01-25: Created what-if scenario analysis guide
North
slots:
- slug: beye-demo-walkthrough
context:
- Linking what-if guide to main walkthroughSouth
slots:
- slug: forecast-pipeline-test
context:
- Pipeline definitions for scenarios
- slug: pipeline-diff-demo
context:
- Visual diff viewer demo