> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ionworks.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Sensitivity Analysis

> Quantify which parameters a data fit actually constrains.

Sensitivity analysis tells you which parameters the fit actually constrains and which it doesn't. The standard tool is variance-based SOBOL indices over the parameter ranges. For the math (first-order vs total-order, Saltelli sampling), see the [Sensitivity Analysis Guide](/guide/data-fitting/sensitivity-analysis).

<Note>
  Sensitivity analysis is currently a **post-fit, in-process** capability available through `ionworkspipeline` directly. It is not yet exposed as a separate `ionworks-schema` element or an `ionworks-api` endpoint — track [pipeline.docs.ionworks.com](https://pipeline.docs.ionworks.com/) for the standalone interface.
</Note>

## Interpreting the indices

After a fit, sensitivity analysis returns first-order (`S1`) and total-order (`ST`) indices plus 95% confidence intervals:

```
{
    "S1": [0.65, 0.25],
    "S1_conf": [0.05, 0.04],
    "ST": [0.72, 0.35],
    "ST_conf": [0.06, 0.05],
}
```

| Quantity        | Reading                                                                |
| --------------- | ---------------------------------------------------------------------- |
| `S1` near 1     | The parameter alone accounts for most output variance                  |
| `ST − S1` large | The parameter's effect is mostly through interactions                  |
| `ST` near 0     | The parameter is unidentifiable inside its bounds — consider fixing it |
| `1 − sum(S1)`   | Variance explained only by joint interactions                          |

## Workflow

<Steps>
  <Step title="Screen parameters">
    Start with `n_samples=256` to identify the parameters with non-negligible `ST` (typically `ST > 0.05`).
  </Step>

  <Step title="Refine">
    For the parameters that matter, rerun with `n_samples=1024` to tighten the confidence intervals.
  </Step>

  <Step title="Investigate interactions">
    Enable second-order indices when `ST − S1` is large for multiple parameters — `S2[i, j]` reveals which pairs are coupled.
  </Step>
</Steps>

Pick `n_samples` as a power of two; the underlying SOBOL scheme uses $n \cdot (2p + 2)$ model evaluations, where $p$ is the number of fit parameters.

## When too many evaluations fail

If a meaningful fraction of evaluations (>5%) fail because the model can't solve the proposed parameter combinations:

* Check that the parameter bounds are physically realistic
* Verify the model is stable across the parameter space
* Tighten bounds around the fitted values

<CardGroup cols={2}>
  <Card title="Sensitivity Analysis (theory)" icon="chart-mixed" href="/guide/data-fitting/sensitivity-analysis">
    SOBOL indices, Saltelli estimators, identifiability.
  </Card>

  <Card title="Data Fitting overview" icon="chart-line" href="/pipelines/data-fitting/overview">
    Setting up the fit that sensitivity analysis runs on.
  </Card>
</CardGroup>
