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

explore compartmental models #28

Closed vpnagraj closed 3 years ago

vpnagraj commented 3 years ago

we've circled around this since the beginning of the project, but moving into model refinement and enhancement let's all take some time to start looking at methods for SIR, SEIR, and others.

a few practical references to kick-off:

vpnagraj commented 3 years ago

assigning @slguertin on this one too.

she and i had a conversation on this earlier today. i've started to move the needle with a new branch:

https://github.com/signaturescience/focustools/tree/compartmental

first commit there is EXPERIMENTAL ... so please don't squint at the results too closely ... but i'm starting to work through what these compartmental parameters mean. even cracking open some of my old epi textbooks :)

the scratch code i added (https://github.com/signaturescience/focustools/commit/feba9357e4e4ac5899f12984d357a21ea052ef10) has an example of a SEIRD model for Charlottesville (rough estimates for parameters) and the US (a little more data driven for the parameters). note that i am openly guessing at some of those parameters ... obviously lots more to study and figure out.

the code i wrote uses odin:

http://epirecip.es/epicookbook/chapters/seird-stochastic-discretestate-discretetime/intro http://epirecip.es/epicookbook/chapters/seird-stochastic-discretestate-discretetime/r_odin

if you all have found other packages / methods feel free to share. EpiModel looks good.

one thing to keep in mind is that we will need a method that has some stochastic element so we can simulate/generate quantiles for the forecasts. one of the EpiModel tutorials discusses stochasticity in more detail: http://statnet.org/tut/BasicICMs.html

let's keep this issue open and use the thread to discuss as we continue exploring these models. eventually we'll split to more targeted task-oriented issues ...

stephenturner commented 3 years ago

Tim Churches has his own blog with a multipart series on using EpiModel. Another good resource, https://rviews.rstudio.com/2020/03/19/simulating-covid-19-interventions-with-r/.

stephenturner commented 3 years ago

Some of these parameters we could pull from the data itself https://github.com/signaturescience/focustools/blob/feba9357e4e4ac5899f12984d357a21ea052ef10/scratch/seird-odin-scratch.R#L78-L81

We've got population counts in focustools:::locations, And I imagine you could estimate I = sum last 2 wk incident cases? Thinking out loud, we probably do need to consider vaccinations taking folks out of S. Esp in Charlottesville, where UVA healthsystem is driving that rate up relative to other parts of the state.

vpnagraj commented 3 years ago

good points.

agreed that we can use data to drive these parameters. in fact most of the initial seeding of compartment size can be done with the count data we have. there's already an example of one rough way to do that in my US data code:

https://github.com/signaturescience/focustools/blob/feba9357e4e4ac5899f12984d357a21ea052ef10/scratch/seird-odin-scratch.R#L144-L158

as for vaccinations, yeah i think it would make sense to remove vaccinated from susceptible. but there are plenty of knots to untangle there. what is "vaccinated" ? at least one dose? both? do we lag the vaccination data by 3 or 4 weeks before considering individual no longer susceptible? more importantly if we want to do county level ... is there vaccination data at that granularity? i havent looked at the data sources recently but my expectation is (at least in VA) vaccination tallies are tracked at the health district level (Blue Ridge Health District in CHO) not the city/county.

ultimately we should model vaccination data, and probably as its own compartment ... something like V for vaccinated immune with parameters for rate at which vaccine becomes effective as well as % efficacy?

but let's walk before we run!

we can try to get a SEIR or SEIRD model working first ... then add compartments/adjustments from there.

vpnagraj commented 3 years ago

closing this issue out. we're beyond "exploration" phase at this point.

most recent code push:

https://github.com/signaturescience/focustools/commit/aeb2882659696f5caa14e9bd78f316811462a1a0

will create other issues to track tasks related to compartmental models as needed.