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,...)
Arguments
r: a non-negative integer indicating a number of replications.
series: a multiple time series object, inheriting from class mts, with three columns storing (parallel , equally spaced) time series of incidence, births, and the per capita natural mortality rate, in that order.
sigma, gamma, delta: non-negative numbers. m*sigma, n*gamma, and delta are the rates of removal from each latent, infectious, and recovered compartment.
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 1+m+n+1 giving an initial state with compartments ordered as c(S,E,I,R).
...: optional arguments passed to seir and/or deconvolve. Both take optional arguments prob
and delay. When prob is supplied but not delay, seir and deconvolve receive prob as is. When both are supplied, seir receives prob as is, whereas deconvolve receives prob augmented with length(delay)-1 ones.
Returns
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 parametersseries <- cbind(seir.ts02[, c("Z","B")], mu = a[["mu"]](0))colnames(series)<- c("Z","B","mu")# FIXME: stats:::cbind.ts mangles dimnamesargs <- 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)})