Adv_Fin_ML_Exercises
Adv_Fin_ML_Exercises copied to clipboard
FracDiff for -d values
While trying to apply the Franctionally differentiated logic to a time series i found that a negative value for d make the W series tend to infinity and the difference between weight very small. I belive that the idea of applying a negative value of d to the already FD series is to recover the original values. This can be achieve fixing the length of the W list. Im using the following setup:
def getWeights_FFD(d):
# thres>0 drops insignificant weights
w=[1.]
for k in range(1,50):
w_=-w[-1]/k*(d-k+1)
w.append(w_)
w=np.array(w[::-1]).reshape(-1,1)
return w
Any comments on this approach?
this step create a fir filter, maybe it can recover the signal, but like any derivative to integral you lost part of "constant" value, i don't know if it will work, noramlly integral uses iir filters