Skip to content

Commit 7c3b1b5

Browse files
committed
Prevent post-peak fits
1 parent 5c156ec commit 7c3b1b5

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/penn_chime/models.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,11 @@ def __init__(self, p: Parameters):
8282
for i_day in range(p.n_days):
8383
self.i_day = i_day
8484
raw = self.run_projection(p, self.gen_policy(p))
85+
86+
# Don't fit against results that put the peak before the present day
87+
if raw["census_hospitalized"].argmax() < i_day:
88+
continue
89+
8590
loss = get_loss(raw["census_hospitalized"][i_day], p.current_hospitalized)
8691
if loss < best_i_day_loss:
8792
best_i_day_loss = loss

0 commit comments

Comments
 (0)