-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathintro.html
254 lines (242 loc) · 12.8 KB
/
intro.html
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Introduction — Semi-Markov 1.0 documentation</title>
<link rel="stylesheet" href="_static/sphinxdoc.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '',
VERSION: '1.0',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<link rel="top" title="Semi-Markov 1.0 documentation" href="index.html" />
<link rel="up" title="Semi-Markov Library Manual" href="manual.html" />
<link rel="next" title="Requirements and Installation" href="install.html" />
<link rel="prev" title="Semi-Markov Library Manual" href="manual.html" />
</head>
<body>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="install.html" title="Requirements and Installation"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="manual.html" title="Semi-Markov Library Manual"
accesskey="P">previous</a> |</li>
<li><a href="index.html">Semi-Markov 1.0 documentation</a> »</li>
<li><a href="manual.html" accesskey="U">Semi-Markov Library Manual</a> »</li>
</ul>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper">
<h3><a href="index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Introduction</a><ul>
<li><a class="reference internal" href="#organization-of-library">Organization of library</a></li>
<li><a class="reference internal" href="#larger-context">Larger Context</a></li>
<li><a class="reference internal" href="#acknowledgements">Acknowledgements</a></li>
<li><a class="reference internal" href="#availability-and-distribution">Availability and distribution</a></li>
</ul>
</li>
</ul>
<h4>Previous topic</h4>
<p class="topless"><a href="manual.html"
title="previous chapter">Semi-Markov Library Manual</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="install.html"
title="next chapter">Requirements and Installation</a></p>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/intro.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<h3>Quick search</h3>
<form class="search" action="search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<div class="section" id="introduction">
<h1>Introduction<a class="headerlink" href="#introduction" title="Permalink to this headline">¶</a></h1>
<p>The <tt class="docutils literal"><span class="pre">Semi-Markov</span></tt> library is designed to streamline the process of
creating efficient simulations of a large class of systems called
semi-Markov processes <a class="reference internal" href="references.html#howard-1971">[Howard:1971]</a>. Semi-Markov processes naturally
arise in many contexts including epidemiology <a class="reference internal" href="references.html#viet-2004">[Viet:2004]</a>, physiology,
ecology, atmospheric sciences, reliability engineering and risk
management. This broad range of applications suggest the value of
designing a generic library for simulating complex semi-Markov
processes, independent of the particular application area.</p>
<p>The unifying idea on which this library is based is that there
typically are many different pathways for a complex system to evolve
between timesteps. Each pathway can be viewed as an elementary
stochastic process with a user specified time-dependent transition
rates and a rule for modifying the overall internal state of the
system. At each instant of time, these elementary processes
“compete”, figuratively speaking, for the chance to change the state
of the whole system. Each time step in the simulation corresponds to
an event – a “winner” is selected thus changing the internal state of
the system and the sampling from the corresponding statistical
distribution to determine the time increment. This competing process
view provides a framework for users to develop simulations for complex
models in an incremental manner.</p>
<p>It is easy to show that competing processes with exponentially
distributed transition times have time-independent transition rates.
This is the norm in some application areas such as chemical kinetics.
In contrast, it is manifestly inappropriate for many biological
applications such as physiology, ecology and epidemiology. For
example, a classic paper by Stocks <a class="reference internal" href="references.html#stocks-1931">[Stocks:1931]</a> clearly shows that
the latent period for measles (the distribution times between
infection and the appearance of symptoms) does not follow an
exponential distribution. Stocks’ raw data from cases in London circa
1931, along with optimal fits to exponential, gamma, Weibull, and
log-normal distributions computed using the <tt class="docutils literal"><span class="pre">SciPy</span></tt> statistical
library, are shown in <a class="reference internal" href="#latent-period"><em>Figure 1. Distribution of latent periods for measles in London
circa 1931</em></a>. The fit of the data to
the exponential distribution is very poor while the fits to the other
distributions are very good.</p>
<div class="figure align-center" id="latent-period">
<a class="reference internal image-reference" href="_images/Stocks_fitted_data.svg"><img src="_images/Stocks_fitted_data.svg" /></a>
<p class="caption">Figure 1. Distribution of latent periods for measles in London
circa 1931</p>
</div>
<p>This simple example shows that exclusive reliance on exponential
distributions may lead systematic biases in stochastic simulations of
epidemiological process. Therefore, this library provides support for
general semi-Markov models based on competing processes with general
probability distributions of transition times.</p>
<div class="section" id="organization-of-library">
<h2>Organization of library<a class="headerlink" href="#organization-of-library" title="Permalink to this headline">¶</a></h2>
<p>It is implemented using three cooperating layers:</p>
<ul class="simple">
<li><strong>Finite state machine</strong>: High-level interface for initializing the
system, iterating over time steps and gathering relevant tracing
data for post-processing.</li>
<li><strong>Semi-Markov process</strong>: “Middleware” responsible for statistically
unbiased choice among all possible competing processes at a given
time step.</li>
<li><strong>Generalized stochastic Petri net</strong>: Low-level coordination and
bookkeeping related to the user-defined competing processes
including distributions of transition times, modification of system
state and various dependence relationships.</li>
</ul>
<div class="figure align-center">
<img src="_images/large-structureb.svg" width="400px" /></div>
<p>This organization has many practical advantages:</p>
<ul class="simple">
<li>The semi-Markov process layer can be viewed as a very efficient,
general purpose, stochastic simulation engine that supports
arbitrary statistical distributions for event times. This layer
contains no model-specific user code, thus can be independently
verified and validated.</li>
<li>Typically, the itself model is completely defined by instantiating
components of the Petri net. The Petri net layer automates most of
the tedious and error-prone bookkeeping steps associated with the
execution of the model.</li>
<li>The library strictly enforces a separation of the static components
that define the structural aspects of the model and the dynamic
components that define the evolving state during a simulation. This
separation makes it possible to detect many critical programming
errors associated with multithreading at compile time.</li>
</ul>
</div>
<div class="section" id="larger-context">
<h2>Larger Context<a class="headerlink" href="#larger-context" title="Permalink to this headline">¶</a></h2>
<p>Making a dynamical model, such as this library creates, is one
step in achieving larger goals. The goal could be <em>model selection</em>
to ask which conceptual process best describes observed data.
It could be <em>optimization</em> of interventions to hinder or encourage
an outcome. For example, see <a class="reference internal" href="references.html#hartig2011">[Hartig2011]</a> on using dynamical models
for <em>inference.</em> These larger goals guide construction of a
conceptual model for the problem, one that includes those behaviors
that seem most relevant.</p>
<p>The steps from conception to having a running program which uses
the Semi-Markov library are:</p>
<div class="figure align-center">
<img src="_images/multi-large.svg" width="800px" /></div>
<ol class="arabic simple">
<li>A conceptual model for the system. What actors and resources are
in the domain? What behaviors are important? A paper by
<a class="reference internal" href="references.html#grimm2010">[Grimm2010]</a> and others goes into more detail for the ecology realm.</li>
<li>A survival analysis of that conceptual model. There are books and
statistics courses on survival analysis. Field observations are
processed with statistical estimators to produce estimated
hazards for transition.</li>
<li>Now write C++ code, using the Semi-Markov library API, to
record the states of the system and hazards for transition
among those states. The data structure holding this information
is called the GSPN.</li>
<li>When the library compiles, it generates, from the GSPN provided,
an event loop to yield the next state change in the system and
the time at which that change occurs.</li>
<li>Most often dynamical models build with this library will be
part of the inner loop of a larger mission, for instance
a Bayesian MCMC or an optimization. In the least, an ensemble of
trajectories generated by a dynamical model will be summarized
with statistical estimators at the finish.</li>
</ol>
</div>
<div class="section" id="acknowledgements">
<h2>Acknowledgements<a class="headerlink" href="#acknowledgements" title="Permalink to this headline">¶</a></h2>
<p>This library was created by the Analytical Framework for Infectious
Disease Dynamics (AFIDD) group at Cornell University in conjunction
with the USDA Agricultural Research Service. This work was supported by the Science & Technology Directorate, Department of Homeland Security via interagency agreement no. HSHQDC-10-X-00138.</p>
</div>
<div class="section" id="availability-and-distribution">
<h2>Availability and distribution<a class="headerlink" href="#availability-and-distribution" title="Permalink to this headline">¶</a></h2>
<p>This library is in the public domain.</p>
</div>
</div>
</div>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="install.html" title="Requirements and Installation"
>next</a> |</li>
<li class="right" >
<a href="manual.html" title="Semi-Markov Library Manual"
>previous</a> |</li>
<li><a href="index.html">Semi-Markov 1.0 documentation</a> »</li>
<li><a href="manual.html" >Semi-Markov Library Manual</a> »</li>
</ul>
</div>
<div class="footer">
© Copyright 2014, Andrew Dolgert, David Schneider.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
</div>
</body>
</html>