library(diseasy)
#> Loading required package: diseasystore
#>
#> Attaching package: 'diseasy'
#> The following object is masked from 'package:diseasystore':
#>
#> diseasyoption
Overview
The diseasy
package is large in scope as it aims to
provide the infrastructure to easily create a large ensemble of disease
models.
This building of disease models is achieved via a modular design philosophy. To that end, we have a number of “functional” modules that feed into “model” modules.
Functional modules
The functional modules are smaller modules meant for defined purposes. These modules are “atomic” and form the building blocks of the ensembles.
The currently available functional modules are:
ls("package:diseasy") |>
purrr::keep(~ stringr::str_detect(., pattern = "Diseasy(?!(BaseModule|Model.*))"))
#> [1] "DiseasyActivity" "DiseasyObservables" "DiseasySeason"
#> [4] "DiseasyVariant"
Each functional module is restricted to covering a single functionality for use in the models (and sometimes for other functional modules).
For example, DiseasySeason
defines a number of models
for the season dependency of the disease. This module has a single
defined purpose (modelling the effect of season) but it provides a
number of different models of describing possible season
dependencies:
s <- DiseasySeason$new()
s$available_season_models
#> [1] "constant_season" "cosine_season" "covid_season_v1" "covid_season_v2"
As we will see later, these different models for season dependency will be used to construct the ensembles.
Each of these season models have similar functional signatures (i.e. the function calls to the models are similar). This way, when we create a disease model, we can use the module to implement different models for season dependency in the disease models easily.
The other modules have other functionality they implement. For
example, the module DiseasyObservables
is responsible for
providing data to the models and modules. For
DiseasySeason
, this means that some models of season
dependency can use real-world data, such as temperature, in the season
models.
The use of these modules is varied and each module comes with their
own vignette describing their usage:
vignette("DiseasyActivity")
,
vignette("DiseasyObservables")
,
vignette("DiseasySeason")
,
vignette("DiseasyVariant")
.
Model modules
As stated above, the functional modules provide functionality for the disease models.
The currently available model modules are:
ls("package:diseasy", pattern = "DiseasyModel.+")
#> character(0)
Presently, no models are included in the package. These will come in the following releases.
Configuring
All diseasy
modules are build on top of the
DiseasyBaseModule
class. This class provides a number of
features that are common to all modules, such as logging and
caching.
Caching
Internally, the modules may use cachem to cache
computations either in memory or on disk. To control how this caching is
done, you can provide the cache
argument to the module
constructor containing a cachem
cache object, or you can
set the option diseasy.cache
to a cachem
cache
object. See DiseasyBaseModule
for more information.