MyNixOS website logo
Description

Implement the AMIS Algorithm for Infectious Disease Models.

Implements the Adaptive Multiple Importance Sampling (AMIS) algorithm, as described by Retkute et al. (2021, <doi:10.1214/21-AOAS1486>), to estimate key epidemiological parameters by combining outputs from a geostatistical model of infectious diseases (such as prevalence, incidence, or relative risk) with a disease transmission model. Utilising the resulting posterior distributions, the package enables forward projections at the local level.

AMIS for Infectious Diseases

R-CMD-check

Description

This package provides an implementation of the Adaptive Multiple Importance Sampling algorithm, as described in

Integrating geostatistical maps and infectious disease transmission models using adaptive multiple importance sampling. Renata Retkute, Panayiota Touloupou, María-Gloria Basáñez, T. Deirdre Hollingsworth and Simon E.F. Spencer (2021). Annals of Applied Statistics, 15 (4), 1980-1998. DOI https://doi.org/10.1214/21-AOAS1486

This repository contains the development version of the package.

Installation

Make sure you have the package devtools installed. Then

devtools::install_github("drsimonspencer/AMISforInfectiousDiseases-dev")

Usage

amis is the main function of the package. It takes a geostatistical map, a transmission model and a prior distribution for parameters, and returns a list of objects that includes sampled parameters and their associated weights in each location at each time point.

amis_output <- AMISforInfectiousDiseases::amis(prevalence_map, transmission_model, prior, amis_params)
  • prevalence_map: A matrix representing the geostatistical map, with one row per pixel (if there is one time point); or a list with matrices, each one representing the geostatistical map for a time point.
  • transmission_model: A function implementing the model. It can be anything, as long as it conforms to a specific interface. See defining a model function.
  • prior: A list containing the functions dprior and rprior (density and RNG, respectively).
  • amis_params: A list containing the parameters for the AMIS algorithm, such as:
    • n_samples: The number of sample parameters to draw at each iteration.
    • target_ess: The target effective sample size.
    • max_iters: The maximum number of iterations.
    • boundaries: Lower and upper boundaries for prevalences.
    • boundaries_param: Lower and upper boundaries for parameters.
    • log: Logical indicating whether to work with log weights.
    • delete_induced_prior: Logical indicating whether the induced prior density is to be deleted in the update of weights.
    • mixture_samples: The number of samples drawn from the weighted distribution to fit a new mixture to.
    • df: Degrees of freedom in the t-distributions, used yield a heavy tailed proposal.
    • delta, sigma, breaks: Options for density estimation used in the pseudo-likelihood and induced prior density.
  • seed: Optional seed for the random number generator.
  • output_dir: An optional string specifying the local directory where to save outputs after each iteration of the algorithm.
  • initial_amis_vals: Optional list of intermittent outputs from a previous run.

Defining a model function

The amis function expects its argument model_func to be a function with the following interface

observables <- model_func(seeds, params, n_tims)
  • params: A matrix of parameter values (double)
  • seeds: A vector of seeds (integer)
  • n_tims: Number of time points (integer)

Function model_func is expected to run the model for each pair (seed, params) and return the corresponding values for the observable (e.g. infection prevalence). params must be a matrix with ncols equal to the dimension of the parameter space and the output must be a matrix with ncols equal to the number of observed timepoints n_tims.

Metadata

Version

0.1.0

License

Unknown

Platforms (77)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-windows
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows