running_means

run.running_means(outcomes, column=None)

Running mean of an outcome column per intervention, by iteration count.

Flat traces at the right edge indicate the analysis has stabilised for that outcome; drifting traces call for more iterations.

Parameters

Name Type Description Default
outcomes Outcomes Outcomes from a probabilistic sensitivity analysis. required
column str | None Outcome column (default: cost). None

Returns

Name Type Description
pd.DataFrame DataFrame indexed by the iteration position (1..n) with one column
pd.DataFrame per intervention, holding the mean over the first k iterations.

Example

import pandas as pd from heormodel.models import Outcomes from heormodel.run import running_means c = pd.DataFrame({“A”: [1.0, 3.0]}) e = pd.DataFrame({“A”: [0.1, 0.1]}) running_means(Outcomes.from_wide(c, e))[“A”].tolist() [1.0, 2.0]