ddmra.utils.moving_average
- moving_average(values, window)[source]
Calculate running average along values array.
- Parameters:
values ((N,) numpy.ndarray) – Values over which to compute average.
window (int) – Sliding window size over which to average values.
- Returns:
sma ((N,) numpy.ndarray) – Each value in sma is the average of the window values in values surrounding that position. So sma[1000] (with a window of 500) will be the mean of values[750:1250]. Positions at the beginning and end will be NaNs.