fastbeta.bootstrap | R Documentation |
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.
fastbeta.bootstrap(r,
series, sigma = 1, gamma = 1, delta = 0,
m = 1L, n = 1L, init, ...)
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. |
m |
a non-negative integer indicating a number of latent stages. |
n |
a positive integer indicating a number of infectious stages. |
init |
a numeric vector of length |
... |
optional arguments passed to |
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.
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.ts(seir.ts02[, c("Z", "B")], mu = a[["mu"]](0))
args <- c(list(r = 100L, series = series),
a[c("sigma", "gamma", "delta", "m", "n", "init")])
str(args)
R <- do.call(fastbeta.bootstrap, args)
str(R)
plot(R)
plot(R, level = 0.95)
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.