R0
defined in package "twinstim"
class, which
computes mean numbers of infections caused by infected individuals depending on the event type
and marks attached to the individual, which contribute to the infection pressure
in the epidemic predictor of that class.
There is also a method for simulated epidemics (internally just a
wrapper for the "twinstim"
-method).R0(object, ...)## S3 method for class 'twinstim':
R0(object, newevents, trimmed = TRUE, ...)
## S3 method for class 'simEpidataCS':
R0(object, trimmed = TRUE, ...)
R0
method exists.data.frame
of events for which the basic reproduction
numbers should be calculated. If omitted, it is calculated for the
original events from the fit. In this case, if
trimmed = TRUE
(the default), the rtrimmed = TRUE
) or over
the whole time-space domain R+ x R^2 (twinstim
method.object
corresponding to the rows of newevents
(if
supplied) or the original fitted events including events of the prehistory."twinstim"
class, the individual-specific mean
number $\mu_j$ of infections caused by individual (event) $j$
inside its theoretical (untrimmed) spatio-temporal range of interaction
given by its eps.t
($\epsilon$) and eps.s
($\delta$) values is defined as follows (cf. Meyer et al, 2012):
$$\mu_j = e^{\eta_j} \cdot \int_0^\epsilon g(t) dt \cdot
\int_{b(\bold{0},\delta)} f(\bold{s}) d\bold{s} .$$
Here, $b(\bold{0},\delta)$ denotes the disc centred at (0,0)' with
radius $\delta$, $\eta_j$ is the epidemic linear predictor,
$g(t)$ is the temporal interaction function, and $f(\bold{s})$
is the spatial interaction function.
Alternatively, the trimmed
(observed) mean reproduction numbers
are obtain by integrating over the observed infectious domains of the
individuals, i.e. integrate $f$ over the intersection of the
influence region with the observation region W
(i.e. over ${ W \cap b(\bold{s}_j,\delta) } - \bold{s}_j$)
and $g$ over the intersection of the observed infectious period with
the observation period $(t_0;T]$ (i.e. over
$(0; \min(T-t_j,\epsilon)]$).(Numerical) Integration is performed exactly as during the fitting of
object
, for instance object$control.siaf
is queried if
necessary.
# load the 'imdepi' data and a model fit
data(imdepi)
data(imdepifit)
R0s <- R0(imdepifit)
tapply(R0s, imdepi$events@data[names(R0s), "type"], summary)
R0(imdepifit, newevents=marks(imdepi)[1,], trimmed=FALSE)
Run the code above in your browser using DataLab