signaturescience / focustools

Forecasting COVID-19 in the US
https://signaturescience.github.io/focustools/
GNU General Public License v3.0
0 stars 0 forks source link

One-step pipeline to create models and forecasts #20

Closed stephenturner closed 3 years ago

stephenturner commented 3 years ago

Added a new function (marked as Experimental!) that runs the pipeline as laid out in the README using reasonable defaults and some hard-coded values to do the following. See the Examples in ?forecast_pipeline. For now this function only works on Mondays! We can easily mod/deprecate/supersede this in the future.

  1. Get data (national level from NYT by default)
  2. Fit incident case and incident death models (ARIMA and lagged TSLM respectively)
  3. Get future case data to create the incident death forecast
  4. Create the incident death forecast based on this new data
  5. Prepare submission format
  6. Suggest a submission filename
  7. Return all resulting objects to a list.

The results of this, as run today 2021-01-11, check out using the validation script, and eyeballing the results they look like they're in the ballpark!

stephenturner commented 3 years ago

checks as CRAN with no ERROR WARNING or NOTE

stephenturner commented 3 years ago

As written this thing doesn't run at all unless it's monday. We could probably relax by allowing it to be either on a sunday or a monday, but I haven't checked to see what happens in validation if your forecast date is the sunday of that epiweek. Could be worth a look, but TBH I don't imagine us actually running this code interactively on very many sundays when monday is a perfectly fine day to run it otherwise.

vpnagraj commented 3 years ago

@stephenturner thanks for putting this together. this is helpful for now, but it is pretty limited with how many things are hardcoded in here (especially if you think about us using other model methods)

ok if i can take it from here and make some changes? or are you still editing?

stephenturner commented 3 years ago

@vpnagraj go ahead and take it, just added an option to force if not monday, but yeah please do make less rigid before merging!

vpnagraj commented 3 years ago

@stephenturner cool i just made some edits to the docs and added a "method" argument (currently only method = 'ts' is supported) so that down the line we might be able to use this sort of pipeline for other models

merging