Math::CMA - Central Moving Average noise removal
use Math::CMA 'central_moving_averages'; my @averaged = central_moving_averages(2, [1, 2, 3, 4, 5]); # returns (2, 2.5, 3, 3.5, 4)
The central_moving_averages function takes a smoothing distance and an array reference and returns a list that averages all values in the input over the distance value, in other words, it returns for each value in the input the arithmetic mean of that value plus $distance many values before and $distance many values after it. A practical application would be smoothing time series data.
central_moving_averages
The function central_moving_averages on request, none by default.
http://en.wikipedia.org/wiki/Moving_average
Copyright (c) 2012 Bjoern Hoehrmann <bjoern@hoehrmann.de>. This module is licensed under the same terms as Perl itself.
To install Math::CMA, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Math::CMA
CPAN shell
perl -MCPAN -e shell install Math::CMA
For more information on module installation, please visit the detailed CPAN module installation guide.