fastbeta {fastbeta} | R Documentation |
Estimate a Time-Varying Infectious Disease Transmission Rate
Description
Generates a discrete approximation of a time-varying infectious disease
transmission rate from an equally spaced incidence time series and other
data.
Usage
fastbeta(series, sigma = gamma, gamma = 1, delta = 0,
init, m = length(init) - n - 2L, n = 1L, ...)
Arguments
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.
|
init |
a numeric vector of length 1+m+n+1 giving an initial state with
compartments ordered as (S,E,I,R) .
|
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 deconvolve , if the first
column of series represents observed incidence rather
than actual or estimated incidence.
|
Details
The algorithm implemented by fastbeta
is based on an SEIR model
with
-
m
latent stages
(Ei
, i=1,…,m
);
-
n
infectious stages
(Ij
, j=1,…,n
);
time-varying rates β
, ν
, and μ
of
transmission, birth, and natural death; and
constant rates mσ
, nγ
, and δ
of
removal from each latent, infectious, and recovered compartment, where
removal from the recovered compartment implies return to the
susceptible compartment (loss of immunity).
It is derived by linearizing of the system of ordinary differential
equations
ddddddSE1Ei+1I1Ij+1R/dt/dt/dt/dt/dt/dt======δλ(t)mσmσnγnγRSEiEmIjIn−(−(−(−(−(−(λ(t)mσmσnγnγδ+μ(t))S+μ(t))E1+μ(t))Ei+1+μ(t))I1+μ(t))Ij+1+μ(t))R+ν(t)λ(t)=β(t)∑jIj
and substituting actual or estimated incidence and births for definite
integrals of λS
and ν
. This procedure yields a
system of linear difference equations from which one recovers a discrete
approximation of β
:
Et+11Et+1i+1It+11It+1j+1Rt+1St+1======[(1−21([(1−21([(1−21([(1−21([(1−21([(1−21(mσ+μt))mσ+μt))nγ+μt))nγ+μt))δ+μt))μt))Et1Eti+1It1Itj+1RtSt+++++2121212121mσ(mσ(nγ(nγ(δ(EtiEtmItjItnRt+++++Et+1iEt+1mIt+1jIt+1nRt+1)))))+Zt+1−Zt+1]]]]]+Bt+1]/[1+21(/[1+21(/[1+21(/[1+21(/[1+21(/[1+21(mσ+μt+1)]mσ+μt+1)]nγ+μt+1)]nγ+μt+1)]δ+μt+1)]μt+1)]βt=(Zt+Zt+1)/(2St∑jItj)
where we use the notation
Xt∼X(t):X=S,Ei,Ij,R,Z,B,μ,βZ(t)B(t)=∫t−1tλ(s)S(s)ds=∫t−1tν(s)ds
and it is understood that the independent variable t
is a unitless
measure of time relative to the spacing of the substituted time series
of incidence and births.
Value
A “multiple time series” object, inheriting from class
mts
, with 1+m+n+1+1
columns (named S
,
E
, I
, R
, and beta
) storing the result of the
iteration described in ‘Details’. It is completely parallel to
argument series
, having the same tsp
attribute.
References
Jagan, M., deJonge, M. S., Krylova, O., & Earn, D. J. D. (2020).
Fast estimation of time-varying infectious disease transmission rates.
PLOS Computational Biology,
16(9), Article e1008124, 1-39.
doi:10.1371/journal.pcbi.1008124
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(series = series),
a[c("sigma", "gamma", "delta", "init", "m", "n")])
str(args)
X <- do.call(fastbeta, args)
str(X)
plot(X)
plot(X[, "beta"], ylab = "transmission rate")
lines(a[["beta"]](time(X)), col = "red") # the "truth"
})
[Package
fastbeta version 0.3.0
Index]