toAggregated

fathon.fathonUtils.toAggregated(vec)

Subtracts mean of a vector and computes the cumulative sum.

Parameters:vec (iterable) – The vector to be integrated.
Returns:Cumulative sum of vec after subtraction of its mean.
Return type:numpy ndarray

Usage examples

import numpy as np
from fathon import fathonUtils as fu

#time series
a = np.random.randn(10000)

#zero-mean cumulative sum
a = fu.toAggregated(a)