Skip to content

Commit 169e92a

Browse files
committed
Only prevention changes SAM treatment needs
1 parent 8fec4d4 commit 169e92a

File tree

5 files changed

+21
-4
lines changed

5 files changed

+21
-4
lines changed

nutrition/model.py

+11-2
Original file line numberDiff line numberDiff line change
@@ -188,10 +188,19 @@ def _update_sam_costs(self):
188188
Treatment of SAM is modelled to have a target population of all children.
189189
The unit cost is scaled based on treatment cost * SAM_prev * 2.6.
190190
This means that 100% coverage the total cost is treatment cost * SAM_prev * 2.6.
191-
It also means the unit cost needs to be scaled dynamically as SAM prevalence changes
191+
It also means the unit cost needs to be scaled dynamically as SAM incidence changes due to prevention scale-up.
192+
An alternate implementation is to scale based on SAM prevalence, but this assumes incidence declines with treatment
192193
"""
193194
if self.year>0:
194-
self.prog_info.programs[_("Treatment of SAM")].unit_cost *= self.child_samprev[self.year] / self.child_samprev[self.year-1]
195+
sam_cost_update_numerator = 0
196+
sam_cost_update_denominator = 0
197+
for a, age in enumerate(self.pops[0].age_groups):
198+
sam_cost_update_numerator += (self.pops[0].age_groups[a].wastingPreventionUpdate[_("SAM")] *
199+
self.pops[0].age_groups[a].bfUpdate[_("SAM")] *
200+
self.pops[0].age_groups[a].diarrhoeaUpdate[_("SAM")]) * self.pops[0].age_groups[a].pop_size
201+
sam_cost_update_denominator += self.pops[0].age_groups[a].pop_size
202+
self.prog_info.programs[_("Treatment of SAM")].unit_cost *= sam_cost_update_numerator / sam_cost_update_denominator
203+
#self.prog_info.programs[_("Treatment of SAM")].unit_cost *= self.child_samprev[self.year] / self.child_samprev[self.year-1]
195204

196205
def _reset_storage(self):
197206
for pop in self.pops:

tests/scen_results_AGO.xlsx

0 Bytes
Binary file not shown.

tests/scen_results_AGO2.xlsx

0 Bytes
Binary file not shown.

tests/scen_results_AGO3.xlsx

62.4 KB
Binary file not shown.

tests/test_SQLNS.py

+10-2
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,19 @@
3333
"Treatment of SAM": [0.19,0.37, 0.55,0.72,0.9,0.9,0.9,0.9,0.9]}),
3434
"growth": "fixed coverage"}
3535

36+
kwargs4 = {"name": "TSAM+IYCF",
37+
"model_name": "AGO",
38+
"scen_type": "coverage",
39+
"progvals": sc.odict({"Small quantity lipid-based nutrition supplements": [0.18,0.36,0.54,0.72,0.9,0.9,0.9,0.9,0.9,0.9],
40+
"Treatment of SAM": [0.19,0.37, 0.55,0.72,0.9,0.9,0.9,0.9,0.9],
41+
"IYCF 1": [0.126,0.37, 0.55,0.72,0.9,0.9,0.9,0.9,0.9],
42+
"Vitamin A supplementation": [0.05,0.37, 0.55,0.72,0.9,0.9,0.9,0.9,0.9]}),
43+
"growth": "fixed coverage"}
3644

3745

3846
if __name__ == "__main__":
3947

40-
scen_list = nu.make_scens([kwargs1, kwargs2, kwargs3])
48+
scen_list = nu.make_scens([kwargs1, kwargs2, kwargs3, kwargs4])
4149
#scen_list = nu.make_scens([kwargs1, kwargs2, kwargs3, kwargs3a])
4250
p.add_scens(scen_list)
4351
results = p.run_scens(n_samples=0)
@@ -48,5 +56,5 @@
4856
# p.write_results("optim_results.xlsx")
4957

5058
all_reduce = reduce_results(results)
51-
write_results(results=results, reduced_results=all_reduce, filename="scen_results_AGO2.xlsx")
59+
write_results(results=results, reduced_results=all_reduce, filename="scen_results_AGO3.xlsx")
5260

0 commit comments

Comments
 (0)