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 'ready reckoners' vignette #220

Open
adamkucharski opened this issue Dec 21, 2024 · 4 comments
Open

Add 'ready reckoners' vignette #220

adamkucharski opened this issue Dec 21, 2024 · 4 comments

Comments

@adamkucharski
Copy link
Member

A useful tool during COVID was the 'ready reckoner' plot by Ellen Brooks-Pollock et al, which mapped social distancing scenarios to the reproduction number - see below image as example from this paper. By combining socialmixr data by setting with r_eff() from {finalsize}, this should be relatively straightforward to include as an example for users for basic social distancing (but some more thought would be required to incorporate assumptions about contact tracing etc, perhaps linking with {ringbp} development).

image

@pratikunterwegs
Copy link
Collaborator

pratikunterwegs commented Jan 2, 2025

Just chiming in because I've been using {finalsize} and would find this functionality useful as well.

IMO, a more general way to go would be to add a contacts scaling argument to r_eff() and final_size(). This could be as simple as passing a single number to scale the contact matrix, but looking at the example it seems it might be more useful to be able to scale the contact matrix for each demographic group as in {epidemics}.

This reprex shows (my understanding) of how it would be done:

# where 1.0 = no contact reduction
contact_scaling = c(1.0, 0.95, 0.93, 1.0, 1.0)

# scale both incoming and outgoing contacts, but prevent squared scaling
n_demo_grps <- length(contact_scaling)
contact_scaling_incoming <- matrix(contact_scaling, n_demo_grps, n_demo_grps)
contact_scaling_outgoing <- t(contact_scaling_incoming)
diag(contact_scaling_outgoing) <- 1.0

# assuming some 5x5 contact matrix, each element [i, j] is scaled by the
# corresponding element of this matrix
contact_scaling_incoming * contact_scaling_outgoing
#>      [,1]   [,2]   [,3] [,4] [,5]
#> [1,] 1.00 0.9500 0.9300 1.00 1.00
#> [2,] 0.95 0.9500 0.8835 0.95 0.95
#> [3,] 0.93 0.8835 0.9300 0.93 0.93
#> [4,] 1.00 0.9500 0.9300 1.00 1.00
#> [5,] 1.00 0.9500 0.9300 1.00 1.00

It would be possible to modify the contact matrix expansion here - repeated in r_eff() to include scaling of contacts by susceptibility group as well. For more fine-grained contact scaling though, one would need to pass a large matrix that gives the full scaling by demography-susceptibility combination (e.g. shielding elderly with low immunity) but perhaps too complicated for users?

Happy to volunteer this feature unless somebody is already working on it.

@adamkucharski
Copy link
Member Author

That would be great – there's no active work on this yet. As a starting point, having fixed susceptibility and ability to output r_eff by different contact assumptions (e.g. a list of contact_scaling vectors or similar) would be nice – and hopefully simpler to implement for a V1.

@adamkucharski
Copy link
Member Author

Also adding a link to the original code for the ready reckoners analysis by @ellen-is: https://github.com/ellen-is/reckoners - would be great to get her thoughts (perhaps once we have prototype).

@pratikunterwegs
Copy link
Collaborator

Thanks, what I can do is make a small PR with the contact scaling functionality added and a brief vignette showing similar plots. That wouldn't include any uncertainty as that's coming from bootstrapping which might be a bit much for a first pass.

There are quite a few scenarios in the repo where I haven't looked too closely at how they're translated into modification of contacts (e.g. contact tracing and isolation). The figure scenarios (school openness levels) seems more interpretable as X% scaling of relevant age groups' contacts so I'll stick to those for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants