-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathREADME.html
527 lines (462 loc) · 18.3 KB
/
README.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
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>Diffusion Maps for Dynamics</title>
<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"/>
<meta name="title" content="Diffusion Maps for Dynamics"/>
<meta name="generator" content="Org-mode"/>
<meta name="generated" content="2013-10-05T10:53-0500"/>
<meta name="author" content="Marko Budisic"/>
<meta name="description" content=""/>
<meta name="keywords" content=""/>
<style type="text/css">
<!--/*--><![CDATA[/*><!--*/
html { font-family: Times, serif; font-size: 12pt; }
.title { text-align: center; }
.todo { color: red; }
.done { color: green; }
.tag { background-color: #add8e6; font-weight:normal }
.target { }
.timestamp { color: #bebebe; }
.timestamp-kwd { color: #5f9ea0; }
.right {margin-left:auto; margin-right:0px; text-align:right;}
.left {margin-left:0px; margin-right:auto; text-align:left;}
.center {margin-left:auto; margin-right:auto; text-align:center;}
p.verse { margin-left: 3% }
pre {
border: 1pt solid #AEBDCC;
background-color: #F3F5F7;
padding: 5pt;
font-family: courier, monospace;
font-size: 90%;
overflow:auto;
}
table { border-collapse: collapse; }
td, th { vertical-align: top; }
th.right { text-align:center; }
th.left { text-align:center; }
th.center { text-align:center; }
td.right { text-align:right; }
td.left { text-align:left; }
td.center { text-align:center; }
dt { font-weight: bold; }
div.figure { padding: 0.5em; }
div.figure p { text-align: center; }
div.inlinetask {
padding:10px;
border:2px solid gray;
margin:10px;
background: #ffffcc;
}
textarea { overflow-x: auto; }
.linenr { font-size:smaller }
.code-highlighted {background-color:#ffff00;}
.org-info-js_info-navigation { border-style:none; }
#org-info-js_console-label { font-size:10px; font-weight:bold;
white-space:nowrap; }
.org-info-js_search-highlight {background-color:#ffff00; color:#000000;
font-weight:bold; }
/*]]>*/-->
</style>
<style>html { font-family: Helvetica, sans-serif; text-align:justify; margin:2% 15% 2% 15%; max-width:800px; color:rgba(50, 50, 50, 1) }</style>
<script type="text/javascript">
/*
@licstart The following is the entire license notice for the
JavaScript code in this tag.
Copyright (C) 2012-2013 Free Software Foundation, Inc.
The JavaScript code in this tag is free software: you can
redistribute it and/or modify it under the terms of the GNU
General Public License (GNU GPL) as published by the Free Software
Foundation, either version 3 of the License, or (at your option)
any later version. The code is distributed WITHOUT ANY WARRANTY;
without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU GPL for more details.
As additional permission under GNU GPL version 3 section 7, you
may distribute non-source (e.g., minimized or compacted) forms of
that code without the copy of the GNU GPL normally required by
section 4, provided you include this license notice and a URL
through which recipients can access the Corresponding Source.
@licend The above is the entire license notice
for the JavaScript code in this tag.
*/
<!--/*--><![CDATA[/*><!--*/
function CodeHighlightOn(elem, id)
{
var target = document.getElementById(id);
if(null != target) {
elem.cacheClassElem = elem.className;
elem.cacheClassTarget = target.className;
target.className = "code-highlighted";
elem.className = "code-highlighted";
}
}
function CodeHighlightOff(elem, id)
{
var target = document.getElementById(id);
if(elem.cacheClassElem)
elem.className = elem.cacheClassElem;
if(elem.cacheClassTarget)
target.className = elem.cacheClassTarget;
}
/*]]>*///-->
</script>
<script type="text/javascript" src="http://orgmode.org/mathjax/MathJax.js">
/**
*
* @source: http://orgmode.org/mathjax/MathJax.js
*
* @licstart The following is the entire license notice for the
* JavaScript code in http://orgmode.org/mathjax/MathJax.js.
*
* Copyright (C) 2012-2013 MathJax
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* @licend The above is the entire license notice
* for the JavaScript code in http://orgmode.org/mathjax/MathJax.js.
*
*/
/*
@licstart The following is the entire license notice for the
JavaScript code below.
Copyright (C) 2012-2013 Free Software Foundation, Inc.
The JavaScript code below is free software: you can
redistribute it and/or modify it under the terms of the GNU
General Public License (GNU GPL) as published by the Free Software
Foundation, either version 3 of the License, or (at your option)
any later version. The code is distributed WITHOUT ANY WARRANTY;
without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU GPL for more details.
As additional permission under GNU GPL version 3 section 7, you
may distribute non-source (e.g., minimized or compacted) forms of
that code without the copy of the GNU GPL normally required by
section 4, provided you include this license notice and a URL
through which recipients can access the Corresponding Source.
@licend The above is the entire license notice
for the JavaScript code below.
*/
<!--/*--><![CDATA[/*><!--*/
MathJax.Hub.Config({
// Only one of the two following lines, depending on user settings
// First allows browser-native MathML display, second forces HTML/CSS
// config: ["MMLorHTML.js"], jax: ["input/TeX"],
jax: ["input/TeX", "output/HTML-CSS"],
extensions: ["tex2jax.js","TeX/AMSmath.js","TeX/AMSsymbols.js",
"TeX/noUndefined.js"],
tex2jax: {
inlineMath: [ ["\\(","\\)"] ],
displayMath: [ ['$$','$$'], ["\\[","\\]"], ["\\begin{displaymath}","\\end{displaymath}"] ],
skipTags: ["script","noscript","style","textarea","pre","code"],
ignoreClass: "tex2jax_ignore",
processEscapes: false,
processEnvironments: true,
preview: "TeX"
},
showProcessingMessages: true,
displayAlign: "center",
displayIndent: "2em",
"HTML-CSS": {
scale: 100,
availableFonts: ["STIX","TeX"],
preferredFont: "TeX",
webFont: "TeX",
imageFont: "TeX",
showMathMenu: true,
},
MMLorHTML: {
prefer: {
MSIE: "MML",
Firefox: "MML",
Opera: "HTML",
other: "HTML"
}
}
});
/*]]>*///-->
</script>
</head>
<body>
<div id="preamble">
</div>
<div id="content">
<h1 class="title">Diffusion Maps for Dynamics</h1>
<p>by Marko Budisic (<a href="mailto:[email protected]">mailto:[email protected]</a>)
</p>
<p>
This is my implementation of Coifman/Lafon algorithm for efficient
embeddings of high-dimensional data sets, specifically geared towards
analysis of dynamical systems. The use can best be seen in two
examples:
</p>
<dl>
<dt><a href="#sec-1-2"><code>exampleTorus</code></a></dt><dd>demonstrate that the algorithm successfully embeds a 2-torus
</dd>
<dt><a href="#sec-1-1"><code>exampleDynamics</code></a></dt><dd>demonstrate how algorithm is used on trajectories of a dynamical system
</dd>
</dl>
<p>
References:
</p><ul>
<li>Coifman, Lafon, 2006: <a href="http://dx.doi.org/10.1016/j.acha.2006.04.006">http://dx.doi.org/10.1016/j.acha.2006.04.006</a>
</li>
<li>Budisic, Mezic, 2012: <a href="http://dx.doi.org/10.1016/j.physd.2012.04.006">http://dx.doi.org/10.1016/j.physd.2012.04.006</a>
</li>
<li>Budisic, 2012 (PhD Thesis): <a href="https://dl.dropbox.com/u/14017882/budisic_2012_dissertation.pdf">https://dl.dropbox.com/u/14017882/budisic_2012_dissertation.pdf</a>
</li>
<li>Lee, 2010, <a href="http://dx.doi.org/10.1198/jasa.2010.tm09754">http://dx.doi.org/10.1198/jasa.2010.tm09754</a>
</li>
</ul>
<p>
A brief overview of functionalities in their calling order is provided
below. Each .m function contains commented code, so refer to source
for details.
</p>
<div id="table-of-contents">
<h2>Table of Contents</h2>
<div id="text-table-of-contents">
<ul>
<li><a href="#sec-1">1 Computation functions</a>
<ul>
<li><a href="#sec-1-1">1.1 <code>exampleDynamics.m</code></a>
<ul>
<li><a href="#sec-1-1-1">1.1.1 <code>computeAverages.m</code></a></li>
<li><a href="#sec-1-1-2">1.1.2 <code>sobolevMatrix.m</code></a></li>
<li><a href="#sec-1-1-3">1.1.3 <code>dist2diff.m</code></a></li>
<li><a href="#sec-1-1-4">1.1.4 <code>nss.m</code></a></li>
</ul>
</li>
<li><a href="#sec-1-2">1.2 <code>exampleTorus.m</code></a></li>
</ul>
</li>
<li><a href="#sec-2">2 Visualization functions</a>
<ul>
<li><a href="#sec-2-1">2.1 <code>viewHarmonic.m</code></a></li>
</ul>
</li>
<li><a href="#sec-3">3 License</a></li>
</ul>
</div>
</div>
<div id="outline-container-1" class="outline-2">
<h2 id="sec-1"><span class="section-number-2">1</span> Computation functions</h2>
<div class="outline-text-2" id="text-1">
</div>
<div id="outline-container-1-1" class="outline-3">
<h3 id="sec-1-1"><a name="exampleDynamics" id="exampleDynamics"></a><span class="section-number-3">1.1</span> <code>exampleDynamics.m</code></h3>
<div class="outline-text-3" id="text-1-1">
<p>A file demonstrating workflow for analyzing dynamical systems. The
dynamics used is a simple planar double-well potential. It should be
easy enough to generalize to a 3d system.
</p>
<p>
The parameters specifying resolution, length of simulated
trajectories, and number of Fourier harmonics are at the beginning of
the file. They are set to low numbers to facilitate verifying that
everything runs smoothly. You can increase them to get a better
resolution, but slower run-time, and see how each of them impacts the
final picture.
</p>
<p>
Note that the exampleDynamics will store computed trajectories, but
not the averages, into <code>exampleDynamicsTrajectories.mat</code>. If you
change <code>Ngrid</code> or <code>Tmax</code>, erase <code>exampleDynamicsTrajectories.mat</code> to
re-compute trajectories.
</p>
<p>
Computation of trajectories and computation of averages can exploit any parallel threads that might be open. Run
</p>
<p>
<code>>> matlabpool open</code>
</p>
<p>
before running the example for a speedup.
</p>
</div>
<div id="outline-container-1-1-1" class="outline-4">
<h4 id="sec-1-1-1"><span class="section-number-4">1.1.1</span> <code>computeAverages.m</code></h4>
<div class="outline-text-4" id="text-1-1-1">
<p>
Computes averages of a Fourier basis along a single state-space
trajectory. As a result of this function, each trajectory is
"described" using a vector of time averages.
</p>
<p>
(The code is written so that Matlab Coder can automatically generate
MEX file from it, speeding up execution. To generate mex files, run
</p>
<p>
<code>>> deploytool -build computeAverages.prj</code>
</p>
<p>
in Matlab. The rest of the
code will automatically use MEX if available.)
</p>
</div>
</div>
<div id="outline-container-1-1-2" class="outline-4">
<h4 id="sec-1-1-2"><a name="sobolevMatrix" id="sobolevMatrix"></a><span class="section-number-4">1.1.2</span> <code>sobolevMatrix.m</code></h4>
<div class="outline-text-4" id="text-1-1-2">
<p>
Computes pairwise-distances between vectors of time averages using a
Sobolev norm. If the state-space is \(D\)-dimensional, the recommended
Sobolev index is \(s = -(D+1)/2\). The space of trajectories (ergodic
quotient for infinite averages) can be thought of as a graph, where
vertices correspond to trajectories, and edges are Sobolev distances
stored in the resulting matrix.
</p>
<p>
(The code is written so that Matlab Coder can automatically generate
MEX file from it, speeding up execution. To generate mex files, run
</p>
<p>
<code>>> deploytool -build computeAverages.prj</code>
</p>
<p>
in Matlab. The rest of the
code will automatically use MEX if available.)
</p>
</div>
</div>
<div id="outline-container-1-1-3" class="outline-4">
<h4 id="sec-1-1-3"><a name="dist2diff" id="dist2diff"></a><span class="section-number-4">1.1.3</span> <code>dist2diff.m</code></h4>
<div class="outline-text-4" id="text-1-1-3">
<p>
Computes diffusion coordinates on a graph based on the
pairwise-distance matrix between vertices, like the one generated by
<a href="#sec-1-1-2"><code>sobolevMatrix</code></a> Typically, only a few diffusion coordinates are
needed, but it's possible to compute as many diffusion coordinates as
there are trajectories (dimension of the distance matrix).
</p>
<p>
The diffusion coordinates algorithm depends on the bandwidth parameter
\(h\), which models the speed at which diffusion proceeds. For data
analysis, this parameter can be determined heuristically using, e.g.,
<a href="#sec-1-1-4"><code>nss</code></a>function, or it can be tuned manually. A value that is out of
acceptable range will result in "important" diffusion eigenvectors,
i.e., those carrying new information, to be relegated to higher
indices. If \(h\) is too small, the ergodic quotient graph will be
artificially disconnected, and as a consequence, first diffusion
coordinates will look like indicator functions supported on the
disconnected components. If \(h\) is too large, the first coordinate
will be monotonic over data, but the next ones will look like higher
harmonics over the same one-dimensional set. In both cases,
higher-index diffusion coordinates would find the "important" geometry
of the data set, but it's not easy to say a priori at which coordinate
this would happen.
</p>
<p>
In any case, the algorithm is tolerant to order-of-magnitude changes
in \(h\), so the choice is not that crucial. The heuristic algorithm
<a href="#sec-1-1-4"><code>nss</code></a> gives a good starting point for any tuning that might be needed.
</p>
</div>
</div>
<div id="outline-container-1-1-4" class="outline-4">
<h4 id="sec-1-1-4"><a name="nss" id="nss"></a><span class="section-number-4">1.1.4</span> <code>nss.m</code></h4>
<div class="outline-text-4" id="text-1-1-4">
<p>
Heuristically calculates a suitable diffusion bandwidth based on input
data. The bandwidth is set to the minimal number \(h\) such that
\(h\)-distance of any vertex contains a selected number of other
vertices. This ensures one-step diffusion-connectedness of the graph,
in coarse terms.
</p>
</div>
</div>
</div>
<div id="outline-container-1-2" class="outline-3">
<h3 id="sec-1-2"><a name="exampleTorus" id="exampleTorus"></a><span class="section-number-3">1.2</span> <code>exampleTorus.m</code></h3>
<div class="outline-text-3" id="text-1-2">
<p>
A sanity-check example. The vertices are described by values of
Fourier-harmonics sampled on a torus. The diffusion coordinates should
correspond to heat-modes on 2-torus, which are again Fourier
harmonics. Therefore, embedding in the first few diffusion modes
should resemble a 3d image of a doughnut.
</p>
<p>
The example calls the same functions as seen before:
</p><ul>
<li><a href="#sec-1-1-2"><code>sobolevMatrix.m</code></a>
</li>
<li><a href="#sec-1-1-3"><code>dist2diff.m</code></a>
</li>
</ul>
</div>
</div>
</div>
<div id="outline-container-2" class="outline-2">
<h2 id="sec-2"><span class="section-number-2">2</span> Visualization functions</h2>
<div class="outline-text-2" id="text-2">
</div>
<div id="outline-container-2-1" class="outline-3">
<h3 id="sec-2-1"><span class="section-number-3">2.1</span> <code>viewHarmonic.m</code></h3>
<div class="outline-text-3" id="text-2-1">
<p>Visualize a Fourier harmonic on a rectangular domain, based on its
wavenumber and domain width/height.
</p>
</div>
</div>
</div>
<div id="outline-container-3" class="outline-2">
<h2 id="sec-3"><span class="section-number-2">3</span> License</h2>
<div class="outline-text-2" id="text-3">
<p>Diffusion Maps for Dynamics
</p>
<p>
written by Marko Budisic, while at UC Santa Barbara, 2013.
current e-mail: [email protected]
</p>
<p>
Copyright (c) 2013, Regents of the University of California All rights
reserved.
</p>
<p>
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
</p>
<p>
Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer. Redistributions
in binary form must reproduce the above copyright notice, this list of
conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution. Neither the name of
the University of California, Santa Barbara nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission. THIS
SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</p>
</div>
</div>
</div>
<div id="postamble">
<p class="date">Date: 2013-10-05T10:53-0500</p>
<p class="author">Author: Marko Budisic</p>
<p class="creator"><a href="http://orgmode.org">Org</a> version 7.9.3f with <a href="http://www.gnu.org/software/emacs/">Emacs</a> version 24</p>
<a href="http://validator.w3.org/check?uri=referer">Validate XHTML 1.0</a>
</div>
</body>
</html>