create_param | R Documentation |
This function creates initial outputs and parameter states for outbreaker.
create_param(data = outbreaker_data(), config = create_config())
data |
A list of data items as returned by |
config |
A list of settings as returned by |
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 length size
, storing the
steps of the MCMC corresponding to the saved samples.
post
: A numeric vector of length size
, storing
log-posterior values.
like
: A numeric vector of length size
, storing
log-likelihood values.
prior
: A numeric vector of length size
,
storing log-prior values.
alpha
: A list of length size
. Each item of the list is
an integer vector of length data$N
, storing indices (from 1 to N) of
infectors for each case.
t_inf
: A list of length size
. Each item of the list is
an integer vector of length data$N
, storing dates of infections for
each case.
mu
: A numeric vector of length size
, storing values of
the mutation rate.
kappa
: A list of length size
. Each item of the list is
an integer vector of length data$N
, storing the number of generations
before the last sampled ancestor for each case.
pi
: A numeric vector of length size
, storing values of
the reporting probability.
eps
: A numeric vector of length size
, storing values of
the contact reporting coverage.
lambda
: A numeric vector of length size
, 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 length data$N
, storing
indices (from 1 to N) of infectors for each case.
t_inf
: An integer vector of length data$N
, storing dates
of infections for each case.
mu
: The value of the mutation rate.
kappa
: An integer vector of length data$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.
Thibaut Jombart (thibautjombart@gmail.com)
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.