| create_param {outbreaker2} | R Documentation |
Initializes outputs for outbreaker
Description
This function creates initial outputs and parameter states for outbreaker.
Usage
create_param(data = outbreaker_data(), config = create_config())
Arguments
data |
A list of data items as returned by |
config |
A list of settings as returned by |
Value
A list containing two components $store and
$current. store is a list with the class
outbreaker_store, used for storing 'saved' states of the
MCMC. current is a list with the class outbreaker_param, used
for storing 'current' states of the MCMC.
outbreaker_store class content:
-
size: The length of the list, corresponding to the number of samples saved from the MCMC. -
step: A vector of integers of lengthsize, storing the steps of the MCMC corresponding to the saved samples. -
post: A numeric vector of lengthsize, storing log-posterior values. -
like: A numeric vector of lengthsize, storing log-likelihood values. -
prior: A numeric vector of lengthsize, storing log-prior values. -
alpha: A list of lengthsize. Each item of the list is an integer vector of lengthdata$N, storing indices (from 1 to N) of infectors for each case. -
t_inf: A list of lengthsize. Each item of the list is an integer vector of lengthdata$N, storing dates of infections for each case. -
mu: A numeric vector of lengthsize, storing values of the mutation rate. -
kappa: A list of lengthsize. Each item of the list is an integer vector of lengthdata$N, storing the number of generations before the last sampled ancestor for each case. -
pi: A numeric vector of lengthsize, storing values of the reporting probability. -
eps: A numeric vector of lengthsize, storing values of the contact reporting coverage. -
lambda: A numeric vector of lengthsize, storing values of the non-infectious contact rate. -
counter: A counter used to keep track of the current iteration of the MCMC (used internally).
outbreaker_param class content:
-
alpha: An integer vector of lengthdata$N, storing indices (from 1 to N) of infectors for each case. -
t_inf: An integer vector of lengthdata$N, storing dates of infections for each case. -
mu: The value of the mutation rate. -
kappa: An integer vector of lengthdata$N, storing the number of generations before the last sampled ancestor for each case. -
pi: The value of the reporting probability. -
eps: The value of the contact reporting coverage. -
lambda: The value of the non-infectious contact rate.
Author(s)
Thibaut Jombart (thibautjombart@gmail.com)
Examples
## load data
x <- fake_outbreak
data <- outbreaker_data(dates = x$sample, dna = x$dna, w_dens = x$w)
## modify config settings
config <- create_config(move_alpha = FALSE, n_iter = 2e5, sample_every = 1000)
## create param object
param <- create_param(data = data, config = config)