Don't fit the current census against forecast days past the peak
@@ -182,7 +182,8 @@ class SimSirModel:
def get_argmin_ds(census_df: pd.DataFrame, current_hospitalized: float) -> float:
- losses_df = (census_df.hospitalized - current_hospitalized) ** 2.0
+ peak_day = census_df.hospitalized.argmax()
+ losses_df = (census_df.hospitalized[:peak_day] - current_hospitalized) ** 2.0
return losses_df.argmin()
