epiverse-trace / epidemics

A library of published compartmental epidemic models, and classes to represent demographic structure, non-pharmaceutical interventions, and vaccination regimes, to compose epidemic scenarios.
https://epiverse-trace.github.io/epidemics/
Other
8 stars 2 forks source link

Add basic SIR model #238

Open adamkucharski opened 6 months ago

adamkucharski commented 6 months ago

We would like to add a new model to epidemics. It will be a basic SIR model (i.e. no age structure) and will work with deSolve package. It will also use existing functionality from {epidemics} to allow interventions like vaccination.

(Note: this is a test issue with GitHub Copilot Workspace)

pratikunterwegs commented 6 months ago

Just to clarify for external viewers, this issue was added to explore Github Copilot + Workspaces for Epiverse, and the issue was taken as a reasonable domain-specific task for Copilot. @adamkucharski once you're back, would it be possible to actually make the Copilot-generated PR for future reference? Since Copilot allows comparing against existing codebase as well as its own previous solutions, it could be a good way to asses whether it's getting better at the task.

adamkucharski commented 5 months ago

✨✨ Here's an AI-assisted sketch of how you might approach this issue saved by @adamkucharski using Copilot Workspace v0.19

Topic
Does the SIR model without age structure, compatible with deSolve package and supporting interventions like vaccination, exist?
Before
* No, the SIR model without age structure, compatible with deSolve package and supporting interventions like vaccination, does not exist in the repository. * The repository contains models with age structure and interventions, as seen in `vignettes/design-principles.Rmd` and `vignettes/developer-walkthrough.Rmd`, but not a basic SIR model as described. * The issue description suggests adding a new model to the repository, indicating the absence of such a model currently.
After
* Yes, the SIR model without age structure, compatible with deSolve package and supporting interventions like vaccination, now exists in the repository. * The model is implemented in a new file `models/SIR_no_age_structure.R`, utilizing the deSolve package for solving differential equations. * The model supports interventions like vaccination through the existing functionality in the repository, as outlined in the vignettes `vignettes/design-principles.Rmd` and `vignettes/developer-walkthrough.Rmd`.
Plan
* `models/SIR_no_age_structure.R` (ADD) - Implement the SIR model equations using the deSolve package - Define parameters for the SIR model including transmission rate, recovery rate, and initial conditions - Include functionality to support interventions like vaccination - Write a function to simulate the SIR model over a specified time period - Document the function with examples of how to use it, including with interventions
Sketch of implementation
[View the changes](https://copilot-workspace.githubnext.com/epiverse-trace/epidemics/issues/238?shareId=3022f801-c2f8-479d-9576-6af053f61972)
Details
Code analyzed at f706261bac19282e813ca43675ff16dcb79b3d40