-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Clarify some intervention parametrization documentation.
The `set_tbv` function was located at the bottom of `pev_parameters.R`, which was confusing and unintuitive. I believe this was a remnant of a time when that file was named `vaccine_parameters.R`. It is now moved to its own file, named `tbv_parameters.R`. This matches the general naming convention used by all other interventions. The ages parameter of `set_tbv` was previously described as being "per-round", which might hint at it being, eg. a list of age ranges with one entry per round. This did not match the implementation, which uses the same whole `tbv_ages` parameter for every round. I don't how useful being able to pass in a non-contiguous set of ages is. In the future it might be clearer to change the TBV intervention to use `min_ages` and `max_ages`, the same way other mass-event interventions (MDA, SMC and mass-PEV) are implementated. This will make it easy to actually have varying age ranges for each round, if desired. This also adds a check in `set_tbv` for the length of coverages to ensure it matches the timesteps, the same way it is done in other interventions. The documentation for the `timesteps` and `coverages` parameters of the `set_pmc` method made mentions of rounds, implying that the intervention only takes place at the given timesteps, when it is in fact a perennial age-based intervention that may happen at any timestep. The timesteps parameter is only used to vary the coverage over time. Finally, there were a pair of lost words in the documentation of `set_tbv` and `set_mda` from successive code refactors, which have now been removed.
- Loading branch information
Showing
9 changed files
with
49 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#' @title Parameterise an TBV strategy | ||
#' @param parameters a list of parameters to modify | ||
#' @param timesteps a vector of timesteps for each round of vaccinations | ||
#' @param coverages the coverage for each round of vaccinations | ||
#' @param ages a vector of ages of the target population (in years) | ||
#' @export | ||
set_tbv <- function( | ||
parameters, | ||
timesteps, | ||
coverages, | ||
ages | ||
) { | ||
stopifnot(all(coverages >= 0) && all(coverages <= 1)) | ||
if(length(coverages) != length(timesteps)){ | ||
stop("coverages and timesteps do no align") | ||
} | ||
|
||
parameters$tbv <- TRUE | ||
parameters$tbv_timesteps <- timesteps | ||
parameters$tbv_coverages <- coverages | ||
parameters$tbv_ages <- ages | ||
parameters | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters