Skip to content

Commit

Permalink
Tweak data cleaning and eval for 2020-09-28 forecasts
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan Sheldon committed Sep 29, 2020
1 parent af039c0 commit fa81f3f
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 16 deletions.
1 change: 1 addition & 0 deletions covid/models/SEIRD_incident.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ def __call__(self,

death_rate = numpyro.sample("death_rate",
dist.Gamma(10, 10 * H_duration_est))
#dist.Gamma(100, 100 * H_duration_est))

if drift_scale is not None:
drift = numpyro.sample("drift", dist.Normal(loc=0, scale=drift_scale))
Expand Down
43 changes: 29 additions & 14 deletions scripts/run_sir.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,32 @@
data = config.get('data') or util.load_data()

# MI and PA don't report on Sundays
data['MI']['data'].loc['2020-09-27', 'confirmed'] = onp.nan
data['MI']['data'].loc['2020-09-27', 'death'] = onp.nan

data['PA']['data'].loc['2020-09-27', 'confirmed'] = onp.nan
data['PA']['data'].loc['2020-09-27', 'death'] = onp.nan

# RI doesn't report on Saturdays/Sundays
data['RI']['data'].loc['2020-09-26', 'confirmed'] = onp.nan
data['RI']['data'].loc['2020-09-27', 'confirmed'] = onp.nan
data['RI']['data'].loc['2020-09-26', 'death'] = onp.nan
data['RI']['data'].loc['2020-09-27', 'death'] = onp.nan


for place in ['MI', 'PA']:
data[place]['data'].loc['2020-09-27', 'confirmed'] = onp.nan
data[place]['data'].loc['2020-09-27', 'death'] = onp.nan

# RI, CT, GU don't report on Saturdays/Sundays
for place in ['RI', 'CT', 'GU']:
data[place]['data'].loc['2020-09-26', 'confirmed'] = onp.nan
data[place]['data'].loc['2020-09-27', 'confirmed'] = onp.nan
data[place]['data'].loc['2020-09-26', 'death'] = onp.nan
data[place]['data'].loc['2020-09-27', 'death'] = onp.nan


# MO dept. of health and human services reports 129 excess deaths
# added to the system ~Mon-Wed 9/21-9/23 and 63 added on 9/26.
# These jumps don't seem to match what appears in JHU data, so
# I am redistributing a similar (slightly smaller) number
# of deaths from multiple days during the week
# https://twitter.com/HealthyLivingMo
#
# Update: these caused instability in fitting so I tweaked them
# manually and redistributed fewer deaths
util.redistribute(data['MO']['data'], '2020-09-22', 10, 60, 'death')
util.redistribute(data['MO']['data'], '2020-09-23', 25, 60, 'death')
util.redistribute(data['MO']['data'], '2020-09-25', 10, 60, 'death')
util.redistribute(data['MO']['data'], '2020-09-26', 25, 60, 'death')
util.redistribute(data['MO']['data'], '2020-09-27', -4, 60, 'death') # to avoid -1 deaths on last observed day

# Texas large backlogs on 9/21 and 9/22

Expand Down Expand Up @@ -104,7 +117,9 @@
util.redistribute(data['MO']['data'], '2020-09-06', 15, 60)

# MA changed definition of confirmed case
util.redistribute(data['MA']['data'], '2020-09-03', -7936, 90, col='confirmed')
# fixed in JHU data on Sep 22:
# https://github.com/CSSEGISandData/COVID-19/tree/master/csse_covid_19_data#retrospective-reporting-of-probable-cases-and-deaths
# util.redistribute(data['MA']['data'], '2020-09-03', -7936, 90, col='confirmed')

# Redistribute incident deaths
util.redistribute(data['IL']['data'], '2020-07-07', 225, 30)
Expand Down
4 changes: 2 additions & 2 deletions scripts/score.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
eval_date = '2020-07-09'

config_names=['llonger_H', 'longer_H', 'resample_80_last_10']
forecast_dates = ['2020-08-23', '2020-08-30', '2020-09-06', '2020-09-13']
eval_date = '2020-09-19'
forecast_dates = ['2020-08-30', '2020-09-06', '2020-09-13', '2020-09-20']
eval_date = '2020-09-26'


def write_summary(summary, filename):
Expand Down

0 comments on commit fa81f3f

Please sign in to comment.