Flag points that are unusual relative to the recent past. Implement rolling_anomalies(x, window, threshold=3.0):
t >= window, compute the mean and sample std (ddof=1) of the previous window values x[t-window : t] (not including x[t])t if |x[t] - mean| / std > threshold; if std == 0, flag it when x[t] != mean