Skip to content

Instantly share code, notes, and snippets.

View dlegor's full-sized avatar

Daniel Legorreta dlegor

View GitHub Profile
@dlegor
dlegor / ThresholdingAlgo2.py
Created March 7, 2019 03:13
Python implementation of smoothed z-score algorithm version 2, from http://stackoverflow.com/a/22640362/6029703
from numba.decorators import jit
import numpy as np
#The original version is here: https://gist.github.com/ximeg/587011a65d05f067a29ce9c22894d1d2
#I made small changes and used numba to do it faster.
@jit
def thresholding_algo2(y, lag, threshold, influence):
signals = np.zeros(len(y))
filteredY = np.array(y)