Professional Documents
Culture Documents
Vmware Capstone Project Algorithms: Karan Toor April 11, 2013
Vmware Capstone Project Algorithms: Karan Toor April 11, 2013
Introduction
T S 1 and T S 2 are arrays containing comparable time-series data. is how much the period will be shifted, is the increment by which the period will be shifted. So essentially this algorithm nds the maximum of the maximum values in the aggregate arrays, T S 1 + T S 2, where T S 2 is shifted by |n | < n N.
Algorithm 1 Period Shift 1: function Shitf(A[], ) Array values range from 0 to A.size() 1 2: avg arithmeticM ean(A) 3: if n 0 then 4: for i = A.size() 1 do 5: A[i] A[i ] 6: end for 7: for i = 0 k 1 do 8: A[i] avg 9: end for 10: else 11: for i = A.size() 1 0 do 12: A[i] A[i + ] 13: end for 14: for i = A.size() A.size() 1 do 15: A[i] avg 16: end for 17: end if 18: return A 19: end function 20: procedure Max-Shitf(T S 1[], T S 2[], , ) 21: T S T S1 + T S2 TS is aggregate array. 22: max maxV alue(T S ) 23: n / 24: for i = n n do 25: if maxV alue(T S 1 + T S 2) > max then 26: T S T S1 + T S2 27: max maxV alue(T S ) 28: end if 29: end for 30: return T S 31: end procedure