SimInf_abcStorage class for the results of an Approximate Bayesian
Computation (ABC) parameter estimation using Sequential Monte
Carlo (SMC). The SimInf_abc class holds the model
definition, prior distributions, accepted parameter values
(particles), weights, distances, and convergence diagnostics.
modelA SimInf_model object containing
the model structure (transitions, compartments, etc.) for
which parameters are being estimated.
priorsA data.frame defining the prior distributions
for the parameters. It contains four columns:
parameter: The name of the parameter in the
model.
distribution: The prior distribution
type. Valid values are "gamma", "lognormal",
"normal", or "uniform".
p1: The first hyperparameter:
"gamma": shape
"lognormal": meanlog (mean on the
log scale)
"normal": mean
"uniform": lower bound
p2: The second hyperparameter:
"gamma": rate
"lognormal": sdlog (standard
deviation on the log scale)
"normal": sd (standard deviation)
"uniform": upper bound
targetCharacter vector ("gdata" or "ldata")
that determines if the ABC-SMC method estimates parameters in
model@gdata (global data) or in model@ldata
(local data).
parsAn integer vector with the indices of the parameters in
target that are being estimated.
npropAn integer vector with the number of simulated proposals (particles) generated in each generation.
fnA function used to calculate summary statistics from the
simulated trajectory and compute the distance for each
particle. See abc for details on the required
function signature.
toleranceA numeric matrix (number of summary statistics \(\times\) number of generations) where each column contains the tolerances for a generation and each row contains a sequence of gradually decreasing tolerances.
xA numeric array (number of particles \(\times\) number of parameters \(\times\) number of generations) with the parameter values for the accepted particles in each generation. Each row is one particle.
weightA numeric matrix (number of particles \(\times\)
number of generations) with the weights for the particles
x in the corresponding generation.
distanceA numeric array (number of particles \(\times\)
number of summary statistics \(\times\) number of
generations) with the distance for the particles x in
each generation. Each row contains the distance for a particle
and each column contains the distance for a summary statistic.
essA numeric vector with the effective sample size (ESS) in each generation. The effective sample size is computed as $$\left(\sum_{i=1}^N\!(w_{g}^{(i)})^2\right)^{-1},$$ where \(w_{g}^{(i)}\) is the normalized weight of particle \(i\) in generation \(g\).
init_modelAn optional function that, if non-NULL, is
applied before running each proposal. The function must accept
one argument of type SimInf_model with the current
model of the fitting process and return a modified model. This
function can be useful to specify the initial state of
u0 or v0 of the model before running a
trajectory with proposed parameters.
abc for the main ABC function and
continue_abc for continuing an ABC run.