File: overall_infectivity.Rd

package info (click to toggle)
r-cran-epiestim 2.2-4%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid, trixie
  • size: 636 kB
  • sloc: sh: 15; makefile: 2
file content (59 lines) | stat: -rw-r--r-- 2,214 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/overall_infectivity.R
\name{overall_infectivity}
\alias{overall_infectivity}
\title{Overall Infectivity Due To Previously Infected Individuals}
\usage{
overall_infectivity(incid, si_distr)
}
\arguments{
\item{incid}{One of the following \itemize{ \item{A vector (or a dataframe
with a single column) of non-negative integers containing an incidence time
series} \item{A dataframe of non-negative integers with two columns, so
that \code{incid$local} contains the incidence of cases due to local
transmission and \code{incid$imported} contains the incidence of imported
cases (with \code{incid$local + incid$imported} the total incidence).} } 
Note that the cases from the first time step are always all assumed to be
imported cases.}

\item{si_distr}{Vector of probabilities giving the discrete distribution of
the serial interval.}
}
\value{
A vector which contains the overall infectivity \eqn{\lambda_t} at
  each time step
}
\description{
\code{overall_infectivity} computes the overall infectivity due to previously
infected individuals.
}
\details{
{ The overall infectivity \eqn{\lambda_t} at time step \eqn{t} is
equal to the sum of the previously infected individuals (given by the
incidence vector \eqn{I}, with \code{I = incid$local + incid$imported} if
\eqn{I} is a matrix), weigthed by their infectivity at time \eqn{t} (given by
the discrete serial interval distribution \eqn{w_k}). In mathematical terms: 
\cr \eqn{\lambda_t = \sum_{k=1}^{t-1}I_{t-k}w_k} \cr }
}
\examples{
## load data on pandemic flu in a school in 2009
data("Flu2009")

## compute overall infectivity
lambda <- overall_infectivity(Flu2009$incidence, Flu2009$si_distr)
par(mfrow=c(2,1))
plot(Flu2009$incidence, type = "s", xlab = "time (days)", ylab = "incidence")
title(main = "Epidemic curve")
plot(lambda, type = "s", xlab = "time (days)", ylab = "Infectivity")
title(main = "Overall infectivity")
}
\references{
Cori, A. et al. A new framework and software to estimate
  time-varying reproduction numbers during epidemics (AJE 2013).
}
\seealso{
\code{\link{discr_si}}, \code{\link{estimate_R}}
}
\author{
Anne Cori \email{a.cori@imperial.ac.uk}
}