2 <!-- Generated by pkgdown: do not edit by hand --><html lang=
"en">
4 <meta http-equiv=
"Content-Type" content=
"text/html; charset=UTF-8">
6 <meta http-equiv=
"X-UA-Compatible" content=
"IE=edge">
7 <meta name=
"viewport" content=
"width=device-width, initial-scale=1, shrink-to-fit=no">
8 <title>White and Pagano: Utilizing the Serial Distribution • Rnaught
</title>
9 <script src=
"../deps/jquery-3.6.0/jquery-3.6.0.min.js"></script><meta name=
"viewport" content=
"width=device-width, initial-scale=1, shrink-to-fit=no">
10 <link href=
"../deps/bootstrap-5.3.1/bootstrap.min.css" rel=
"stylesheet">
11 <script src=
"../deps/bootstrap-5.3.1/bootstrap.bundle.min.js"></script><link href=
"../deps/font-awesome-6.5.2/css/all.min.css" rel=
"stylesheet">
12 <link href=
"../deps/font-awesome-6.5.2/css/v4-shims.min.css" rel=
"stylesheet">
13 <script src=
"../deps/headroom-0.11.0/headroom.min.js"></script><script src=
"../deps/headroom-0.11.0/jQuery.headroom.min.js"></script><script src=
"../deps/bootstrap-toc-1.0.1/bootstrap-toc.min.js"></script><script src=
"../deps/clipboard.js-2.0.11/clipboard.min.js"></script><script src=
"../deps/search-1.0.0/autocomplete.jquery.min.js"></script><script src=
"../deps/search-1.0.0/fuse.min.js"></script><script src=
"../deps/search-1.0.0/mark.min.js"></script><!-- pkgdown --><script src=
"../pkgdown.js"></script><meta property=
"og:title" content=
"White and Pagano: Utilizing the Serial Distribution">
16 <a href=
"#main" class=
"visually-hidden-focusable">Skip to contents
</a>
19 <nav class=
"navbar navbar-expand-lg fixed-top bg-light" data-bs-theme=
"light" aria-label=
"Site navigation"><div class=
"container">
21 <a class=
"navbar-brand me-2" href=
"../index.html">Rnaught
</a>
23 <small class=
"nav-text text-muted me-auto" data-bs-toggle=
"tooltip" data-bs-placement=
"bottom" title=
"">0.1.0</small>
26 <button class=
"navbar-toggler" type=
"button" data-bs-toggle=
"collapse" data-bs-target=
"#navbar" aria-controls=
"navbar" aria-expanded=
"false" aria-label=
"Toggle navigation">
27 <span class=
"navbar-toggler-icon"></span>
30 <div id=
"navbar" class=
"collapse navbar-collapse ms-3">
31 <ul class=
"navbar-nav me-auto">
32 <li class=
"nav-item"><a class=
"nav-link" href=
"../reference/index.html">Reference
</a></li>
33 <li class=
"active nav-item dropdown">
34 <button class=
"nav-link dropdown-toggle" type=
"button" id=
"dropdown-articles" data-bs-toggle=
"dropdown" aria-expanded=
"false" aria-haspopup=
"true">Articles
</button>
35 <ul class=
"dropdown-menu" aria-labelledby=
"dropdown-articles">
36 <li><a class=
"dropdown-item" href=
"../articles/seq_bayes_post.html">Sequential Bayes: Utilizing the Posterior Distribution
</a></li>
37 <li><a class=
"dropdown-item" href=
"../articles/wp_serial.html">White and Pagano: Utilizing the Serial Distribution
</a></li>
41 <ul class=
"navbar-nav">
42 <li class=
"nav-item"><form class=
"form-inline" role=
"search">
43 <input class=
"form-control" type=
"search" name=
"search-input" id=
"search-input" autocomplete=
"off" aria-label=
"Search site" placeholder=
"Search for" data-search-index=
"../search.json">
45 <li class=
"nav-item"><a class=
"external-link nav-link" href=
"https://github.com/MI2YorkU/Rnaught/" aria-label=
"GitHub"><span class=
"fa fab fa-github fa-lg"></span></a></li>
51 </nav><div class=
"container template-article">
57 <main id=
"main" class=
"col-md-9"><div class=
"page-header">
58 <img src=
"../logo.svg" class=
"logo" alt=
""><h1>White and Pagano: Utilizing the Serial Distribution
</h1>
61 <small class=
"dont-index">Source:
<a href=
"https://github.com/MI2YorkU/Rnaught/blob/master/vignettes/wp_serial.Rmd" class=
"external-link"><code>vignettes/wp_serial.Rmd
</code></a></small>
62 <div class=
"d-none name"><code>wp_serial.Rmd
</code></div>
67 <p>The serial distribution of an infectious disease is the distribution
68 of the time from when an infectious individual – the infector – becomes
69 symptomatic, to when another individual who is infected by the infector
70 becomes symptomatic. The serial interval refers to a range of likely
71 values from this distribution, although it is typically reported as the
73 <p>In the White and Pagano method, the serial distribution is assumed to
74 be a discretized, finite version of a gamma distribution. Setting the
75 parameter
<code>serial
</code> to
<code>TRUE
</code> causes this
76 discretized distribution to be returned in addition to the estimate of
77 R0. Furthermore, the method can be used whether or not the serial
78 interval (specified as the parameter
<code>mu
</code>) is known. When
79 <code>mu
</code> is specified, it is taken to be the mean of a continuous
80 gamma distribution (i.e., before the discretization). As such, the mean
81 computed from the returned serial distribution may differ slightly from
83 <div class=
"sourceCode" id=
"cb1"><pre class=
"downlit sourceCode r">
84 <code class=
"sourceCode R"><span><span class=
"co"># Case counts.
</span></span>
85 <span><span class=
"va">cases
</span> <span class=
"op"><-
</span> <span class=
"fu"><a href=
"https://rdrr.io/r/base/c.html" class=
"external-link">c
</a></span><span class=
"op">(
</span><span class=
"fl">1</span>,
<span class=
"fl">4</span>,
<span class=
"fl">10</span>,
<span class=
"fl">5</span>,
<span class=
"fl">3</span>,
<span class=
"fl">4</span>,
<span class=
"fl">19</span>,
<span class=
"fl">3</span>,
<span class=
"fl">3</span>,
<span class=
"fl">14</span>,
<span class=
"fl">4</span><span class=
"op">)
</span></span>
87 <span><span class=
"va">estimate
</span> <span class=
"op"><-
</span> <span class=
"fu"><a href=
"../reference/wp.html">wp
</a></span><span class=
"op">(
</span><span class=
"va">cases
</span>, mu
<span class=
"op">=
</span> <span class=
"fl">3.333</span>, serial
<span class=
"op">=
</span> <span class=
"cn">TRUE
</span><span class=
"op">)
</span></span>
89 <span><span class=
"co"># `supp` is the support of the distribution, and `pmf` is its probability mass
</span></span>
90 <span><span class=
"co"># function.
</span></span>
91 <span><span class=
"fu"><a href=
"https://rdrr.io/r/base/sum.html" class=
"external-link">sum
</a></span><span class=
"op">(
</span><span class=
"va">estimate
</span><span class=
"op">$
</span><span class=
"va">supp
</span> <span class=
"op">*
</span> <span class=
"va">estimate
</span><span class=
"op">$
</span><span class=
"va">pmf
</span><span class=
"op">)
</span></span>
92 <span><span class=
"co">#
> [
1]
3.840047</span></span></code></pre></div>
93 <p>When
<code>mu
</code> is unspecified (left to its default value of
94 <code>NA
</code>), the method performs a maximum likelihood estimation
95 over all (discretized) gamma distributions via a grid search, whose
96 range of parameters are specified via
<code>grid_length
</code>,
97 <code>max_shape
</code> and
<code>max_scale
</code> (see
<code><a href=
"../reference/wp.html">?wp
</a></code>
98 for more details). It is useful to return the estimated serial
99 distribution in this case, as it can provide estimates of the serial
100 interval when it is unknown:
</p>
101 <div class=
"sourceCode" id=
"cb2"><pre class=
"downlit sourceCode r">
102 <code class=
"sourceCode R"><span><span class=
"co"># The grid search parameters specified below are the default values.
</span></span>
103 <span><span class=
"va">estimate
</span> <span class=
"op"><-
</span> <span class=
"fu"><a href=
"../reference/wp.html">wp
</a></span><span class=
"op">(
</span><span class=
"va">cases
</span>, serial
<span class=
"op">=
</span> <span class=
"cn">TRUE
</span>,
</span>
104 <span> grid_length
<span class=
"op">=
</span> <span class=
"fl">100</span>, max_shape
<span class=
"op">=
</span> <span class=
"fl">10</span>, max_scale
<span class=
"op">=
</span> <span class=
"fl">10</span></span>
105 <span><span class=
"op">)
</span></span>
107 <span><span class=
"va">serial_mean
</span> <span class=
"op"><-
</span> <span class=
"fu"><a href=
"https://rdrr.io/r/base/sum.html" class=
"external-link">sum
</a></span><span class=
"op">(
</span><span class=
"va">estimate
</span><span class=
"op">$
</span><span class=
"va">supp
</span> <span class=
"op">*
</span> <span class=
"va">estimate
</span><span class=
"op">$
</span><span class=
"va">pmf
</span><span class=
"op">)
</span></span>
108 <span><span class=
"va">serial_mean
</span></span>
109 <span><span class=
"co">#
> [
1]
3.564191</span></span>
111 <span><span class=
"co"># Compute the (discrete) median for an alternative estimate of the serial
</span></span>
112 <span><span class=
"co"># interval.
</span></span>
113 <span><span class=
"va">cdf
</span> <span class=
"op"><-
</span> <span class=
"fu"><a href=
"https://rdrr.io/r/base/cumsum.html" class=
"external-link">cumsum
</a></span><span class=
"op">(
</span><span class=
"va">estimate
</span><span class=
"op">$
</span><span class=
"va">pmf
</span><span class=
"op">)
</span></span>
114 <span><span class=
"va">serial_med
</span> <span class=
"op"><-
</span> <span class=
"va">estimate
</span><span class=
"op">$
</span><span class=
"va">supp
</span><span class=
"op">[
</span><span class=
"fu"><a href=
"https://rdrr.io/r/base/which.html" class=
"external-link">which
</a></span><span class=
"op">(
</span><span class=
"va">cdf
</span> <span class=
"op">>=
</span> <span class=
"fl">0.5</span> <span class=
"op">&</span> <span class=
"va">estimate
</span><span class=
"op">$
</span><span class=
"va">pmf
</span> <span class=
"op">-
</span> <span class=
"va">cdf
</span> <span class=
"op">+
</span> <span class=
"fl">1</span> <span class=
"op">>=
</span> <span class=
"fl">0.5</span><span class=
"op">)
</span><span class=
"op">]
</span></span>
115 <span><span class=
"va">serial_med
</span></span>
116 <span><span class=
"co">#
> [
1]
2</span></span></code></pre></div>
117 <p>Below is a graph of the above results, containing the serial
118 distribution as well as its mean and median, which could be used as
119 estimates of the serial interval:
</p>
120 <p><img src=
"wp_serial_files/figure-html/unnamed-chunk-4-1.png" width=
"1400"></p>
126 <footer><div class=
"pkgdown-footer-left">
127 <p>Developed by Naeem Model, Sawitree Boonpatcharanon, Jane Heffernan, Hanna Jankowski.
</p>
130 <div class=
"pkgdown-footer-right">
131 <p>Site built with
<a href=
"https://pkgdown.r-lib.org/" class=
"external-link">pkgdown
</a> 2.1.1.
</p>