Skip to content

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

@GrantBruner

Description

@GrantBruner

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")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions