| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package App::RecordStream::Aggregator::StandardDeviation; |
|
2
|
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
our $VERSION = "4.0.24"; |
|
4
|
|
|
|
|
|
|
|
|
5
|
6
|
|
|
6
|
|
58933
|
use strict; |
|
|
6
|
|
|
|
|
15
|
|
|
|
6
|
|
|
|
|
178
|
|
|
6
|
6
|
|
|
6
|
|
36
|
use warnings; |
|
|
6
|
|
|
|
|
15
|
|
|
|
6
|
|
|
|
|
166
|
|
|
7
|
|
|
|
|
|
|
|
|
8
|
6
|
|
|
6
|
|
282
|
use App::RecordStream::Aggregator::Ord2Univariate; |
|
|
6
|
|
|
|
|
14
|
|
|
|
6
|
|
|
|
|
145
|
|
|
9
|
6
|
|
|
6
|
|
33
|
use App::RecordStream::Aggregator; |
|
|
6
|
|
|
|
|
18
|
|
|
|
6
|
|
|
|
|
131
|
|
|
10
|
6
|
|
|
6
|
|
294
|
use App::RecordStream::DomainLanguage::Registry; |
|
|
6
|
|
|
|
|
15
|
|
|
|
6
|
|
|
|
|
154
|
|
|
11
|
|
|
|
|
|
|
|
|
12
|
6
|
|
|
6
|
|
31
|
use base 'App::RecordStream::Aggregator::Ord2Univariate'; |
|
|
6
|
|
|
|
|
15
|
|
|
|
6
|
|
|
|
|
1064
|
|
|
13
|
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
#sub new -- passed through |
|
15
|
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
#sub new_from_valuation -- passed through |
|
17
|
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub squish |
|
19
|
|
|
|
|
|
|
{ |
|
20
|
1
|
|
|
1
|
0
|
11
|
my ($this, $cookie) = @_; |
|
21
|
|
|
|
|
|
|
|
|
22
|
1
|
|
|
|
|
5
|
my ($sum1, $sumx, $sumx2) = @$cookie; |
|
23
|
|
|
|
|
|
|
|
|
24
|
1
|
|
|
|
|
10
|
return sqrt(($sumx2 / $sum1) - ($sumx / $sum1) ** 2); |
|
25
|
|
|
|
|
|
|
} |
|
26
|
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub long_usage |
|
28
|
|
|
|
|
|
|
{ |
|
29
|
0
|
|
|
0
|
0
|
|
return <
|
|
30
|
|
|
|
|
|
|
Usage: stddev, |
|
31
|
|
|
|
|
|
|
Standard deviation of specified fields. |
|
32
|
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
This is computed as StdDev(X) = sqrt(E[(X - E[X])^2]). Standard deviation |
|
34
|
|
|
|
|
|
|
is an indication of deviation from average value. |
|
35
|
|
|
|
|
|
|
EOF |
|
36
|
|
|
|
|
|
|
} |
|
37
|
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub short_usage |
|
39
|
|
|
|
|
|
|
{ |
|
40
|
0
|
|
|
0
|
0
|
|
return "find standard deviation of provided field"; |
|
41
|
|
|
|
|
|
|
} |
|
42
|
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
App::RecordStream::Aggregator->register_implementation('stddev', __PACKAGE__); |
|
44
|
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
App::RecordStream::DomainLanguage::Registry::register_vfn(__PACKAGE__, 'new_from_valuation', 'stddev', 'VALUATION'); |
|
46
|
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
1; |