How to calculate Centered Moving Average of a set of data in Hadoop Map-Reduce?

Posted by 100gods on Stack Overflow See other posts from Stack Overflow or by 100gods
Published on 2012-09-17T07:50:17Z Indexed on 2012/09/17 9:37 UTC
Read the original article Hit count: 199

Filed under:
|
|

I want to calculate Centered Moving average of a set of Data .

Example Input format :

quarter | sales      
Q1'11   | 9            
Q2'11   | 8
Q3'11   | 9
Q4'11   | 12
Q1'12   | 9
Q2'12   | 12
Q3'12   | 9
Q4'12   | 10

Mathematical Representation of data and calculation of Moving average and then centered moving average

Period   Value   MA  Centered
1          9
1.5
2          8
2.5              9.5
3          9            9.5
3.5              9.5
4          12           10.0
4.5              10.5
5          9            10.750
5.5              11.0
6          12
6.5
7          9  

I am stuck with the implementation of RecordReader which will provide mapper sales value of a year i.e. of four quarter. The RecordReader Problem Question Thread Thanks

© Stack Overflow or respective owner

Related posts about java

Related posts about hadoop