sircovid implements a series of mechanistic models to help modelling the transmission of the SARS-Cov-2 virus using stochastic compartmental models. sircovid also provides some tools to perfom Bayesian evidence synthesis from several surveillance data streams through the estimation of transmission parameters.
Install from the ncov drat:
drat:::add("ncov-ic")
install.packages("sircovid")or install directly from GitHub with:
remotes::install_github("mrc-ide/sircovid", upgrade = FALSE)You will need the most recent version of dust and mcstate to use the package. These will be installed automatically if you install sircovid from drat, or manually with:
drat:::add("ncov-ic")
install.packages(c("dust", "mcstate"))We use OpenMP for parallelism, and this may not be available on your system. If not then compilation will fail with an error like:
clang: error: unsupported option '-fopenmp'
make[1]: *** [basic.o] Error 1
ERROR: compilation failed for package ‘sircovid’You can either install OpenMP support, or edit your personal Makevars file to tell R that you do not have it. To do this, you can run
usethis::edit_r_makevars("user")and add the lines
SHLIB_OPENMP_CFLAGS=
SHLIB_OPENMP_CXXFLAGS=after which compilation will succeed, but the model will only run on one core.
In addition to the above you need to install odin and odin.dust
drat:::add("ncov-ic")
install.packages(c("odin", "odin.dust"))- Make changes to the models in
inst/odin - Run
odin.dust::odin_dust_package(here::here())from the root directory, which will generate updated filesR/dust.Randsrc/basic.cpp,src/carehomes.cpp, along withR/cpp11.Randsrc/cpp11.cpp
Alternatively, run ./scripts/generate_odin
MIT © Imperial College of Science, Technology and Medicine

