-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy patheof.html
241 lines (227 loc) · 13.2 KB
/
eof.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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>EOF Analysis — PyGeode 1.4.1-rc2 documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css" />
<link rel="stylesheet" type="text/css" href="_static/pygtheme.css" />
<link rel="stylesheet" type="text/css" href="_static/plot_directive.css" />
<link rel="stylesheet" type="text/css" href="_static/sg_gallery.css" />
<link rel="stylesheet" type="text/css" href="_static/sg_gallery-binder.css" />
<link rel="stylesheet" type="text/css" href="_static/sg_gallery-dataframe.css" />
<link rel="stylesheet" type="text/css" href="_static/sg_gallery-rendered-html.css" />
<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
<script src="_static/jquery.js"></script>
<script src="_static/underscore.js"></script>
<script src="_static/doctools.js"></script>
<link rel="shortcut icon" href="_static/pygeode_icon.ico"/>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="View module" href="view.html" />
<link rel="prev" title="Stats module" href="stats.html" />
<link href="http://fonts.googleapis.com/css?family=Ubuntu:300,300italic,regular,italic,500,500italic,bold,bolditalic" rel="stylesheet" type="text/css">
<link href='http://fonts.googleapis.com/css?family=Ubuntu+Mono:400,700' rel='stylesheet' type='text/css'>
</head><body>
<div class="header" role="banner"><img class="logo" src="_static/pygeode_logo.png" width=79px alt="Logo"/>
<h1 class="heading"><a href="index.html">
<span>PyGeode 1.4.1-rc2 documentation</span></a></h1>
<h2 class="heading"><span>EOF Analysis</span></h2>
</div>
<div class="topnav" role="navigation" aria-label="top navigation">
<p>
«  <a href="stats.html">Stats module</a>
  ::  
<a class="uplink" href="reference.html">Reference</a>
  ::  
<a class="uplink" href="tutorial.html">Tutorial</a>
  ::  
<a class="uplink" href="gallery/index.html">Gallery</a>
  ::  
<a href="view.html">View module</a>  »
</p>
</div>
<div class="content">
<div class="section" id="eof-analysis">
<h1>EOF Analysis<a class="headerlink" href="#eof-analysis" title="Permalink to this headline">¶</a></h1>
<dl class="py function">
<dt class="sig sig-object py" id="pygeode.EOF">
<span class="sig-prename descclassname"><span class="pre">pygeode.</span></span><span class="sig-name descname"><span class="pre">EOF</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">x</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">num</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">1</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">iaxis</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">weight</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">out</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pygeode/eof.html#EOF"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pygeode.EOF" title="Permalink to this definition">¶</a></dt>
<dd><p>Computes the leading Empirical Orthogonal Function(s) for the given
variable.</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><dl>
<dt><strong>x</strong><span class="classifier">Var object</span></dt><dd><p>The data of interest</p>
</dd>
<dt><strong>num</strong><span class="classifier">integer, optional</span></dt><dd><p>The number of leading EOFs to calculate. Default is <code class="docutils literal notranslate"><span class="pre">1</span></code>.</p>
</dd>
<dt><strong>iaxis</strong><span class="classifier">Axis object, Axis class, string, or integer, optional</span></dt><dd><p>Which axis/axes to treat as the record axis. Multiple axes can be
passed as a tuple. Default is the <code class="docutils literal notranslate"><span class="pre">Time</span></code> axis of the data
(if found), otherwise the leftmost axis.</p>
</dd>
<dt><strong>weight</strong><span class="classifier">Var object or boolean, optional</span></dt><dd><p>Weights to use use for the orthogonality condition.
If <code class="docutils literal notranslate"><span class="pre">True</span></code>, it uses whatever internal weights the variable posesses.
If <code class="docutils literal notranslate"><span class="pre">False</span></code> or <code class="docutils literal notranslate"><span class="pre">None</span></code>, it doesn’t use any weights.
You can also pass in a Var object with explicit weights.
Default is <code class="docutils literal notranslate"><span class="pre">True</span></code>.</p>
</dd>
<dt><strong>out</strong><span class="classifier">string, optional</span></dt><dd><p>Which outputs to return. This is a comma-separated string,
built from the following keywords:</p>
<blockquote>
<div><table class="docutils align-default">
<colgroup>
<col style="width: 11%" />
<col style="width: 89%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head"><p>keyword</p></th>
<th class="head"><p>meaning</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>EOF</p></td>
<td><p>The EOFs (normalized to unit variance)</p></td>
</tr>
<tr class="row-odd"><td><p>EIG</p></td>
<td><p>Eigenvalues (of the singular value decomposition of
the variable). If you want the eigenvalues of the
covariance matrix, square these, or use EIG2).</p></td>
</tr>
<tr class="row-even"><td><p>EIG2</p></td>
<td><p>Eigenvalues (of the covariance matrix)</p></td>
</tr>
<tr class="row-odd"><td><p>VAR</p></td>
<td><p>Variance (a single scalar value).</p></td>
</tr>
<tr class="row-even"><td><p>FRAC</p></td>
<td><p>Fraction of total variance explained by each EOF.</p></td>
</tr>
<tr class="row-odd"><td><p>PC</p></td>
<td><p>Principal components (timeseries data), normalized
to unit variance.</p></td>
</tr>
</tbody>
</table>
</div></blockquote>
<p>Default is <code class="docutils literal notranslate"><span class="pre">'EOF,EIG,PC'</span></code></p>
</dd>
</dl>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><dl class="simple">
<dt><strong>eof_decomposition</strong><span class="classifier">tuple</span></dt><dd><p>A combination of EOFs, eignenvalues or other computed quantities specified
by <code class="docutils literal notranslate"><span class="pre">out</span></code>.</p>
</dd>
</dl>
</dd>
</dl>
<p class="rubric">Notes</p>
<p>This routine doesn’t do any pre-processing of the data, such as removing
the mean or detrending. If you want to work with anomalies, then you’ll
have to first compute the anomalies!</p>
<p>This routine tries to automatically determine the best way to solve the
EOFs. If you want to use a particular method, you can call the following
functions (with the same parameters):</p>
<blockquote>
<div><table class="docutils align-default">
<colgroup>
<col style="width: 13%" />
<col style="width: 87%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head"><p>function</p></th>
<th class="head"><p>behaviour</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>EOF_iter</p></td>
<td><p>Iterative solver (uses a variant of the power method).</p></td>
</tr>
<tr class="row-odd"><td><p>EOF_cov</p></td>
<td><p>Calculates the full covariance matrix, and then does an
explicit eigendecomposition.</p></td>
</tr>
<tr class="row-even"><td><p>EOF_svd</p></td>
<td><p>Does an explicit singular value decomposition on the data.</p></td>
</tr>
<tr class="row-odd"><td><p>EOF_guess</p></td>
<td><p>Returns an approximation of the EOF decomposition from one
pass through the data. This may be useful if you have a
large dataset, and you just want the qualitative features
of the EOF spatial patterns.</p></td>
</tr>
</tbody>
</table>
</div></blockquote>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="pygeode.SVD">
<span class="sig-prename descclassname"><span class="pre">pygeode.</span></span><span class="sig-name descname"><span class="pre">SVD</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">var1</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">var2</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">num=1</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">subspace=-1</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">iaxis=<class</span> <span class="pre">'pygeode.timeaxis.Time'></span></span></em>, <em class="sig-param"><span class="n"><span class="pre">weight1=True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">weight2=True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">matrix='cov'</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pygeode/svd.html#SVD"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pygeode.SVD" title="Permalink to this definition">¶</a></dt>
<dd><p>Finds coupled EOFs of two fields. Note that the mean/trend/etc. is NOT
removed in this routine.</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><dl>
<dt><strong>var1, var2</strong><span class="classifier"><a class="reference internal" href="var.html#pygeode.Var" title="pygeode.Var"><code class="xref py py-class docutils literal notranslate"><span class="pre">Var</span></code></a></span></dt><dd><p>The variables to analyse.</p>
</dd>
<dt><strong>num</strong><span class="classifier">integer</span></dt><dd><p>The number of EOFs to compute (default is <code class="docutils literal notranslate"><span class="pre">1</span></code>).</p>
</dd>
<dt><strong>weight1, weight2</strong><span class="classifier">optional</span></dt><dd><p>Weights to use for defining orthogonality in the var1, var2 domains,
respectively. Patterns X and Y in the var1 domain are orthogonal if the
sum over X*Y*weights1 is 0. Patterns Z and W in the var2 domain are
orthogonal if the sum over Z*W*weights2 is 0. Default is to use internal
weights defined for var1 accessed by <a class="reference internal" href="varquery.html#pygeode.Var.getweights" title="pygeode.Var.getweights"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Var.getweights()</span></code></a>. If set to
<code class="docutils literal notranslate"><span class="pre">False</span></code> no weighting is used.</p>
</dd>
<dt><strong>matrix</strong><span class="classifier">string, optional [‘cov’]</span></dt><dd><dl class="simple">
<dt>Which matrix we are diagonalizing (default is ‘cov’). </dt><dd><ul class="simple">
<li><p>‘cov’: covariance matrix of var1 & var2</p></li>
<li><p>‘cov’: correlation matrix of var1 & var2</p></li>
</ul>
</dd>
</dl>
</dd>
<dt><strong>iaxis</strong><span class="classifier">Axis identifier</span></dt><dd><p>The principal component / expansion coefficient axis, i.e., the ‘time’
axis. Can be an integer (the axis number, leftmost = 0), the axis name
(string), or a Pygeode axis class. If not specified, will try to use
pygeode.timeaxis.Time, and if that fails, the leftmost axis.</p>
</dd>
</dl>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><dl class="simple">
<dt>(eof1, pc1, eof2, pc2): tuple</dt><dd><ul class="simple">
<li><p>eof1: The coupled eof patterns for var1.</p></li>
<li><p>pc1: The principal component / expansion coefficients for var1.</p></li>
<li><p>eof2: The coupled eof patterns for var2.</p></li>
<li><p>pc2: The principal component / expansion coefficients for var2.</p></li>
</ul>
</dd>
</dl>
</dd>
</dl>
<p class="rubric">Notes</p>
<p>Multiple orders of EOFs are concatenated along an ‘order’ axis.</p>
</dd></dl>
</div>
</div>
<div class="bottomnav" role="navigation" aria-label="bottom navigation">
<p>
«  <a href="stats.html">Stats module</a>
  ::  
<a class="uplink" href="reference.html">Reference</a>
  ::  
<a class="uplink" href="tutorial.html">Tutorial</a>
  ::  
<a class="uplink" href="gallery/index.html">Gallery</a>
  ::  
<a href="view.html">View module</a>  »
</p>
</div>
<div class="footer" role="contentinfo">
© Copyright 2020, Mike Neish, Peter Hitchcock.
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.3.2.
</div>
</body>
</html>