Skip to content

Instantly share code, notes, and snippets.

View AlexanderNenninger's full-sized avatar
🏠
Working from home

Alexander Nenninger AlexanderNenninger

🏠
Working from home
View GitHub Profile
@AlexanderNenninger
AlexanderNenninger / ThresholdingAlgo2.py
Created June 21, 2022 07:15 — forked from dlegor/ThresholdingAlgo2.py
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)