JuliaDynamics / ChaosTools.jl

Tools for the exploration of chaos and nonlinear dynamics
https://juliadynamics.github.io/DynamicalSystemsDocs.jl/chaostools/stable/
MIT License
187 stars 35 forks source link

Update the docstring of `lyapunov_from_data` #242

Closed onkyo14taro closed 2 years ago

onkyo14taro commented 2 years ago

Added a statement recommending the addition of random noise when the data is strongly discretized. The description I added is as follows:

If the data values are very strongly discretized (e.g., integers or floating-point numbers with very small bits), the coarse quantization is likely to result in a zero distance between the two different points compared. If there is at least one pair of points with zero distance, the return value of lyapunov_from_data (the estimate of the maximum Lyapunov exponent) will be -Inf. If you want to avoid the artifact due to discretization, you can add noise to your data as follows: data = data .+ 1e-15randn(length(data)).

onkyo14taro commented 2 years ago

This PR is from #241.

Datseris commented 2 years ago

Thanks @onkyo14taro but I now realize that this is an inappropriate place to put this. This is not specific to lyapunov exponents, but in fact it is relevant for any kind of analysis you do after delay embedding. I'd suggest that you instead made a pull request directly in the documentation of DynamicalSystems.jl. I.e., edit this file: https://github.com/JuliaDynamics/DynamicalSystems.jl/blob/master/docs/src/embedding/reconstruction.md after the embed documentation codeblock. You can also make it a nice tip by writing in the style:

!!! tip "Embedding discretized data values"
    Each sentence starts with four spaces.
    Lalala discretized values
onkyo14taro commented 2 years ago

Thank you for your review. I will place it in the location you indicated.