Skip to content

epidemics 0.2.0

Compare
Choose a tag to compare
@pratikunterwegs pratikunterwegs released this 21 Mar 16:13

This is a second GitHub release of epidemics which makes substantial additions to the functionality in v0.1.0, and introduces significant breaking changes (#176).
This release is the end point of this project to ship vectorised ODE models.

This release focuses on the ODE models in epidemics.

Breaking changes

  1. All model functions have been renamed to model_<NAME>(), removing the language suffix (#176).

  2. The wrappers around R-only implementations of the 'default' and 'Vacamole' models have been removed, but the ODE system functions have been retained for potential future use (#176).

  3. The "Vacamole" model has been refactored with the arguments *_reduction_vax for the effect of double vaccination on compartmental transition rates renamed to *_vax, where * may be one of "susceptibility", "hospitalisation", and "mortality". Previously, these parameters were implemented in the internal C++ code, but presented as inverse values to users (i.e., susceptibility_vax = susceptibility * (1 - (susceptibility_reduction_vax)))). This change brings the user-facing representation in line with the internal implementation, and allows these parameters to be targeted by rate interventions and time-dependence, which was not possible earlier (#176, #203, and overriding #144).

  4. The function get_parameter() has been removed (#176).

  5. The infection parameter "transmissibility" has been renamed to "transmission rate" and the corresponding function argument is transmission_rate (#196).

Model functions

  • ODE model functions can now be passed numeric vectors of infection parameters, and lists of intervention sets (a list of <intervention>s), and lists of <vaccination> to the intervention and vaccination argument respectively. This is the main change in this minor version. (#176)

  • ODE model functions take on {data.table} to make combinations of interventions and vaccinations (together called a 'scenario'), and infection parameter sets to run each scenario for each parameter set (#176).

  • ODE model functions all return <data.table>s - these may be nested with the model arguments as identity columns if vectors of parameters or multiple scenarios are passed. A simple, unnested <data.table> is passed if the model function is called with scalar arguments (#176).

Model structures

  • There is a fix to how vaccination is implemented in the default and Vacamole models: the group-specific vaccination rates passed in a <vaccination> are internally converted to a count by multiplication with the group-specific population size, and this value is subtracted from any susceptibles, while vaccination is active. The previous implementation made the number of vaccinations dependent on the number of susceptibles, which was not in line with a public health understanding of vaccination (details: #198, fix: #202).

  • All C++ ODE model implementation now access values from the std::unordered_map of model parameters using the at operator on keys (model_params.at("parameter_name")) rather than using [ (model_params["parameter_name"]); the latter method will introduce a key-value pair of parameter_name : 0 for numeric value types when the key is missing from the map. This led to issues with the Vacamole model where the *_vax parameters were not correctly transferred to C++ and were substituted with 0s without throwing an error (#203).

Classes

No substantial changes to classes; small additions of input checking to <population> class.

Helper functions

  1. Internal helper functions .check_args_model_*() and .prepare_args_model_*() have been combined into single functions .check_prepare_args_*() that are called both for their output and for input checking side effects.

  2. The new internal functions .prepare_population(), .cross_check_intervention(), .cross_check_vaccination(), .cross_check_timedep(), and .cross_check_popchange() check and prepare a model population and check other inputs for compatibility with it. These are used in .check_prepare_args_*().

  3. New internal functions have been added to check and recycle lists of vectors; original implementations by @TimTaylor.

  4. output_to_df() is renamed to .output_to_df().

Documentation

  1. The benchmarking vignette has been removed as the R-only model implementations are no longer provided to users (#176).

  2. The vignette on parameter uncertainty has been rewritten to show how to pass vectors of infection parameters and model composable elements to model functions, and renamed to "Modelling parameter uncertainty and epidemic scenarios" (#176).

  3. A design decisions vignette has been added to help developers and contributors understand the package architecture and design choices made in epidemics development; this includes a conceptual design diagram as well as an architecture diagram (#188).

  4. All function documentation has been updated to reflect name changes and other minor improvements (#176).

  5. The README has been reorganised to shift the model list to the end, to make the installation instructions easier to find (#176).

  6. Corrected the website URL in _pkgdown.yml; this allows search functionality in the package website (#195).

  7. Updated WORDLIST.

Package

  1. All ODE model functions have received a more extensive and more standardised (as much as possible) test suite.

  2. Filenames have been standardised to show which files are related, e.g. R/model_default.R, src/model_default.cpp, and inst/include/model_default.h; references to filenames such as in the package header have been updated.

  3. Removed {deSolve} from dependencies.

  4. Added {ggdist}, {withr}, {purr} and {tidyr} to Suggests; CITATION.cff updated to match.

  5. Added basic infrastructure for continuous relative benchmarking (#206).