A list of scenarios runs several campaigns against one shared setting in a single call. The five below all start from the same district, at under-5 prevalence 0.45, pyrethroid resistance 0.30, and pyrethroid-only nets at 0.70 coverage.
Withdraw the nets. No campaign at all, which is the counterfactual the other four are measured against, and what results if a campaign is not restated.
Replace like for like, with pyrethroid-only nets at the same 0.70 coverage.
Switch to PBO, again at 0.70.
Switch to pyrrole, again at 0.70.
PBO, plus IRS at 0.60 and LSM at 0.30.
Every scenario carries the same EirTarget, so the baseline EIR is inverted from the same prevalence under the same current net mix. Any difference is caused by the campaign alone.
Building the list
The shared fields go in a dictionary and are splatted into each Scenario, an idiom R writes as do.call(Scenario, c(district, list(name = "PBO", ...))).
run_scenarios takes the list, loads the models once, and puts the five scenarios through the emulator as a single batch. Five scenarios cost barely more than one.
res = run_scenarios(scenarios)res.shape
(5, 23)
The columns are the same twenty-three that a single scenario returns.
All five share the same dn0_use, the same itn_use, an eir_baseline of about 32 infectious bites per person per year, and a prev_y9 of about 0.456 against the 0.45 that went in. They diverge only after the campaign.
Read the dn0_future column first, because at resistance 0.30 a pyrethroid-only net kills about 0.31 of the mosquitoes that touch it, a PBO net about 0.48, and a pyrrole net about 0.55. The ordering of the three net scenarios follows from that column, every other covariate being held fixed.
The combination scenario carries the PBO dn0_future (the nets are the same nets) and adds spraying at 0.60 and larviciding at 0.30 on top. Its endline prevalence comes out an order of magnitude below any net-only scenario.
Withdrawal
The first row was built by passing the district dictionary and nothing else, with no itn_future and no net_type_future.
net_future is "none", dn0_future is 0, itn_future is 0, and the district has been modelled as stopping net distribution altogether. No warning is raised. The call succeeds, the frame comes back, and the trajectory is plausible. The only indication is the rebound.
Withdrawal ends about one and a half prevalence points above like-for-like replacement, a gap small enough to be mistaken for noise. The difference in cumulative case burden between the two is considerably larger, as Trajectories and cases works out.
See also
Trajectories and cases plots the five scenarios and integrates the burden each campaign averts, and Exporting results gets the scenarios out of Python. Please see Nets and dn0 for the resistance curves behind dn0_future.