Switch to unified view

a b/docs/reference/create_param.html
1
<!-- Generated by pkgdown: do not edit by hand -->
2
<!DOCTYPE html>
3
<html lang="en">
4
  <head>
5
  <meta charset="utf-8">
6
<meta http-equiv="X-UA-Compatible" content="IE=edge">
7
<meta name="viewport" content="width=device-width, initial-scale=1.0">
8
9
<title>Initializes outputs for outbreaker — create_param • outbreaker2</title>
10
11
12
<!-- jquery -->
13
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script>
14
<!-- Bootstrap -->
15
16
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/css/bootstrap.min.css" integrity="sha256-bZLfwXAP04zRMK2BjiO8iu9pf4FbLqX6zitd+tIvLhE=" crossorigin="anonymous" />
17
18
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js" integrity="sha256-nuL8/2cJ5NDSSwnKD8VqreErSWHtnEP9E7AySL+1ev4=" crossorigin="anonymous"></script>
19
20
<!-- bootstrap-toc -->
21
<link rel="stylesheet" href="../bootstrap-toc.css">
22
<script src="../bootstrap-toc.js"></script>
23
24
<!-- Font Awesome icons -->
25
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css" integrity="sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=" crossorigin="anonymous" />
26
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css" integrity="sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=" crossorigin="anonymous" />
27
28
<!-- clipboard.js -->
29
<script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js" integrity="sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=" crossorigin="anonymous"></script>
30
31
<!-- headroom.js -->
32
<script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js" integrity="sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=" crossorigin="anonymous"></script>
33
<script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js" integrity="sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=" crossorigin="anonymous"></script>
34
35
<!-- pkgdown -->
36
<link href="../pkgdown.css" rel="stylesheet">
37
<script src="../pkgdown.js"></script>
38
39
40
41
42
<meta property="og:title" content="Initializes outputs for outbreaker — create_param" />
43
<meta property="og:description" content="This function creates initial outputs and parameter states for outbreaker." />
44
45
46
47
48
<!-- mathjax -->
49
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script>
50
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script>
51
52
<!--[if lt IE 9]>
53
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
54
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
55
<![endif]-->
56
57
58
59
  </head>
60
61
  <body data-spy="scroll" data-target="#toc">
62
    <div class="container template-reference-topic">
63
      <header>
64
      <div class="navbar navbar-default navbar-fixed-top" role="navigation">
65
  <div class="container">
66
    <div class="navbar-header">
67
      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false">
68
        <span class="sr-only">Toggle navigation</span>
69
        <span class="icon-bar"></span>
70
        <span class="icon-bar"></span>
71
        <span class="icon-bar"></span>
72
      </button>
73
      <span class="navbar-brand">
74
        <a class="navbar-link" href="../index.html">outbreaker2</a>
75
        <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.1.2</span>
76
      </span>
77
    </div>
78
79
    <div id="navbar" class="navbar-collapse collapse">
80
      <ul class="nav navbar-nav">
81
        <li>
82
  <a href="../index.html">
83
    <span class="fas fa-home fa-lg"></span>
84
     
85
  </a>
86
</li>
87
<li>
88
  <a href="../reference/index.html">Reference</a>
89
</li>
90
<li class="dropdown">
91
  <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
92
    Articles
93
     
94
    <span class="caret"></span>
95
  </a>
96
  <ul class="dropdown-menu" role="menu">
97
    <li>
98
      <a href="../articles/customisation.html">Using custom priors, likelihood, or movements in outbreaker2</a>
99
    </li>
100
    <li>
101
      <a href="../articles/introduction.html">Introduction to outbreaker2</a>
102
    </li>
103
    <li>
104
      <a href="../articles/overview.html">outbreaker2: package overview</a>
105
    </li>
106
    <li>
107
      <a href="../articles/Rcpp_API.html">outbreaker2: Rcpp API</a>
108
    </li>
109
  </ul>
110
</li>
111
<li>
112
  <a href="../news/index.html">Changelog</a>
113
</li>
114
      </ul>
115
      <ul class="nav navbar-nav navbar-right">
116
        
117
      </ul>
118
      
119
    </div><!--/.nav-collapse -->
120
  </div><!--/.container -->
121
</div><!--/.navbar -->
122
123
      
124
125
      </header>
126
127
<div class="row">
128
  <div class="col-md-9 contents">
129
    <div class="page-header">
130
    <h1>Initializes outputs for outbreaker</h1>
131
    
132
    <div class="hidden name"><code>create_param.Rd</code></div>
133
    </div>
134
135
    <div class="ref-description">
136
    <p>This function creates initial outputs and parameter states for outbreaker.</p>
137
    </div>
138
139
    <pre class="usage"><span class='fu'>create_param</span><span class='op'>(</span>data <span class='op'>=</span> <span class='fu'><a href='outbreaker_data.html'>outbreaker_data</a></span><span class='op'>(</span><span class='op'>)</span>, config <span class='op'>=</span> <span class='fu'><a href='create_config.html'>create_config</a></span><span class='op'>(</span><span class='op'>)</span><span class='op'>)</span></pre>
140
141
    <h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a>Arguments</h2>
142
    <table class="ref-arguments">
143
    <colgroup><col class="name" /><col class="desc" /></colgroup>
144
    <tr>
145
      <th>data</th>
146
      <td><p>A list of data items as returned by <code>outbreaker_data</code>, or
147
arguments passed to this function.</p></td>
148
    </tr>
149
    <tr>
150
      <th>config</th>
151
      <td><p>A list of settings as returned by <code>create_config</code>, or
152
arguments passed to this function.</p></td>
153
    </tr>
154
    </table>
155
156
    <h2 class="hasAnchor" id="value"><a class="anchor" href="#value"></a>Value</h2>
157
158
    <p>A list containing two components <code>$store</code> and
159
<code>$current</code>. <code>store</code> is a list with the class
160
<code>outbreaker_store</code>, used for storing 'saved' states of the
161
MCMC. <code>current</code> is a list with the class <code>outbreaker_param</code>, used
162
for storing 'current' states of the MCMC. <br /> <br /></p>
163
<p><code>outbreaker_store</code> class content:</p><ul>
164
<li><p><code>size</code>: The length of the list, corresponding to the number of
165
samples saved from the MCMC.</p></li>
166
<li><p><code>step</code>: A vector of integers of length <code>size</code>, storing the
167
steps of the MCMC corresponding to the saved samples.</p></li>
168
<li><p><code>post</code>: A numeric vector of length <code>size</code>, storing
169
log-posterior values.</p></li>
170
<li><p><code>like</code>: A numeric vector of length <code>size</code>, storing
171
log-likelihood values.</p></li>
172
<li><p><code>prior</code>: A numeric vector of length <code>size</code>,
173
storing log-prior values.</p></li>
174
<li><p><code>alpha</code>: A list of length <code>size</code>. Each item of the list is
175
an integer vector of length <code>data$N</code>, storing indices (from 1 to N) of
176
infectors for each case.</p></li>
177
<li><p><code>t_inf</code>: A list of length <code>size</code>. Each item of the list is
178
an integer vector of length <code>data$N</code>, storing dates of infections for
179
each case.</p></li>
180
<li><p><code>mu</code>: A numeric vector of length <code>size</code>, storing values of
181
the mutation rate.</p></li>
182
<li><p><code>kappa</code>: A list of length <code>size</code>. Each item of the list is
183
an integer vector of length <code>data$N</code>, storing the number of generations
184
before the last sampled ancestor for each case.</p></li>
185
<li><p><code>pi</code>: A numeric vector of length <code>size</code>, storing values of
186
the reporting probability.</p></li>
187
<li><p><code>eps</code>: A numeric vector of length <code>size</code>, storing values of
188
the contact reporting coverage.</p></li>
189
<li><p><code>lambda</code>: A numeric vector of length <code>size</code>, storing values of
190
the non-infectious contact rate.</p></li>
191
<li><p><code>counter</code>: A counter used to keep track of the current iteration
192
of the MCMC (used internally).</p></li>
193
</ul>
194
195
196
<p><code>outbreaker_param</code> class content:</p><ul>
197
<li><p><code>alpha</code>: An integer vector of length <code>data$N</code>, storing
198
indices (from 1 to N) of infectors for each case.</p></li>
199
<li><p><code>t_inf</code>: An integer vector of length <code>data$N</code>, storing dates
200
of infections for each case.</p></li>
201
<li><p><code>mu</code>: The value of the mutation rate.</p></li>
202
<li><p><code>kappa</code>: An integer vector of length <code>data$N</code>, storing the
203
number of generations before the last sampled ancestor for each case.</p></li>
204
<li><p><code>pi</code>: The value of the reporting probability.</p></li>
205
<li><p><code>eps</code>: The value of the contact reporting coverage.</p></li>
206
<li><p><code>lambda</code>: The value of the non-infectious contact rate.</p></li>
207
</ul>
208
209
    <h2 class="hasAnchor" id="author"><a class="anchor" href="#author"></a>Author</h2>
210
211
    <p>Thibaut Jombart (<a href='mailto:thibautjombart@gmail.com'>thibautjombart@gmail.com</a>)</p>
212
213
    <h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2>
214
    <pre class="examples"><div class='input'>
215
<span class='co'>## load data</span>
216
<span class='va'>x</span> <span class='op'>&lt;-</span> <span class='va'>fake_outbreak</span>
217
<span class='va'>data</span> <span class='op'>&lt;-</span> <span class='fu'><a href='outbreaker_data.html'>outbreaker_data</a></span><span class='op'>(</span>dates <span class='op'>=</span> <span class='va'>x</span><span class='op'>$</span><span class='va'>sample</span>, dna <span class='op'>=</span> <span class='va'>x</span><span class='op'>$</span><span class='va'>dna</span>, w_dens <span class='op'>=</span> <span class='va'>x</span><span class='op'>$</span><span class='va'>w</span><span class='op'>)</span>
218
219
<span class='co'>## modify config settings</span>
220
<span class='va'>config</span> <span class='op'>&lt;-</span> <span class='fu'><a href='create_config.html'>create_config</a></span><span class='op'>(</span>move_alpha <span class='op'>=</span> <span class='cn'>FALSE</span>, n_iter <span class='op'>=</span> <span class='fl'>2e5</span>, sample_every <span class='op'>=</span> <span class='fl'>1000</span><span class='op'>)</span>
221
222
<span class='co'>## create param object</span>
223
<span class='va'>param</span> <span class='op'>&lt;-</span> <span class='fu'>create_param</span><span class='op'>(</span>data <span class='op'>=</span> <span class='va'>data</span>, config <span class='op'>=</span> <span class='va'>config</span><span class='op'>)</span>
224
225
</div></pre>
226
  </div>
227
  <div class="col-md-3 hidden-xs hidden-sm" id="pkgdown-sidebar">
228
    <nav id="toc" data-toggle="toc" class="sticky-top">
229
      <h2 data-toc-skip>Contents</h2>
230
    </nav>
231
  </div>
232
</div>
233
234
235
      <footer>
236
      <div class="copyright">
237
  <p>Developed by Thibaut Jombart, Finlay Campbell, Rich Fitzjohn.</p>
238
</div>
239
240
<div class="pkgdown">
241
  <p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.6.1.</p>
242
</div>
243
244
      </footer>
245
   </div>
246
247
  
248
249
250
  </body>
251
</html>
252
253