def compute_cusum_ts(self, ts):
mean = np.mean(ts)<EOL>cusums = np.zeros(len(ts))<EOL>cusum[<NUM_LIT:0>] = (ts[<NUM_LIT:0>] - mean)<EOL>for i in np.arange(<NUM_LIT:1>, len(ts)):<EOL><INDENT>cusums[i] = cusums[i - <NUM_LIT:1>] + (ts[i] - mean)<EOL><DEDENT>assert(np.isclose(cumsum[-<NUM_LIT:1>], <NUM_LIT:0.0>))<EOL>return cusums<EOL>
Compute the Cumulative Sum at each point 't' of the time series.