Priesemann-Group / covid19_inference_forecast

GNU General Public License v3.0
178 stars 53 forks source link

Add function for downloading historic JHU dataset #6

Closed michaelosthege closed 2 years ago

michaelosthege commented 4 years ago

I'm trying to fit your model at historic times, so see how its predictions evolve over time*.

(*Actually I'm just using your model as a really cool application example for our data workflow infrastructure, but let's just pretend.)

Now because the maintainers of the JHU data update historic data, the latest CSVs don't match with what was know at the time point in the past.

So I wrote this function clone_jhu_at_time that clones & checks out the repository at some point in the past, specified by a timezone-aware datetime.

# download the JHU dataset as it was at 2020-04-02T12:00:00Z
fp_c, fp_d, fp_r = cov19.clone_jhu_at_time(
    checkout_time=datetime.datetime(2020, 4, 2, 12, 0, tzinfo=datetime.timezone.utc),
    workdir='.'
)

df_jhu = cov19.get_jhu_cdr(
    country='Germany', state=None,
    fp_confirmed=fp_c,
    fp_deaths=fp_d,
    fp_recovered=fp_r
)
jdehning commented 4 years ago

I accepted your commit about the dictionary instead of multitrace, about the rest I have to think about whether to add it... Thanks for your interest about our model :)

michaelosthege commented 4 years ago

Sure, here's what I did with it:

posterior_cases

This is with the SIR model and weekend modulation (obviously).

jdehning commented 4 years ago

That's cool! :+1: