R/epiestim_rt.R
lancelot_rt_trajectories_epiestim.Rd
Compute "Rt" using EpiEtim for a set of simulated trajectories (e.g., the
result of the $iterate()
method of lancelot, mcstate::pmcmc()
or
mcstate::pmcmc_predict()
. The trajectories should share
parameters.
lancelot_rt_trajectories_epiestim(
step,
incidence,
p,
gt_distr = NULL,
sliding_window_ndays = 7,
mean_prior = 1,
sd_prior = 1,
n_GT = 10000,
n_R = 1000,
save_all_Rt_sample = TRUE,
q = NULL
)
A vector of steps
A matrix (n trajectories x n steps) of incidence counts
A single lancelot_parameters()
object.
A vector giving the discrete (daily) distribution of the
generation time. The first value must be zero. If NULL, the generation time
distribution will be determined automatically from p
.
An integer giving the length of the sliding window on which Rt will be estimated
The mean prior for Rt
The standard deviation of the prior for Rt
An integer giving the number of generation times to be drawn to construct the discrete distribution of the generation time
An integer giving the number of Rt values to sample from for each incidence trajectory. These will then be aggregated across all incidence trajectories.
A boolean determining whether to save all samples of Rt estimated or only a summary
A vector of quantiles to return values for
A list with elements
t_start
(vector of first days of the sliding windows over which Rt is
estimated),
t_end
(vector of last days of the sliding windows over which Rt is
estimated),
Rt
a matrix (only present if save_all = TRUE
) containing for each
sliding window (each col in the matrix) a sample of n_R * nrow(inc) values
of Rt for that sliding window (rows of the matrix)
Rt_summary
a matrix containing for each sliding window (each col in the
matrix) the quantiles (q
) and the mean of Rt for that sliding
window (rows of the matrix)
gt_distr
a vector giving the discrete (daily) distribution of the
generation time