fastbeta.bootstrap | R Documentation |
A simple wrapper around fastbeta
, using it to generate
a “primary” estimate of a transmission rate \beta(t)
and r
bootstrap estimates. Bootstrap estimates are computed
for incidence time series simulated using sir
, with
transmission rate defined as the linear interpolant of the primary
estimate.
fastbeta.bootstrap(r, series, constants, ...)
r |
the number of replications. |
series , constants |
see |
... |
optional arguments passed to |
A “multiple time series” object, inheriting from class
mts
, with r+1
columns storing the primary
and bootstrap estimates, in that order.
It is completely parallel to argument series
, having the same
tsp
attribute.
data(sir.e02, package = "fastbeta")
a <- attributes(sir.e02)
str(sir.e02)
plot(sir.e02)
## We suppose that we have perfect knowledge of incidence,
## births, and the data-generating parameters
series <- cbind(sir.e02[, c("Z", "B")], mu = a[["mu"]](0))
colnames(series) <- c("Z", "B", "mu") # FIXME: stats:::cbind.ts mangles dimnames
constants <- c(S0 = sir.e02[[1L, "S"]],
I0 = sir.e02[[1L, "I"]],
R0 = sir.e02[[1L, "R"]],
gamma = a[["gamma"]],
delta = a[["delta"]])
R <- fastbeta.bootstrap(100L, series, constants)
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.