package Statistics::DEA; use vars qw($VERSION); $VERSION = '0.04'; use strict; # use warnings; requires 5.6.0 use Carp; =head1 NAME Statistics::DEA - Discontiguous Exponential Averaging =head1 SYNOPSIS use Statistics::DEA; my $dea = Statistics::DEA->new($alpha, $max_gap); while (($data, $time) = some_data_source(...)) { ... $dea->update($data, $time); print $dea->average(), "\n"; print $dea->standard_deviation(), "\n"; print $dea->completeness($time), "\n"; ... } =head1 DESCRIPTION The Statistics::DEA module can be used to compute exponentially decaying averages and standard deviations even when the data has gaps. The algorithm also avoids initial value bias and postgap bias. =head2 new my $dea = Statistics::DEA->new($alpha, $max_gap); Creates a new (potentially discontiguous) exponential average object. The I<$alpha> is the exponential decay of I: from zero (inclusive) to one (exclusive): the lower values cause the effect of data to decay more quickly, the higher values cause the effect of data to decay more slowly . Specifically, weights on older data decay exponentially with a characteristic time of I<-1/log(alpha)> (I being the natural logarithm). The I<$max_gap> is the maximum I