API reference

Parameters (heormodel.params)

Distributions specified directly or from mean and standard error, with correlated sampling into a parameter draw matrix.

Distribution Abstract base class for univariate parameter distributions.
Normal Normal distribution.
LogNormal Lognormal distribution, for relative risks and skewed costs.
Beta Beta distribution, for probabilities and utilities on [0, 1].
Gamma Gamma distribution, for non-negative quantities such as costs.
Uniform Uniform distribution on [low, high].
Fixed Degenerate distribution: a parameter held constant across iterations.
Dirichlet Dirichlet distribution: a vector of transition probabilities summing to 1.
ParameterSet A named collection of parameter distributions with optional correlation.
single_draw Wrap one named set of parameter values as a one-row draw matrix.
read_draws Validate an external parameter sample as a draw matrix.
resample_posterior Resample a weighted parameter table into an unweighted draw matrix.
mix_draws Combine draw matrices from different sources into one matrix.

Models (heormodel.models)

The Outcomes structure every engine returns, the ModelEngine contract, the cohort state-transition, microsimulation, discrete-event, and ordinary differential equation engines, and state occupancy over time from an event history.

Outcomes Probabilistic sensitivity analysis outcomes per intervention per iteration.
ModelEngine Anything that turns parameter draws into standardized outcomes.
ModelFn
MarkovModel Cohort state-transition model engine.
CohortSpec One intervention’s matrices for a single parameter set.
MicrosimModel Individual-level microsimulation engine, discrete- or continuous-time.
DESModel Discrete-event simulation engine wrapping SimPy.
ODEModel Ordinary differential equation (compartmental) model engine.
ODESpec One intervention’s dynamics and rewards for a single parameter set.
queue_waits Per-request waiting times, derived from a DESModel trace.
state_occupancy Proportion of individuals in each state at each time.
LifeTable Piecewise-constant mortality rates by age, sampled by inversion.

Run loop (heormodel.run)

Drive a model over parameter draws, or ingest external results tables.

SeedManager Root seed source that spawns independent child generators.
run_psa Evaluate a model over the parameter draw matrix, preserving its index.
as_outcomes Normalise any costs/effects table into the standard outcome structure.
running_means Running mean of an outcome column per intervention, by iteration count.

Cost-effectiveness analysis (heormodel.cea)

Incremental cost-effectiveness ratios, dominance, the efficiency frontier, net benefit, and acceptability curves.

icer_table Full incremental analysis: dominance, extended dominance, and ICERs.
frontier Incremental cost-effectiveness analysis on the efficiency frontier.
nmb Net monetary benefit per iteration and intervention: wtp * effect - cost.
nhb Net health benefit per iteration and intervention: effect - cost / wtp.
expected_nmb Expected (mean over iterations) NMB per intervention.
ceac Acceptability curves, frontier, expected loss curves, and CE-plane data.
ceaf Cost-effectiveness acceptability frontier.
expected_loss Expected loss curve: mean foregone net benefit per intervention.
ce_plane Incremental cost and effect per iteration versus a comparator.
STATUS_D
STATUS_ED
STATUS_ND

Deterministic sensitivity analysis (heormodel.dsa)

One-way, one-at-a-time, and full-factorial grid scenario designs that run through the standard loop and feed tornado and heatmap reports.

one_way Vary one parameter across values, holding the rest at base.
one_at_a_time Vary each parameter in ranges in turn, holding the rest at base.
grid Full-factorial design over the listed parameters, rest at base.
Design

Value of information (heormodel.voi)

Expected value of perfect, partial perfect, and sample information.

evpi Expected value of perfect information from the probabilistic analysis.
evppi Expected value of partial perfect information via metamodeling.
evppi_ranking Single-parameter EVPPI for each parameter, sorted descending.
simulate_summaries Simulate one study dataset summary per parameter draw.
evsi_regression EVSI by nonparametric regression on simulated study summaries.
evsi_moment_matching EVSI by moment matching (stub, scheduled for a later phase).
evsi_importance_sampling EVSI by importance sampling (stub, scheduled for a later phase).

Calibration (heormodel.calibrate)

Bayesian calibration; the posterior returns as a standard draw matrix. Requires the calibration extra.

TargetSimulator
abc_calibrate Calibrate model parameters to observed targets with ABC-SMC.
CalibrationResult Posterior draws and diagnostics from an ABC-SMC calibration.
to_pyabc_prior Translate heormodel distribution specs into a pyabc prior.

Reporting (heormodel.report)

Standard plots, provenance capture, and run reports.

plot_ce_plane Scatter of incremental cost vs incremental effect per iteration.
plot_ceac Cost-effectiveness acceptability curves, optionally with the frontier.
plot_expected_loss Expected loss curves, one per intervention over the willingness-to-pay grid.
plot_frontier Mean cost vs mean effect per intervention with the efficiency frontier.
tornado_data One-way sensitivity of net monetary benefit, probabilistic or deterministic.
plot_tornado Tornado diagram from tornado_data.
heatmap_data Reshape a two-parameter grid result into a matrix for a heatmap.
intervention_colors Stable intervention -> color assignment in fixed palette order.
PALETTE
capture_run Snapshot a run’s provenance into a RunRecord.
RunRecord A reproducibility record for one analysis run.