signaturescience / fiphde

Forecasting Influenza in Support of Public Health Decision Making
https://signaturescience.github.io/fiphde/
GNU General Public License v3.0
3 stars 2 forks source link

state level glm forecasts #54

Closed vpnagraj closed 2 years ago

vpnagraj commented 2 years ago

we need to put together some code to run the count regression glm models at the state level.

vpnagraj commented 2 years ago

we now have a script that will create forecasts by state going back 4 weeks prior to current date so we can compare against observed data:

https://github.com/signaturescience/fiphde/blob/glm-state/scratch/workflow-state.R

the end of that script generates a PDF with plots of forecasts that are annotated with location/model selected:

glm_states.pdf

in general, these dont look too bad ... especially given the challenges of this particular forecast window (hospitalizations are rapidly rising in almost every state) and the extremely small counts.

another thing to consider is that the processing is kind of slow (~30 minutes). we should look into parallelizing

vpnagraj commented 2 years ago

have a "true" forecast script (as opposed to the retrospective/evaluation forecasting) for state level targets via glm:

https://github.com/signaturescience/fiphde/commit/f3c63eb6a39852030d450b210fa06ffbeaa67e95

same deal with the evaluation script ... writes a plot of each state to PDF:

glm_states_ahead.pdf

again. not bad. but some of these probably wouldnt make it to submission given plausibility of trends forecasted.

note that to get the dates working i did have to do a "pseudo nowcast" to get missing ILI for prior week (see https://github.com/signaturescience/fiphde/blob/glm-state/scratch/forecast-state.R#L15-L45). related to #43 .

vpnagraj commented 2 years ago

code to parallelize glm forecasting implemented in https://github.com/signaturescience/fiphde/commit/21f614723efbef9b3fc2684037054cfd81e0c887

using furrr (with 8 cores) instead of for loop drops processing time from ~40 minutes to ~8 minutes.

vpnagraj commented 2 years ago

going to close this for now since the "add more glm models" task is converted to its own issue.