# Scenario Simulation

Orxaq's scenario simulator propagates economic shocks through the World DAG using topological ordering and edge confidence scaling.

## Built-in Scenarios

Three CCAR-aligned scenarios are included:

| Scenario | Severity | Description |
|----------|----------|-------------|
| `baseline` | Low | Expected economic conditions |
| `adverse` | Medium | Moderate downturn |
| `severely_adverse` | High | Severe recession |

## Usage

```bash
# Run adverse scenario
orxaq simulate --scenario adverse

# Monte Carlo with 1000 runs
orxaq simulate --scenario severely_adverse --monte-carlo 1000

# Custom scenario from JSON
orxaq simulate --file my_scenario.json --seed 42

# JSON output
orxaq --json simulate --scenario adverse | jq '.impact_score'
```

## Custom Scenarios

Create a JSON file with shock definitions:

```json
{
  "name": "rate_shock",
  "description": "300bp rate increase",
  "severity": "high",
  "shocks": [
    {"variable": "interest_rate", "value": 0.03, "shock_type": "delta"},
    {"variable": "unemployment_rate", "value": 0.08, "shock_type": "absolute"}
  ]
}
```

Shock types:

- `absolute`: Set the variable to a specific value
- `relative`: Multiply the current value by the shock value
- `delta`: Add the shock value to the current value

## Monte Carlo

Monte Carlo mode runs N simulations with random perturbation around the shock values, producing percentile-based confidence intervals (p5, p50, p95) for each affected variable.
