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)

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)

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.