CohortSpec

models.CohortSpec(
    transition,
    state_cost,
    state_effect,
    transition_cost=None,
    transition_effect=None,
)

One intervention’s matrices for a single parameter set.

Returned by the engine’s transitions_and_rewards function. Arrays are plain numpy arrays over the engine’s state order.

Parameters

Name Type Description Default
transition NDArray[np.float64] Transition-probability matrix, shape (n_states, n_states) for a time-independent model or (n_cycles, n_states, n_states) when transitions vary by cycle. Each row sums to 1. required
state_cost NDArray[np.float64] Per-cycle cost of occupying each state, shape (n_states,), or (n_cycles + 1, n_states) when it varies. required
state_effect NDArray[np.float64] Per-cycle effect (QALYs) of each state, same shape rule as state_cost. required
transition_cost NDArray[np.float64] | None Optional extra cost attached to a transition, added on the flow between states, shape (n_states, n_states) or (n_cycles, n_states, n_states). Entry [i, j] is the cost of moving from state i to state j. None
transition_effect NDArray[np.float64] | None Optional effect attached to a transition, same shape rule as transition_cost. None