amis: Run the AMIS algorithm to fit a transmission model to a map

View source: R/AMIS.R

amisR Documentation

Run the AMIS algorithm to fit a transmission model to a map

Description

For details of the algorithm, see Integrating geostatistical maps and infectious disease transmission models using adaptive multiple importance sampling. Renata Retkute, Panayiota Touloupou, Maria-Gloria Basanez, T. Deirdre Hollingsworth, Simon E.F. Spencer Ann. Appl. Stat. 15 (4) 1980 - 1998, December 2021. DOI: https://doi.org/10.1214/21-AOAS1486

Usage

amis(prevalence_map, transmission_model, prior, amis_params, seed = NULL)

Arguments

prevalence_map

An L x M matrix containing samples from the fitted prevalence map, where L is the number of locations and M the number of samples. The location names are inherited from rownames(prevalence_map) if possible. Alternatively, a list with one entry for each timepoint. Each entry must be a list containing objects data (an L x M matrix of data as above); and likelihood a function taking arguments data (a matrix of data as above), prevalence (a matrix of output from the transmission model) and optional logical log, which returns the vector of (log)-likelihoods. If a likelihood is not specified then it is assumed that the data consist of samples from a geo-statistical model and empirical methods are used.

transmission_model

A function taking a vector of n seeds and an n x d matrix of parameter vectors as inputs and producing a n x timepoints MATRIX of prevalences as output (it must be a matrix even when timepoints==1).

prior

A list containing the functions dprior and rprior (density and RNG). rprior must produce an n by d MATRIX of parameters, even when d=1. parameter names are inherited from the colnames from the output of rprior if possible.

amis_params

A list containing the control parameters for the AMIS algorithm

deltathe smoothing parameter in the empirical RN derivative (usually 0.01).
nsamplesthe number of new samples drawn within each AMIS iteration.
mixture_samplesthe number of samples used to represent the weighted parameters in the mixture fitting.
dfthe degrees of freedom in the t-distributions, used to yield a heavy tailed proposal.
target_essthe target effective sample size.
log logical indicating if calculations are to be performed on log scale.
max_itersmaximum number of AMIS iterations.
breaksoptional vector specifying the breaks for the histogram.
seed

Optional seed for the random number generator

Value

A dataframe of the sampled parameters, simulation seed, and weight in each location.


OxfordRSE/trachomAMIS documentation built on Aug. 1, 2022, 10:21 p.m.