« blib/lib/App/RecordStream/Aggregator/Correlation.pm
↑ Summary
blib/lib/App/RecordStream/Aggregator/LinearRegression.pm »
| 1 | package App::RecordStream::Aggregator::Covariance; | ||
| 2 | |||
| 3 | 7 | our $VERSION = "4.0.23"; | |
| 4 | |||
| 5 | 7 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | 7 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | |||
| 8 | 7 | ▶ | use App::RecordStream::Aggregator::Ord2Bivariate; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 9 | 7 | ▶ | use App::RecordStream::Aggregator; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 10 | 7 | ▶ | use App::RecordStream::DomainLanguage::Registry; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 11 | |||
| 12 | 7 | ▶ | use base 'App::RecordStream::Aggregator::Ord2Bivariate'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 13 | |||
| 14 | #sub new -- passed through | ||
| 15 | |||
| 16 | #sub new_from_valuation -- passed through | ||
| 17 | |||
| 18 | sub squish | ||
| 19 | { | ||
| 20 | 10 | ▶ | my ($this, $cookie) = @_; |
|
Subroutine
squish: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 21 | |||
| 22 | 10 | my ($sum1, $sumx, $sumy, $sumxy, $sumx2, $sumy2) = @$cookie; | |
| 23 | |||
| 24 | 10 | return ($sumxy / $sum1) - ($sumx / $sum1) * ($sumy / $sum1); | |
| 25 | } | ||
| 26 | |||
| 27 | sub long_usage | ||
| 28 | { | ||
| 29 | 0 | ▶ | return <<EOF; |
|
Subroutine
long_usage: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 30 | Usage: cov,<field1>,<field2> | ||
| 31 | Covariance of specified fields. | ||
| 32 | EOF | ||
| 33 | } | ||
| 34 | |||
| 35 | sub short_usage | ||
| 36 | { | ||
| 37 | 1 | ▶ | return "find covariance of provided fields"; |
|
Subroutine
short_usage: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 38 | } | ||
| 39 | |||
| 40 | 7 | App::RecordStream::Aggregator->register_implementation('cov', __PACKAGE__); | |
| 41 | 7 | App::RecordStream::Aggregator->register_implementation('covar', __PACKAGE__); | |
| 42 | 7 | App::RecordStream::Aggregator->register_implementation('covariance', __PACKAGE__); | |
| 43 | |||
| 44 | 7 | App::RecordStream::DomainLanguage::Registry::register_vfn(__PACKAGE__, 'new_from_valuation', 'cov', 'VALUATION', 'VALUATION'); | |
| 45 | 7 | App::RecordStream::DomainLanguage::Registry::register_vfn(__PACKAGE__, 'new_from_valuation', 'covar', 'VALUATION', 'VALUATION'); | |
| 46 | 7 | App::RecordStream::DomainLanguage::Registry::register_vfn(__PACKAGE__, 'new_from_valuation', 'covariance', 'VALUATION', 'VALUATION'); | |
| 47 | |||
| 48 | 7 | 1; | |