Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add vignette to compare with {finalsize} #33

Closed
pratikunterwegs opened this issue Apr 21, 2023 · 9 comments · Fixed by #128
Closed

Add vignette to compare with {finalsize} #33

pratikunterwegs opened this issue Apr 21, 2023 · 9 comments · Fixed by #128
Assignees
Labels
Documentation Improvements or additions to documentation good first issue Good for newcomers

Comments

@pratikunterwegs
Copy link
Collaborator

This PR is to request a vignette that compares the final size calculations from {epidemics} against those from {finalsize}, to show the effect of implementing interventions and vaccination regimes.

@pratikunterwegs pratikunterwegs added the Documentation Improvements or additions to documentation label Apr 21, 2023
@pratikunterwegs pratikunterwegs self-assigned this Apr 21, 2023
@pratikunterwegs pratikunterwegs added the good first issue Good for newcomers label Sep 26, 2023
@pratikunterwegs pratikunterwegs removed their assignment Sep 26, 2023
@BlackEdder BlackEdder self-assigned this Oct 5, 2023
@BlackEdder
Copy link
Contributor

WIP: https://github.com/epiverse-trace/epidemics/tree/finalsize_vignette

@BlackEdder
Copy link
Contributor

The vignette includes a couple of simple code examples to compare the two approaches. I noticed a couple of differences in the implementation that might be good to think about.

  • There are some naming differences, particularly demo_grp vs demography_group
  • The form of the contact matrix used is different in both packages. For SEIR-V it is not needed to rescale the contact matrix, presumably because it does so internally. In finalsize this is needed. Would be good if we can think of a way to unify this.
  • Is there a general way to know the proportion of the population vaccinated in the vaccine calendar? It did not seem to be equal to nu times the number of days the vaccination programme is happening?

@adamkucharski
Copy link
Member

Have had a look through, and useful to see them side-by-side to understand structure/naming etc. A few additional thoughts:

  • If including as vignette, would be good to distinguish what it adds beyond the existing compartmental comparison in finalsize.
  • Perhaps an obvious one is alignment in how different aspects are defined. Perhaps too much refactoring to get full alignment, would be nice if possible to unify parameters so easier to use in the other model.
  • Another would be the difference in speed, particularly if sampling over many realisations of R0 (as discussed in finalsize and issue <infection> accepts R as a distribution or samples #106)
  • There's also quite a lot of wrangling code required to compare, so could be useful to have this vignette as more of a guide to help users decide which is preferable, e.g. if you want to easily calculate overall size, and do multiple realisations, finalsize gets you there much faster and potentially more accurately, because it's based on analytical solution. Whereas any temporal questions have to be addressed with epidemics?

@pratikunterwegs
Copy link
Collaborator Author

pratikunterwegs commented Oct 6, 2023

The vignette includes a couple of simple code examples to compare the two approaches. I noticed a couple of differences in the implementation that might be good to think about.

Thanks @BlackEdder, will you keep working on this vignette or should I take this further and make a PR?

There are some naming differences, particularly demo_grp vs demography_group

Thanks - maybe 'demo_group' is a good compromise between the two packages, and between clarity and brevity. That said {finalsize} is on CRAN so perhaps adopting 'demo_grp' in {epidemics} is safer than changing it in both packages.

The form of the contact matrix used is different in both packages. For SEIR-V it is not needed to rescale the contact matrix, presumably because it does so internally. In finalsize this is needed. Would be good if we can think of a way to unify this.

Yes, it is scaled internally using .prepare_args_default(). This could be a good time to take another look at the {contactmatrix} package we had been discussing?

Is there a general way to know the proportion of the population vaccinated in the vaccine calendar? It did not seem to be equal to nu times the number of days the vaccination programme is happening?

I had not really thought about it, but I can convert it to an issue and a relevant test for correctness.

@pratikunterwegs
Copy link
Collaborator Author

pratikunterwegs commented Oct 6, 2023

Have had a look through, and useful to see them side-by-side to understand structure/naming etc. A few additional thoughts:

If including as vignette, would be good to distinguish what it adds beyond the existing compartmental comparison in finalsize.

Perhaps an obvious one is alignment in how different aspects are defined. Perhaps too much refactoring to get full alignment, would be nice if possible to unify parameters so easier to use in the other model.

Another would be the difference in speed, particularly if sampling over many realisations of R0 (as discussed in finalsize and issue accepts R as a distribution or samples #106)

There's also quite a lot of wrangling code required to compare, so could be useful to have this vignette as more of a guide to help users decide which is preferable, e.g. if you want to easily calculate overall size, and do multiple realisations, finalsize gets you there much faster and potentially more accurately, because it's based on analytical solution. Whereas any temporal questions have to be addressed with epidemics?

Thanks @adamkucharski - I think being able to answer the temporal questions, and the effect of interventions etc is probably the key aspect, but others are good to mention too.

Speaking of temporal questions, would it be useful to have helper functions that help get the timing and size of the epidemic peak (optionally by age group)?

@adamkucharski
Copy link
Member

Yep, size in particular often useful as output metric, particularly for healthcare requirements, deaths etc. (e.g. Table 2 in early COVID modelling) and tables in Roadmap analysis.

@pratikunterwegs
Copy link
Collaborator Author

Thanks - we do have epidemic_size() that calculates size at any point in the simulation, but I'll put in some functions for the peak specifically.

@BlackEdder
Copy link
Contributor

The vignette includes a couple of simple code examples to compare the two approaches. I noticed a couple of differences in the implementation that might be good to think about.

Thanks @BlackEdder, will you keep working on this vignette or should I take this further and make a PR?

Might be most efficient if you would be willing to take this further. Agreed that it would be good to explain in the text, what the main differences are between the two packages. I would hazard that final size is faster, but if you need dynamics over time and/or interventions/vaccinations that happen over time, you should use the epidemics package.

@pratikunterwegs
Copy link
Collaborator Author

Okay thanks, will do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Improvements or additions to documentation good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants