contact_score: Compute the tracing score of a contact

Description Usage Arguments Details Value Author(s) Examples

Description

This function compute the tracing score of a contact, i.e. an individual who has had at least one recorded exposure to a case. For a contact, the tracing score is defined as the probability that this individual will show symptoms for the first time on day 't'.

Usage

1
contact_score(x, R, lambda, w)

Arguments

x

A vector of integers indicating dates of onset of the cases causing exposure.

R

The average effective reproduction number, i.e. the average number of secondar cases seeded by an infected individual.

lambda

The average number of contacts (infectious or not) reported by cases.

w

The probability mass function of the serial interval, i.e. the delay from primary to secondary symptom onset. We recommend using the distcrete package to generate discretized distributions (see details).

Details

See the distcrete package for generating discretized distributions at: http://github.com/reconhub/distcrete.

Value

A function with two arguments:

Author(s)

Thibaut Jombart (thibautjombart@gmail.com)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
if (require(distcrete)) {
 ## generate serial interval distribution
 SI <- distcrete("gamma", 1L, w = 0, 10, 0.65)$d
 plot(SI, type="h", xlim=c(0,50), xlab = "Days")
 title("Serial interval distribution")

 ## get tracing score function for:
 ## - exposure to cases with onsets: 1, 10, 25
 ## - R = 2.1
 ## - lambda = 3.5
 f <- contact_score(c(1,10,25), R = 2.1, lambda = 3.5, SI)

 ## score for various days
 f(0) # day 0
 f(10) # day 10
 f(10:20)

 ## plot score for various days
 plot(f, type = "h", xlim = c(0,60), col = pal1(100),
      xlab = "Date", ylab = "P(new symptoms)")
 title("Contact score over time")
}

reconhub/tracer documentation built on May 27, 2019, 4:02 a.m.