fastbeta.bootstrap: Parametric Bootstrapping

fastbeta.bootstrapR Documentation

Parametric Bootstrapping

Description

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.

Usage

fastbeta.bootstrap(r, series, constants, ...)

Arguments

r

the number of replications.

series, constants

see fastbeta.

...

optional arguments passed to sir and/or deconvolve. Both take optional arguments prob and delay. When prob is supplied but not delay, sir and deconvolve receive prob as is. When both are supplied, sir receives prob as is, whereas deconvolve receives prob augmented with length(delay)-1 ones.

Value

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.

Examples


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)

davidearn/fastbeta documentation built on April 30, 2024, 2:35 a.m.