JuliaDynamics/DelayEmbeddings.jl

Improve the estimation of first minimum

Datseris opened this issue · 0 comments

In the function estimate_delay we currently estimate the first minimum (of either autocor or mutualinformation) using the direct result and a distance of a single index (i.e. when we find a value so that x[i-1] > x[i] < x[i+1] then the index i is the index of the first minimum):

function mincrossing(c, τs)
i = 1
while c[i+1] < c[i]
i+= 1
if i == length(c)-1
@warn "Did not encounter a minimum, returning last `τ`."
return τs[end]
end
end
return τs[i]
end

This is not optimal for data that contain even the slightest bit of noise, and the computation of the mutual information is not perfectly smooth. It is better to first smoothen the autocorrelation or mutual information, by e.g. convolving with a Gaussian kernel. From an API perspective this is simple: add a keyword smoothen = .... If it is nothing, then no smoothing is done, (current behavior) otherwise it does gaussian convolution.


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.