> ## 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.

# Post-fit analysis

> Quantify a fit's uncertainty with iws.LinearConfidenceInterval and iws.SobolSensitivity as pipeline elements.

A fit gives you parameter values. Post-fit analysis tells you how much to trust
them: how tightly the data constrains each parameter, and which parameters the
model output actually responds to.

Both run as **pipeline elements**, alongside the fit rather than after it in
your own code, so the expensive part happens on the platform. For the concepts
behind variance-based sensitivity, see the
[Sensitivity Analysis Guide](/guide/data-fitting/sensitivity-analysis).

## The two elements

| Schema                         | Answers                                                                |
| ------------------------------ | ---------------------------------------------------------------------- |
| `iws.LinearConfidenceInterval` | How tightly does the data constrain each fitted parameter?             |
| `iws.SobolSensitivity`         | Which parameters does the model output respond to, and which interact? |

Both take the same `objectives` and `parameters` as a `DataFit`. They accept
only a `PointEstimate` optimizer, because they analyse a fit rather than
performing one.

## Adding analysis to a pipeline

Place the analysis element after the fit it analyses. When its objectives and
parameters match the fit's, it picks up the fitted point automatically — you do
not restate the values:

```python theme={null}
import ionworks_schema as iws

pipeline = iws.Pipeline(
    {
        "fit": iws.DataFit(objectives=objectives, parameters=parameters),
        "intervals": iws.LinearConfidenceInterval(
            objectives=objectives,
            parameters=parameters,
        ),
        "sensitivity": iws.SobolSensitivity(
            objectives=objectives,
            parameters=parameters,
        ),
    }
)
```

## Reading the results

Each element returns a typed result, reachable off the pipeline result rather
than by reading raw job metadata:

```python theme={null}
result = client.pipeline.result(pipeline_id)

intervals = result.element("intervals")     # iws.ConfidenceIntervalResult
sensitivity = result.element("sensitivity") # iws.SensitivityResult
```

<Note>
  Sobol sensitivity is a sampling method, so its cost grows with the number of
  parameters and the sample count. Start with a small parameter set and widen it
  once you know which parameters matter.
</Note>
