line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package App::RecordStream::Aggregator::Internal::Ord2BivariateMap; |
2
|
|
|
|
|
|
|
|
3
|
5
|
|
|
5
|
|
2556
|
use strict; |
|
5
|
|
|
|
|
18
|
|
|
5
|
|
|
|
|
150
|
|
4
|
5
|
|
|
5
|
|
30
|
use warnings; |
|
5
|
|
|
|
|
12
|
|
|
5
|
|
|
|
|
137
|
|
5
|
|
|
|
|
|
|
|
6
|
5
|
|
|
5
|
|
29
|
use App::RecordStream::Aggregator::Ord2Bivariate; |
|
5
|
|
|
|
|
10
|
|
|
5
|
|
|
|
|
109
|
|
7
|
|
|
|
|
|
|
|
8
|
5
|
|
|
5
|
|
24
|
use base 'App::RecordStream::Aggregator::Ord2Bivariate'; |
|
5
|
|
|
|
|
11
|
|
|
5
|
|
|
|
|
1126
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
#sub new -- passed through |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
#sub new_from_valuation -- passed through |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub squish |
15
|
|
|
|
|
|
|
{ |
16
|
0
|
|
|
0
|
0
|
|
my ($this, $cookie) = @_; |
17
|
|
|
|
|
|
|
|
18
|
0
|
|
|
|
|
|
my ($sum1, $sumx, $sumy, $sumxy, $sumx2, $sumy2) = @$cookie; |
19
|
|
|
|
|
|
|
|
20
|
0
|
|
|
|
|
|
my $corr = ($sumxy * $sum1 - $sumx * $sumy) / sqrt(($sumx2 * $sum1 - $sumx ** 2) * ($sumy2 * $sum1 - $sumy ** 2)); |
21
|
0
|
|
|
|
|
|
my $cov = ($sumxy / $sum1) - ($sumx / $sum1) * ($sumy / $sum1); |
22
|
0
|
|
|
|
|
|
my $varx = ($sumx2 / $sum1) - ($sumx / $sum1) ** 2; |
23
|
0
|
|
|
|
|
|
my $vary = ($sumy2 / $sum1) - ($sumy / $sum1) ** 2; |
24
|
|
|
|
|
|
|
return |
25
|
|
|
|
|
|
|
{ |
26
|
0
|
|
|
|
|
|
'ct' => $sum1, |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
'sumx' => $sumx, |
29
|
|
|
|
|
|
|
'avgx' => $sumx / $sum1, |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
'sumx2' => $sumx2, |
32
|
|
|
|
|
|
|
'avgx2' => $sumx2 / $sum1, |
33
|
|
|
|
|
|
|
'varx' => $varx, |
34
|
|
|
|
|
|
|
'stddevx' => sqrt($varx), |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
'sumy' => $sumy, |
37
|
|
|
|
|
|
|
'avgy' => $sumy / $sum1, |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
'sumy2' => $sumy2, |
40
|
|
|
|
|
|
|
'avgy2' => $sumy2 / $sum1, |
41
|
|
|
|
|
|
|
'vary' => $vary, |
42
|
|
|
|
|
|
|
'stddevy' => sqrt($vary), |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
'sumxy' => $sumxy, |
45
|
|
|
|
|
|
|
'avgxy' => $sumxy / $sum1, |
46
|
|
|
|
|
|
|
'cov' => $cov, |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
'corr' => $corr, |
49
|
|
|
|
|
|
|
}; |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
App::RecordStream::DomainLanguage::Registry::register_vfn(__PACKAGE__, 'new_from_valuation', 'ord2map', 'VALUATION', 'VALUATION'); |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
1; |