Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getWeights_FFD is incomplete! #28

Open
mdalvi opened this issue Mar 29, 2019 · 1 comment
Open

getWeights_FFD is incomplete! #28

mdalvi opened this issue Mar 29, 2019 · 1 comment

Comments

@mdalvi
Copy link

mdalvi commented Mar 29, 2019

As defined in the book the FFD approach of getWeights which is Xt =Σl∗k=0 𝜔̃ kXt−k,

uses k which is k = 0,…, T − 1.

Thus a limit/size parameter is requried for getWeights_FFD in notebook 05. Fractionally Differentiated Features!

A complete implementation can be found at

https://github.com/philipperemy/fractional-differentiation-time-series/blob/master/fracdiff/fracdiff.py

viz.

def get_weight_ffd(d, thres, lim):
    w, k = [1.], 1
    ctr = 0
    while True:
        w_ = -w[-1] / k * (d - k + 1)
        if abs(w_) < thres:
            break
        w.append(w_)
        k += 1
        ctr += 1
        if ctr == lim - 1:
            break
    w = np.array(w[::-1]).reshape(-1, 1)
    return w
@rspadim
Copy link

rspadim commented Mar 29, 2019

It’s like a fir filter
Implement the kernel and run, nothing more nothing less

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants