vacc_from_immunity.Rd
Given a popim_population
object and an assumption of how vaccine
is targeted in a partially immune population, this function infers
the vaccination activities that have given rise to the specified
population immunity. When there is ambiguity (e.g., due to
subsequent campaigns achieving full coverage), the minimum
coverage/doses needed will be returned.
vacc_from_immunity(pop, targeting = "random", n_digits = 10)
popim_population
object for which vaccination
activities are to be inferred.
character, determines the assumption of how doses
are allocated. Valid options are "random" (the default),
"correlated", "targeted", see apply_vacc()
for details of
these options.
number of digits to which the coverage is to be rounded, defaults to 10.
popim_vacc_activites object
Default is the targeting option "random", which assumes that individuals receive vaccine independently of vaccination status, resulting in some double vaccination if there is pre-existing immunity in the population. The option "targeted" gives the most effective vaccine distribution, vaccinating unvaccinated people first, while the option "correlated" models a situation of inequalities in access to vaccination - in this extreme cases, all previously vaccinated individuals will be vaccinated first, before any remaining doses are given to unvaccinated individuals.
Note that this function will not return any potential vaccination
activities that don't change the immunity, for instance if
targeting
is set to "correlated" and the coverage is too small
to increase population immunity, or if the immunity prior to the
activity was already at 1.
The vaccination of the oldest age group in the population will also never be picked up as this age group will have aged out of the population (i.e., died) before the immunity is updated in the next year.
## set up population and vaccination activities:
pop <- popim_population(region = "UK", year_min = 2000, year_max = 2005,
age_min = 0, age_max = 10)
pop$pop_size <- 100
vacc <- popim_vacc_activities(region = "UK", year = c(2001, 2002),
age_first = 0, age_last = 0,
coverage = 0.8, doses = NA,
targeting = "random")
## update the population immunity based on the vaccination activities:
pop <- apply_vacc(pop, vacc)
## get the vaccination activities that have created the population
## immunity - this should match the input `vacc`
vacc_out <- vacc_from_immunity(pop, targeting = "random")