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

diffseries(x,d) incorrectly calculates the fractional derivative for d = 0.5 #2

Open
GrantBruner opened this issue Nov 12, 2020 · 0 comments

Comments

@GrantBruner
Copy link

diffseries(x,d) incorrectly calculates the fractional derivative for d = 0.5 (and probably for all d). This is probably due to the use of circular convolution with FFT. A simple example below shows this problem

Compare to analytical solution

n=20
x=1:n
ts.plot(2*sqrt(x/pi),ylim=c(-10,5)) # analytical solution
lines(fracdiff::diffseries(x,0.5),col="blue") # test fractional derivative #approximation

Using compare to use of filter

k=1:(n-1)
wts = c(1,cumprod ((k-0.5-1)/k))
padx=c(rep(0,n),x)
frac = stats::filter(padx,wts,sides=1);
frac_circ = stats::convolve(x,wts,FALSE,type="circular");

points(frac[-(1:n)])
points(frac_circ,col="blue")

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

1 participant