fastbeta.bootstrap {fastbeta} | R Documentation |
Parametric Bootstrapping
Description
A simple wrapper around fastbeta
using it to generate a
“primary” estimate of a time-varying transmission rate and
r
bootstrap estimates. Bootstrap estimates are computed for
incidence time series simulated using seir
, with
transmission rate defined as the linear interpolant of the primary
estimate.
Usage
fastbeta.bootstrap(r,
series, sigma = gamma, gamma = 1, delta = 0,
init, m = length(init) - n - 2L, n = 1L, ...)
Arguments
r |
a non-negative integer indicating a number of replications. |
series |
a “multiple time series” object, inheriting from class
|
sigma , gamma , delta |
non-negative numbers. |
init |
a numeric vector of length |
m |
a non-negative integer indicating a number of latent stages. |
n |
a positive integer indicating a number of infectious stages. |
... |
optional arguments passed to |
Value
A “multiple time series” object, inheriting from class
mts
, with 1+r
columns storing the one primary
and r
bootstrap estimates. It is completely parallel to argument
series
, having the same tsp
attribute.
Examples
if (requireNamespace("adaptivetau")) withAutoprint({
data(seir.ts02, package = "fastbeta")
a <- attributes(seir.ts02)
str(seir.ts02)
plot(seir.ts02)
## We suppose that we have perfect knowledge of incidence,
## births, and the data-generating parameters
series <- cbind(seir.ts02[, c("Z", "B")], mu = a[["mu"]](0))
colnames(series) <- c("Z", "B", "mu") # FIXME: stats:::cbind.ts mangles dimnames
args <- c(list(r = 100L, series = series),
a[c("sigma", "gamma", "delta", "init", "m", "n")])
str(args)
R <- do.call(fastbeta.bootstrap, args)
str(R)
plot(R)
plot(R, level = 0.95)
})