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

New quantile methods for US and state-level time series forecasts #40

Closed stephenturner closed 3 years ago

stephenturner commented 3 years ago

Previously, using bootstrapping resulted in incorrect quantiles for incident death forecasts. See 06 (California) for a particularly egregious example.

us-and-states-1-bootstrapping

This is the same forecast without using bootstrapping/resampling. Note that this change was made to both incident cases and incident deaths. Comparing this to the above, the 25/75 interval is very slightly wider than it was with bootstrapping, but the erroneous intervals we saw with incident deaths is no longer an issue.

us-and-states-2-hilo

Looking at the distribution of quantiles comparing at 06/CA using hilo (left) versus bootstrapping (right) for incident deaths makes the problem (right) and solution (left) apparent.

quantile-comparison

Updated forecasts visualized for all 50 states + DC + US national:

us-and-states.pdf

stephenturner commented 3 years ago

(US and state forecasts validate, and checks with note error, warning, notes)

vpnagraj commented 3 years ago

@stephenturner this looks great. before i merge just want to confirm one thing.

when ran the submission script i got an error for write_csv:

Error in readr::write_csv(submission %>% mutate(forecast_date = this_monday()),  : 
  unused argument (file = submission_filename)

i'm using readr_1.3.1 so i change that to arg from "file" to "path" (https://github.com/signaturescience/focustools/pull/40/commits/2bf0a14634a21a687f50d0590e305490b041b71e)

are you using a version of readr where "file" works ?!?

vpnagraj commented 3 years ago

nevermind :)

https://github.com/signaturescience/focustools/pull/40#commitcomment-46432825

vpnagraj commented 3 years ago

btw im going to leave the state-level-ts branch deleted for now. i think this is going to be good to go for monday.

stephenturner commented 3 years ago

@stephenturner this looks great. before i merge just want to confirm one thing.

when ran the submission script i got an error for write_csv:

Error in readr::write_csv(submission %>% mutate(forecast_date = this_monday()),  : 
  unused argument (file = submission_filename)

i'm using readr_1.3.1 so i change that to arg from "file" to "path" (2bf0a14)

are you using a version of readr where "file" works ?!?

uhhh... well this is annoying. I was using tab completion.

https://www.tidyverse.org/blog/2020/10/readr-1-4-0/#argument-name-consistency

Breaking Changes Argument name consistency The first argument to all of the write_() functions, like writecsv() had previously been path. However the first argument to all of the read() functions is file. As of readr 1.4.0 the first argument to both read() and write() functions is file and path is now deprecated.

stephenturner commented 3 years ago

I'd recommend updating your readr and changing back to file on master?