create_config {outbreaker2}R Documentation

Set and check parameter settings of outbreaker

Description

This function defines settings for outbreaker. It takes a list of named items as input, performs various checks, set defaults where arguments are missing, and return a correct list of settings. If no input is given, it returns the default settings.

Usage

create_config(..., data = NULL)

## S3 method for class 'outbreaker_config'
print(x, ...)

Arguments

...

further arguments to be passed to other methods

data

an optional list of data items as returned by outbreaker_data; if provided, this allows for further checks of the outbreaker setings.

x

an outbreaker_config object as returned by create_config.

Details

Acceptables arguments for ... are:

init_tree

the tree used to initialize the MCMC. Can be either a character string indicating how this tree should be computed, or a vector of integers corresponding to the tree itself, where the i-th value corresponds to the index of the ancestor of 'i' (i.e., init.tree[i] is the ancestor of case i). Accepted character strings are "seqTrack" (uses seqTrack algorithm to generate the initial tree - see function seqTrack in the package adegenet), "random" (ancestor randomly selected from preceding cases), and "star" (all cases coalesce to the first case). Note that for SeqTrack, all cases should have been sequenced.

init_alpha

a vector of integers indicating the initial values of alpha, where the i-th value indicates the ancestor of case 'i'; defaults to NULL, in which ancestries are defined from init_tree.

init_kappa

a (recycled) vector of integers indicating the initial values of kappa; defaults to 1.

init_t_inf

a vector of integers indicating the initial values of t_inf, i.e. dates of infection; defaults to NULL, in which case the most likely t_inf will be determined from the delay to reporting/symptoms distribution, and the dates of reporting/symptoms, provided in data.

init_mu

initial value for the mutation rates

init_pi

initial value for the reporting probability

init_eps

initial value for the contact reporting coverage

init_lambda

initial value for the non-infectious contact rate

n_iter

an integer indicating the number of iterations in the MCMC, including the burnin period

move_alpha

a vector of logicals indicating, for each case, if the ancestry should be estimated ('moved' in the MCMC), or not, defaulting to TRUE; the vector is recycled if needed.

move_t_inf

a vector of logicals indicating, for each case, if the dates of infection should be estimated ('moved' in the MCMC), or not, defaulting to TRUE; the vector is recycled if needed.

move_mu

a logical indicating whether the mutation rates should be estimated ('moved' in the MCMC), or not, all defaulting to TRUE.

move_pi

a logical indicating whether the reporting probability should be estimated ('moved' in the MCMC), or not, all defaulting to TRUE.

move_eps

a logical indicating whether the contact reporting coverage should be estimated ('moved' in the MCMC), or not at all, defaulting to TRUE.

move_lambda

a logical indicating whether the non-infectious contact rate should be estimated ('moved' in the MCMC), or not at all, defaulting to TRUE.

move_kappa

a logical indicating whether the number of generations between two successive cases should be estimated ('moved' in the MCMC), or not, all defaulting to TRUE.

move_pi

a logical indicating whether the reporting probability should be estimated ('moved' in the MCMC), or not, all defaulting to TRUE.

n_iter

the number of iterations of the MCMC

sample_every

the frequency at which MCMC samples are retained for the output

sd_mu

the standard deviation for the Normal proposal for the mutation rates

sd_pi

the standard deviation for the Normal proposal for the reporting probability

sd_eps

the standard deviation for the Normal proposal for the contact reporting coverage

sd_lambda

the standard deviation for the Normal proposal for the non-infectious contact rate

prop_alpha_move

the proportion of ancestries to move at each iteration of the MCMC

prop_t_inf_move

the proportion of infection dates to move at each iteration of the MCMC

batch_size

the size of the batch of random number pre-generated

paranoid

a logical indicating if the paranoid mode should be used; this mode is used for performing additional tests during outbreaker; it makes computations substantially slower and is mostly used for debugging purposes.

min_date

earliest infection date possible, expressed as days since the first sampling

max_kappa

an integer indicating the largest number of generations between any two linked cases; defaults to 5

prior_mu

a numeric value indicating the rate of the exponential prior for the mutation rate 'mu'

prior_pi

a numeric vector of length 2 indicating the first and second parameter of the beta prior for the reporting probability 'pi'

prior_eps

a numeric vector of length 2 indicating the first and second parameter of the beta prior for the contact reporting coverage 'eps'

prior_lambda

a numeric vector of length 2 indicating the first and second parameter of the beta prior for the non-infectious contact rate 'lambda'

ctd_directed

a logical indicating if the contact tracing data is directed or not. If yes, the first column represents the infector and the second column the infectee. If ctd is provided as an epicontacts objects, directionality will be taken from there.

pb

a logical indicating if a progress bar should be displayed

Author(s)

Thibaut Jombart (thibautjombart@gmail.com)

See Also

outbreaker_data to check and process data for outbreaker

Examples

## see default settings
create_config()

## change defaults
create_config(move_alpha = FALSE, n_iter = 2e5, sample_every = 1000)




[Package outbreaker2 version 1.1.3 Index]