Health economic evaluation in Python: parameter sampling, simulation across model types, cost-effectiveness analysis, and value-of-information analysis for model-based health technology assessment.
Install
pip install heormodel
The calibration extra adds Bayesian calibration: pip install "heormodel[calibration]".
Quickstart
This example builds a three-state Markov cohort state-transition model comparing standard care with two treatments of different efficacy and cost, then evaluates it by probabilistic sensitivity analysis:
The icer_table orders interventions by cost and reports incremental cost-effectiveness ratios along the efficiency frontier; the status column flags dominated (D) and extended-dominated (ED) interventions. All three interventions sit on the frontier here, with Treatment A entering near 11,000 per quality-adjusted life-year (QALY) and Treatment B near 52,000. plot_ce_plane scatters every iteration’s incremental cost and effect against standard care, and plot_ceac reports the share of iterations in which each intervention has the highest net benefit, across a grid of willingness-to-pay thresholds:
At a willingness-to-pay threshold of 50,000, the acceptability curves cross: the choice between Treatment A and Treatment B is close, so the expected value of perfect information (EVPI) is high there. Swept across the threshold, EVPI peaks near each ICER on the frontier, sharpest where the decision is closest:
evpi_curve = evpi(outcomes, grid)print(f"EVPI at WTP {WTP:,.0f}: {evpi(outcomes, WTP):,.1f}")fig2, ax2 = plt.subplots()ax2.plot(grid, evpi_curve.to_numpy(), color="#333333", lw=2)ax2.set_xlabel("Willingness to pay")ax2.set_ylabel("EVPI per person")fig2.tight_layout()
Compartmental transmission model: a susceptible-exposed-infectious-recovered vaccination model written as ordinary differential equations, for infectious-disease cost-effectiveness analysis.
Bring your own outputs: an external results table through cost-effectiveness analysis, value of information, plots, and a run report.
Full pipeline: parameters, run_psa, cost-effectiveness analysis, and value of information end to end.
Calibration workflow: calibrate some parameters, take the rest from the literature, mix both with mix_draws, then run the same analyses.
API reference: every public function, generated from docstrings.