-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathaggregate.html
450 lines (388 loc) · 26.5 KB
/
aggregate.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
<!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>6.14. Aggregate Functions — Presto 0.202 Documentation</title>
<link rel="stylesheet" href="../_static/presto.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
VERSION: '0.202',
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>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="top" title="Presto 0.202 Documentation" href="../index.html" />
<link rel="up" title="6. Functions and Operators" href="../functions.html" />
<link rel="next" title="6.15. Window Functions" href="window.html" />
<link rel="prev" title="6.13. Date and Time Functions and Operators" href="datetime.html" />
</head>
<body role="document">
<div class="header">
<h1 class="heading"><a href="../index.html">
<span>Presto 0.202 Documentation</span></a></h1>
<h2 class="heading"><span>6.14. Aggregate Functions</span></h2>
</div>
<div class="topnav">
<p class="nav">
<span class="left">
« <a href="datetime.html">6.13. Date and Time Functions and Operators</a>
</span>
<span class="right">
<a href="window.html">6.15. Window Functions</a> »
</span>
</p>
</div>
<div class="content">
<div class="section" id="aggregate-functions">
<h1>6.14. Aggregate Functions</h1>
<p>Aggregate functions operate on a set of values to compute a single result.</p>
<p>Except for <a class="reference internal" href="#count" title="count"><code class="xref py py-func docutils literal"><span class="pre">count()</span></code></a>, <a class="reference internal" href="#count_if" title="count_if"><code class="xref py py-func docutils literal"><span class="pre">count_if()</span></code></a>, <a class="reference internal" href="#max_by" title="max_by"><code class="xref py py-func docutils literal"><span class="pre">max_by()</span></code></a>, <a class="reference internal" href="#min_by" title="min_by"><code class="xref py py-func docutils literal"><span class="pre">min_by()</span></code></a> and
<a class="reference internal" href="#approx_distinct" title="approx_distinct"><code class="xref py py-func docutils literal"><span class="pre">approx_distinct()</span></code></a>, all of these aggregate functions ignore null values
and return null for no input rows or when all values are null. For example,
<a class="reference internal" href="#sum" title="sum"><code class="xref py py-func docutils literal"><span class="pre">sum()</span></code></a> returns null rather than zero and <a class="reference internal" href="#avg" title="avg"><code class="xref py py-func docutils literal"><span class="pre">avg()</span></code></a> does not include null
values in the count. The <code class="docutils literal"><span class="pre">coalesce</span></code> function can be used to convert null into
zero.</p>
<p>Some aggregate functions such as <a class="reference internal" href="#array_agg" title="array_agg"><code class="xref py py-func docutils literal"><span class="pre">array_agg()</span></code></a> produce different results
depending on the order of input values. This ordering can be specified by writing
an <a class="reference internal" href="../sql/select.html#order-by-clause"><span class="std std-ref">ORDER BY Clause</span></a> within the aggregate function:</p>
<div class="highlight-sql"><div class="highlight"><pre><span></span><span class="n">array_agg</span><span class="p">(</span><span class="n">x</span> <span class="k">ORDER</span> <span class="k">BY</span> <span class="n">y</span> <span class="k">DESC</span><span class="p">)</span>
<span class="n">array_agg</span><span class="p">(</span><span class="n">x</span> <span class="k">ORDER</span> <span class="k">BY</span> <span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">,</span> <span class="n">z</span><span class="p">)</span>
</pre></div>
</div>
<div class="section" id="general-aggregate-functions">
<h2>General Aggregate Functions</h2>
<dl class="function">
<dt id="arbitrary">
<code class="descname">arbitrary</code><span class="sig-paren">(</span><em>x</em><span class="sig-paren">)</span> → [same as input]</dt>
<dd><p>Returns an arbitrary non-null value of <code class="docutils literal"><span class="pre">x</span></code>, if one exists.</p>
</dd></dl>
<dl class="function">
<dt id="array_agg">
<code class="descname">array_agg</code><span class="sig-paren">(</span><em>x</em><span class="sig-paren">)</span> → array<[same as input]></dt>
<dd><p>Returns an array created from the input <code class="docutils literal"><span class="pre">x</span></code> elements.</p>
</dd></dl>
<dl class="function">
<dt id="avg">
<code class="descname">avg</code><span class="sig-paren">(</span><em>x</em><span class="sig-paren">)</span> → double</dt>
<dd><p>Returns the average (arithmetic mean) of all input values.</p>
</dd></dl>
<dl class="function">
<dt>
<code class="descname">avg</code><span class="sig-paren">(</span><em>time interval type</em><span class="sig-paren">)</span> → time interval type</dt>
<dd><p>Returns the average interval length of all input values.</p>
</dd></dl>
<dl class="function">
<dt id="bool_and">
<code class="descname">bool_and</code><span class="sig-paren">(</span><em>boolean</em><span class="sig-paren">)</span> → boolean</dt>
<dd><p>Returns <code class="docutils literal"><span class="pre">TRUE</span></code> if every input value is <code class="docutils literal"><span class="pre">TRUE</span></code>, otherwise <code class="docutils literal"><span class="pre">FALSE</span></code>.</p>
</dd></dl>
<dl class="function">
<dt id="bool_or">
<code class="descname">bool_or</code><span class="sig-paren">(</span><em>boolean</em><span class="sig-paren">)</span> → boolean</dt>
<dd><p>Returns <code class="docutils literal"><span class="pre">TRUE</span></code> if any input value is <code class="docutils literal"><span class="pre">TRUE</span></code>, otherwise <code class="docutils literal"><span class="pre">FALSE</span></code>.</p>
</dd></dl>
<dl class="function">
<dt id="checksum">
<code class="descname">checksum</code><span class="sig-paren">(</span><em>x</em><span class="sig-paren">)</span> → varbinary</dt>
<dd><p>Returns an order-insensitive checksum of the given values.</p>
</dd></dl>
<dl class="function">
<dt id="count">
<code class="descname">count</code><span class="sig-paren">(</span><em>*</em><span class="sig-paren">)</span> → bigint</dt>
<dd><p>Returns the number of input rows.</p>
</dd></dl>
<dl class="function">
<dt>
<code class="descname">count</code><span class="sig-paren">(</span><em>x</em><span class="sig-paren">)</span> → bigint</dt>
<dd><p>Returns the number of non-null input values.</p>
</dd></dl>
<dl class="function">
<dt id="count_if">
<code class="descname">count_if</code><span class="sig-paren">(</span><em>x</em><span class="sig-paren">)</span> → bigint</dt>
<dd><p>Returns the number of <code class="docutils literal"><span class="pre">TRUE</span></code> input values.
This function is equivalent to <code class="docutils literal"><span class="pre">count(CASE</span> <span class="pre">WHEN</span> <span class="pre">x</span> <span class="pre">THEN</span> <span class="pre">1</span> <span class="pre">END)</span></code>.</p>
</dd></dl>
<dl class="function">
<dt id="every">
<code class="descname">every</code><span class="sig-paren">(</span><em>boolean</em><span class="sig-paren">)</span> → boolean</dt>
<dd><p>This is an alias for <a class="reference internal" href="#bool_and" title="bool_and"><code class="xref py py-func docutils literal"><span class="pre">bool_and()</span></code></a>.</p>
</dd></dl>
<dl class="function">
<dt id="geometric_mean">
<code class="descname">geometric_mean</code><span class="sig-paren">(</span><em>x</em><span class="sig-paren">)</span> → double</dt>
<dd><p>Returns the geometric mean of all input values.</p>
</dd></dl>
<dl class="function">
<dt id="max_by">
<code class="descname">max_by</code><span class="sig-paren">(</span><em>x</em>, <em>y</em><span class="sig-paren">)</span> → [same as x]</dt>
<dd><p>Returns the value of <code class="docutils literal"><span class="pre">x</span></code> associated with the maximum value of <code class="docutils literal"><span class="pre">y</span></code> over all input values.</p>
</dd></dl>
<dl class="function">
<dt>
<code class="descname">max_by</code><span class="sig-paren">(</span><em>x</em>, <em>y</em>, <em>n</em><span class="sig-paren">)</span> → array<[same as x]></dt>
<dd><p>Returns <code class="docutils literal"><span class="pre">n</span></code> values of <code class="docutils literal"><span class="pre">x</span></code> associated with the <code class="docutils literal"><span class="pre">n</span></code> largest of all input values of <code class="docutils literal"><span class="pre">y</span></code>
in descending order of <code class="docutils literal"><span class="pre">y</span></code>.</p>
</dd></dl>
<dl class="function">
<dt id="min_by">
<code class="descname">min_by</code><span class="sig-paren">(</span><em>x</em>, <em>y</em><span class="sig-paren">)</span> → [same as x]</dt>
<dd><p>Returns the value of <code class="docutils literal"><span class="pre">x</span></code> associated with the minimum value of <code class="docutils literal"><span class="pre">y</span></code> over all input values.</p>
</dd></dl>
<dl class="function">
<dt>
<code class="descname">min_by</code><span class="sig-paren">(</span><em>x</em>, <em>y</em>, <em>n</em><span class="sig-paren">)</span> → array<[same as x]></dt>
<dd><p>Returns <code class="docutils literal"><span class="pre">n</span></code> values of <code class="docutils literal"><span class="pre">x</span></code> associated with the <code class="docutils literal"><span class="pre">n</span></code> smallest of all input values of <code class="docutils literal"><span class="pre">y</span></code>
in ascending order of <code class="docutils literal"><span class="pre">y</span></code>.</p>
</dd></dl>
<dl class="function">
<dt id="max">
<code class="descname">max</code><span class="sig-paren">(</span><em>x</em><span class="sig-paren">)</span> → [same as input]</dt>
<dd><p>Returns the maximum value of all input values.</p>
</dd></dl>
<dl class="function">
<dt>
<code class="descname">max</code><span class="sig-paren">(</span><em>x</em>, <em>n</em><span class="sig-paren">)</span> → array<[same as x]></dt>
<dd><p>Returns <code class="docutils literal"><span class="pre">n</span></code> largest values of all input values of <code class="docutils literal"><span class="pre">x</span></code>.</p>
</dd></dl>
<dl class="function">
<dt id="min">
<code class="descname">min</code><span class="sig-paren">(</span><em>x</em><span class="sig-paren">)</span> → [same as input]</dt>
<dd><p>Returns the minimum value of all input values.</p>
</dd></dl>
<dl class="function">
<dt>
<code class="descname">min</code><span class="sig-paren">(</span><em>x</em>, <em>n</em><span class="sig-paren">)</span> → array<[same as x]></dt>
<dd><p>Returns <code class="docutils literal"><span class="pre">n</span></code> smallest values of all input values of <code class="docutils literal"><span class="pre">x</span></code>.</p>
</dd></dl>
<dl class="function">
<dt id="sum">
<code class="descname">sum</code><span class="sig-paren">(</span><em>x</em><span class="sig-paren">)</span> → [same as input]</dt>
<dd><p>Returns the sum of all input values.</p>
</dd></dl>
</div>
<div class="section" id="bitwise-aggregate-functions">
<h2>Bitwise Aggregate Functions</h2>
<dl class="function">
<dt id="bitwise_and_agg">
<code class="descname">bitwise_and_agg</code><span class="sig-paren">(</span><em>x</em><span class="sig-paren">)</span> → bigint</dt>
<dd><p>Returns the bitwise AND of all input values in 2’s complement representation.</p>
</dd></dl>
<dl class="function">
<dt id="bitwise_or_agg">
<code class="descname">bitwise_or_agg</code><span class="sig-paren">(</span><em>x</em><span class="sig-paren">)</span> → bigint</dt>
<dd><p>Returns the bitwise OR of all input values in 2’s complement representation.</p>
</dd></dl>
</div>
<div class="section" id="map-aggregate-functions">
<h2>Map Aggregate Functions</h2>
<dl class="function">
<dt id="histogram">
<code class="descname">histogram</code><span class="sig-paren">(</span><em>x</em><span class="sig-paren">)</span> → map<K,bigint></dt>
<dd><p>Returns a map containing the count of the number of times each input value occurs.</p>
</dd></dl>
<dl class="function">
<dt id="map_agg">
<code class="descname">map_agg</code><span class="sig-paren">(</span><em>key</em>, <em>value</em><span class="sig-paren">)</span> → map<K,V></dt>
<dd><p>Returns a map created from the input <code class="docutils literal"><span class="pre">key</span></code> / <code class="docutils literal"><span class="pre">value</span></code> pairs.</p>
</dd></dl>
<dl class="function">
<dt id="map_union">
<code class="descname">map_union</code><span class="sig-paren">(</span><em>x<K</em>, <em>V></em><span class="sig-paren">)</span> → map<K,V></dt>
<dd><p>Returns the union of all the input maps. If a key is found in multiple
input maps, that key’s value in the resulting map comes from an arbitrary input map.</p>
</dd></dl>
<dl class="function">
<dt id="multimap_agg">
<code class="descname">multimap_agg</code><span class="sig-paren">(</span><em>key</em>, <em>value</em><span class="sig-paren">)</span> → map<K,array<V>></dt>
<dd><p>Returns a multimap created from the input <code class="docutils literal"><span class="pre">key</span></code> / <code class="docutils literal"><span class="pre">value</span></code> pairs.
Each key can be associated with multiple values.</p>
</dd></dl>
</div>
<div class="section" id="approximate-aggregate-functions">
<h2>Approximate Aggregate Functions</h2>
<dl class="function">
<dt id="approx_distinct">
<code class="descname">approx_distinct</code><span class="sig-paren">(</span><em>x</em><span class="sig-paren">)</span> → bigint</dt>
<dd><p>Returns the approximate number of distinct input values.
This function provides an approximation of <code class="docutils literal"><span class="pre">count(DISTINCT</span> <span class="pre">x)</span></code>.
Zero is returned if all input values are null.</p>
<p>This function should produce a standard error of 2.3%, which is the
standard deviation of the (approximately normal) error distribution over
all possible sets. It does not guarantee an upper bound on the error for
any specific input set.</p>
</dd></dl>
<dl class="function">
<dt>
<code class="descname">approx_distinct</code><span class="sig-paren">(</span><em>x</em>, <em>e</em><span class="sig-paren">)</span> → bigint</dt>
<dd><p>Returns the approximate number of distinct input values.
This function provides an approximation of <code class="docutils literal"><span class="pre">count(DISTINCT</span> <span class="pre">x)</span></code>.
Zero is returned if all input values are null.</p>
<p>This function should produce a standard error of no more than <code class="docutils literal"><span class="pre">e</span></code>, which
is the standard deviation of the (approximately normal) error distribution
over all possible sets. It does not guarantee an upper bound on the error
for any specific input set. The current implementation of this function
requires that <code class="docutils literal"><span class="pre">e</span></code> be in the range of <code class="docutils literal"><span class="pre">[0.0040625,</span> <span class="pre">0.26000]</span></code>.</p>
</dd></dl>
<dl class="function">
<dt id="approx_percentile">
<code class="descname">approx_percentile</code><span class="sig-paren">(</span><em>x</em>, <em>percentage</em><span class="sig-paren">)</span> → [same as x]</dt>
<dd><p>Returns the approximate percentile for all input values of <code class="docutils literal"><span class="pre">x</span></code> at the
given <code class="docutils literal"><span class="pre">percentage</span></code>. The value of <code class="docutils literal"><span class="pre">percentage</span></code> must be between zero and
one and must be constant for all input rows.</p>
</dd></dl>
<dl class="function">
<dt>
<code class="descname">approx_percentile</code><span class="sig-paren">(</span><em>x</em>, <em>percentages</em><span class="sig-paren">)</span> → array<[same as x]></dt>
<dd><p>Returns the approximate percentile for all input values of <code class="docutils literal"><span class="pre">x</span></code> at each of
the specified percentages. Each element of the <code class="docutils literal"><span class="pre">percentages</span></code> array must be
between zero and one, and the array must be constant for all input rows.</p>
</dd></dl>
<dl class="function">
<dt>
<code class="descname">approx_percentile</code><span class="sig-paren">(</span><em>x</em>, <em>w</em>, <em>percentage</em><span class="sig-paren">)</span> → [same as x]</dt>
<dd><p>Returns the approximate weighed percentile for all input values of <code class="docutils literal"><span class="pre">x</span></code>
using the per-item weight <code class="docutils literal"><span class="pre">w</span></code> at the percentage <code class="docutils literal"><span class="pre">p</span></code>. The weight must be
an integer value of at least one. It is effectively a replication count for
the value <code class="docutils literal"><span class="pre">x</span></code> in the percentile set. The value of <code class="docutils literal"><span class="pre">p</span></code> must be between
zero and one and must be constant for all input rows.</p>
</dd></dl>
<dl class="function">
<dt>
<code class="descname">approx_percentile</code><span class="sig-paren">(</span><em>x</em>, <em>w</em>, <em>percentage</em>, <em>accuracy</em><span class="sig-paren">)</span> → [same as x]</dt>
<dd><p>Returns the approximate weighed percentile for all input values of <code class="docutils literal"><span class="pre">x</span></code>
using the per-item weight <code class="docutils literal"><span class="pre">w</span></code> at the percentage <code class="docutils literal"><span class="pre">p</span></code>, with a maximum rank
error of <code class="docutils literal"><span class="pre">accuracy</span></code>. The weight must be an integer value of at least one.
It is effectively a replication count for the value <code class="docutils literal"><span class="pre">x</span></code> in the percentile
set. The value of <code class="docutils literal"><span class="pre">p</span></code> must be between zero and one and must be constant
for all input rows. <code class="docutils literal"><span class="pre">accuracy</span></code> must be a value greater than zero and less
than one, and it must be constant for all input rows.</p>
</dd></dl>
<dl class="function">
<dt>
<code class="descname">approx_percentile</code><span class="sig-paren">(</span><em>x</em>, <em>w</em>, <em>percentages</em><span class="sig-paren">)</span> → array<[same as x]></dt>
<dd><p>Returns the approximate weighed percentile for all input values of <code class="docutils literal"><span class="pre">x</span></code>
using the per-item weight <code class="docutils literal"><span class="pre">w</span></code> at each of the given percentages specified
in the array. The weight must be an integer value of at least one. It is
effectively a replication count for the value <code class="docutils literal"><span class="pre">x</span></code> in the percentile set.
Each element of the array must be between zero and one, and the array must
be constant for all input rows.</p>
</dd></dl>
<dl class="function">
<dt id="numeric_histogram">
<code class="descname">numeric_histogram</code><span class="sig-paren">(</span><em>buckets</em>, <em>value</em>, <em>weight</em><span class="sig-paren">)</span> → map<double, double></dt>
<dd><p>Computes an approximate histogram with up to <code class="docutils literal"><span class="pre">buckets</span></code> number of buckets
for all <code class="docutils literal"><span class="pre">value</span></code>s with a per-item weight of <code class="docutils literal"><span class="pre">weight</span></code>. The algorithm
is based loosely on:</p>
<div class="highlight-none"><div class="highlight"><pre><span></span>Yael Ben-Haim and Elad Tom-Tov, "A streaming parallel decision tree algorithm",
J. Machine Learning Research 11 (2010), pp. 849--872.
</pre></div>
</div>
<p><code class="docutils literal"><span class="pre">buckets</span></code> must be a <code class="docutils literal"><span class="pre">bigint</span></code>. <code class="docutils literal"><span class="pre">value</span></code> and <code class="docutils literal"><span class="pre">weight</span></code> must be numeric.</p>
</dd></dl>
<dl class="function">
<dt>
<code class="descname">numeric_histogram</code><span class="sig-paren">(</span><em>buckets</em>, <em>value</em><span class="sig-paren">)</span> → map<double, double></dt>
<dd><p>Computes an approximate histogram with up to <code class="docutils literal"><span class="pre">buckets</span></code> number of buckets
for all <code class="docutils literal"><span class="pre">value</span></code>s. This function is equivalent to the variant of
<a class="reference internal" href="#numeric_histogram" title="numeric_histogram"><code class="xref py py-func docutils literal"><span class="pre">numeric_histogram()</span></code></a> that takes a <code class="docutils literal"><span class="pre">weight</span></code>, with a per-item weight of <code class="docutils literal"><span class="pre">1</span></code>.</p>
</dd></dl>
</div>
<div class="section" id="statistical-aggregate-functions">
<h2>Statistical Aggregate Functions</h2>
<dl class="function">
<dt id="corr">
<code class="descname">corr</code><span class="sig-paren">(</span><em>y</em>, <em>x</em><span class="sig-paren">)</span> → double</dt>
<dd><p>Returns correlation coefficient of input values.</p>
</dd></dl>
<dl class="function">
<dt id="covar_pop">
<code class="descname">covar_pop</code><span class="sig-paren">(</span><em>y</em>, <em>x</em><span class="sig-paren">)</span> → double</dt>
<dd><p>Returns the population covariance of input values.</p>
</dd></dl>
<dl class="function">
<dt id="covar_samp">
<code class="descname">covar_samp</code><span class="sig-paren">(</span><em>y</em>, <em>x</em><span class="sig-paren">)</span> → double</dt>
<dd><p>Returns the sample covariance of input values.</p>
</dd></dl>
<dl class="function">
<dt id="kurtosis">
<code class="descname">kurtosis</code><span class="sig-paren">(</span><em>x</em><span class="sig-paren">)</span> → double</dt>
<dd><p>Returns the excess kurtosis of all input values. Unbiased estimate using
the following expression:</p>
<div class="highlight-none"><div class="highlight"><pre><span></span>kurtosis(x) = n(n+1)/((n-1)(n-2)(n-3))sum[(x_i-mean)^4]/stddev(x)^4-3(n-1)^2/((n-2)(n-3))
</pre></div>
</div>
</dd></dl>
<dl class="function">
<dt id="regr_intercept">
<code class="descname">regr_intercept</code><span class="sig-paren">(</span><em>y</em>, <em>x</em><span class="sig-paren">)</span> → double</dt>
<dd><p>Returns linear regression intercept of input values. <code class="docutils literal"><span class="pre">y</span></code> is the dependent
value. <code class="docutils literal"><span class="pre">x</span></code> is the independent value.</p>
</dd></dl>
<dl class="function">
<dt id="regr_slope">
<code class="descname">regr_slope</code><span class="sig-paren">(</span><em>y</em>, <em>x</em><span class="sig-paren">)</span> → double</dt>
<dd><p>Returns linear regression slope of input values. <code class="docutils literal"><span class="pre">y</span></code> is the dependent
value. <code class="docutils literal"><span class="pre">x</span></code> is the independent value.</p>
</dd></dl>
<dl class="function">
<dt id="skewness">
<code class="descname">skewness</code><span class="sig-paren">(</span><em>x</em><span class="sig-paren">)</span> → double</dt>
<dd><p>Returns the skewness of all input values.</p>
</dd></dl>
<dl class="function">
<dt id="stddev">
<code class="descname">stddev</code><span class="sig-paren">(</span><em>x</em><span class="sig-paren">)</span> → double</dt>
<dd><p>This is an alias for <a class="reference internal" href="#stddev_samp" title="stddev_samp"><code class="xref py py-func docutils literal"><span class="pre">stddev_samp()</span></code></a>.</p>
</dd></dl>
<dl class="function">
<dt id="stddev_pop">
<code class="descname">stddev_pop</code><span class="sig-paren">(</span><em>x</em><span class="sig-paren">)</span> → double</dt>
<dd><p>Returns the population standard deviation of all input values.</p>
</dd></dl>
<dl class="function">
<dt id="stddev_samp">
<code class="descname">stddev_samp</code><span class="sig-paren">(</span><em>x</em><span class="sig-paren">)</span> → double</dt>
<dd><p>Returns the sample standard deviation of all input values.</p>
</dd></dl>
<dl class="function">
<dt id="variance">
<code class="descname">variance</code><span class="sig-paren">(</span><em>x</em><span class="sig-paren">)</span> → double</dt>
<dd><p>This is an alias for <a class="reference internal" href="#var_samp" title="var_samp"><code class="xref py py-func docutils literal"><span class="pre">var_samp()</span></code></a>.</p>
</dd></dl>
<dl class="function">
<dt id="var_pop">
<code class="descname">var_pop</code><span class="sig-paren">(</span><em>x</em><span class="sig-paren">)</span> → double</dt>
<dd><p>Returns the population variance of all input values.</p>
</dd></dl>
<dl class="function">
<dt id="var_samp">
<code class="descname">var_samp</code><span class="sig-paren">(</span><em>x</em><span class="sig-paren">)</span> → double</dt>
<dd><p>Returns the sample variance of all input values.</p>
</dd></dl>
</div>
</div>
</div>
<div class="bottomnav">
<p class="nav">
<span class="left">
« <a href="datetime.html">6.13. Date and Time Functions and Operators</a>
</span>
<span class="right">
<a href="window.html">6.15. Window Functions</a> »
</span>
</p>
</div>
<div class="footer" role="contentinfo">
</div>
</body>
</html>