generated from epiverse-trace/packagetemplate
-
Notifications
You must be signed in to change notification settings - Fork 3
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
Allow time-varying, age-specific vaccination rates #227
Labels
Discussion
Issues kept open for discussions in the comments
Vaccination
Related to implementing vaccination
Comments
pratikunterwegs
added
Vaccination
Related to implementing vaccination
Discussion
Issues kept open for discussions in the comments
labels
Apr 30, 2024
Continuing this discussion with a small reprex (most of it's setup!) on what a time-varying vaccination functionality could look like. The
Some points for consideration, happy to hear any suggestions:
Reprex for time-varying vaccinationlibrary(ggplot2)
library(epidemics)
# Prepare contact matrix and demography vector
polymod <- socialmixr::polymod
contact_data <- socialmixr::contact_matrix(
polymod,
countries = "United Kingdom",
age.limits = c(0, 60),
symmetric = TRUE
)
contact_matrix <- t(contact_data$matrix)
demography_vector <- contact_data$demography$population
# make initial conditions - order is important
initial_conditions <- c(
S = 1 - 1e-6, E = 0,
I = 1e-6, R = 0, V = 0
)
initial_conditions <- rbind(
initial_conditions,
initial_conditions
)
# create a population
uk_population <- population(
name = "UK population",
contact_matrix = contact_matrix,
demography_vector = demography_vector,
initial_conditions = initial_conditions
)
# get intervals for vaccination stages/phases/weeks
start_times <- seq(0, 91, 7)
end_times <- start_times + 6
intervals <- cbind(start_times, end_times)
# get dosage for a single age group - extend to multiple
dosage <- runif(nrow(intervals), 1 / 1e3, 4 / 1e3)
dosage <- cbind(dosage, dosage)
vax <- vaccination(
nu = dosage,
intervals = intervals
)
vax
#> <vaccination> object
#> Intervals:
#> start_times end_times
#> [1,] 0 6
#> [2,] 7 13
#> [3,] 14 20
#> [4,] 21 27
#> [5,] 28 34
#> [6,] 35 41
#> [7,] 42 48
#> [8,] 49 55
#> [9,] 56 62
#> [10,] 63 69
#> [11,] 70 76
#> [12,] 77 83
#> [13,] 84 90
#> [14,] 91 97
#> Rates:
#> dosage dosage
#> [1,] 0.003198568 0.003198568
#> [2,] 0.003311817 0.003311817
#> [3,] 0.003494860 0.003494860
#> [4,] 0.002264464 0.002264464
#> [5,] 0.002723691 0.002723691
#> [6,] 0.003272980 0.003272980
#> [7,] 0.001669557 0.001669557
#> [8,] 0.001807109 0.001807109
#> [9,] 0.002605438 0.002605438
#> [10,] 0.003692647 0.003692647
#> [11,] 0.002444341 0.002444341
#> [12,] 0.003510983 0.003510983
#> [13,] 0.001281554 0.001281554
#> [14,] 0.002998309 0.002998309
# numbers vaccinated each day in each week
vax$nu %*% diag(demography_vector)
#> [,1] [,2]
#> [1,] 151891.18 40940.11
#> [2,] 157269.04 42389.63
#> [3,] 165961.25 44732.49
#> [4,] 107533.16 28984.03
#> [5,] 129340.59 34861.92
#> [6,] 155424.77 41892.53
#> [7,] 79282.67 21369.52
#> [8,] 85814.61 23130.11
#> [9,] 123725.08 33348.33
#> [10,] 175353.64 47264.08
#> [11,] 116074.99 31286.36
#> [12,] 166726.92 44938.87
#> [13,] 60857.49 16403.27
#> [14,] 142381.42 38376.88
# model run time
time_end <- 100L
data <- model_default(
population = uk_population,
transmission_rate = 1.3 / 7,
vaccination = vax,
time_end = time_end
)
ggplot(data[compartment == "vaccinated", ]) +
geom_line(
aes(time, value, col = demography_group)
) +
labs(y = "# Vaccinated") Created on 2024-05-08 with reprex v2.0.2 |
pratikunterwegs
changed the title
Revamp of vaccination modelling support
Allow time-varying, age-specific vaccination rates
May 8, 2024
This was referenced May 8, 2024
6 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Discussion
Issues kept open for discussions in the comments
Vaccination
Related to implementing vaccination
This issue comes from discussions with @sbfnk re: supporting the use of Vacamole for submissions to the ECDC Scenario Hub (by collaborating users).
The aim is to provide more functionality around specifying age-stratified time-varying vaccination rates which would allow
<vaccination>
objects to more accurately represent real vaccine calendars.The main open question around the actual implementation is how to represent vaccine calendars in the Vacamole model which has two vaccination compartments (applies to any number of compartments).
The text was updated successfully, but these errors were encountered: