ModelEngine
models.ModelEngine()Anything that turns parameter draws into standardized outcomes.
Implementations must satisfy two invariants:
- The returned
Outcomesiteration index equalsdraws.index(same values, same order); this preserves the parameter/outcome linkage required by EVPPI and EVSI. - Every intervention is evaluated on every iteration (a balanced panel); the
Outcomesconstructor enforces this.
Example
import pandas as pd from heormodel.models import ModelEngine, Outcomes class TwoInterventionModel: … def evaluate(self, draws: pd.DataFrame) -> Outcomes: … costs = pd.DataFrame({“A”: draws[“c”], “B”: draws[“c”] * 2}) … effects = pd.DataFrame({“A”: draws[“e”], “B”: draws[“e”] * 1.5}) … return Outcomes.from_wide(costs, effects) isinstance(TwoInterventionModel(), ModelEngine) True
Methods
| Name | Description |
|---|---|
| evaluate | Evaluate all interventions for every row of the draw matrix. |
evaluate
models.ModelEngine.evaluate(draws)Evaluate all interventions for every row of the draw matrix.