manu-mannattil / nolitsa

A Python module implementing some standard algorithms used in nonlinear time series analysis
BSD 3-Clause "New" or "Revised" License
172 stars 46 forks source link

Implement ILD algorithm with tests #2

Closed mirgee closed 5 years ago

mirgee commented 5 years ago

About ILD

Integral Local Deformation (ILD) is an algorithm for estimation of optimal embedding parameters allowing for simultaneous estimation of both time delay and embedding dimension.

It works by exploiting the fact that the trajectories in deterministic systems do not intersect and the flow directing the trajectories will be smooth (realistically), i.e. locally linear, and so the neighboring trajectories should evolve in approximately the same direction. ILD integrates the evolution of a reference point with the evolution of the centroid of near neighbors, and averages over a number of selected reference points.

The algorithm

The algorithm outputs these local deformations as a function of time delay for each selected embedding dimension, each of the functions computed in a seperate process concurrently. I added some comments to hopefully make it more understandable.

The current implementation is computationally quite expensive. Let me know if you come up with an idea to make it more efficient!

The unit tests

It is not easy to write thorough unit tests for ILD, so I created a few basic ones based on ILDs of a line, random set of points, and a constant time series. I could also write tests to verify that ILD of e.g. the Lorenz or Rossler systems look approximately the way I know it should based on the literature, but a unit test shouldn't rely on the implementation of data.py.

I also implemented a unit test for a utility function returning indeces of neighbors within a radius.

Let me know of any changes I should make before merging. Also, thank you for the very well done library!

References

Buzug, Th, and G. Pfister. "Optimal delay time and embedding dimension for delay-time coordinates by analysis of the global static and local dynamical behavior of strange attractors." Physical review A 45.10 (1992): 7073.

Andreas, Galka. Topics in nonlinear time series analysis, with implications for EEG analysis. Vol. 14. World Scientific, 2000.