# 🗺️

## Scripts for Dynamical Systems Analysis

📥 Matlab Scripts    📥 R Scripts  (powered by S. Thao) 📥  Python Scripts  (powered by Y. Robin)

### Description

Attractors are geometrical sets that host all the trajectories of a system. To characterize an attractor, one needs to know how often the state ζ occurs over a certain time interval and how long the dynamics “sticks” to ζ before leaving its neighbourhood. If one is able to specify such properties for all the points of the attractor, then the behaviour of the system is entirely known. The purpose of our methodology it is to use a long trajectory x(t) of system states to reconstruct the salient properties of the attractor. The method is based on the link between extreme value theory (where the extremes are the recurrences of the points ζ with respect to all the possible states of the system) and the Poincaré theorem of recurrence.

The idea is that each state of the system x(t) approximates a point ζ on the attractor and its neighbours are all the states whose distance with respect to x(t) is small. So at each time t and for each state x observed we can define istantaneous properties: the instantaneous dimension d and the inverse of the persistence θ. The only requirement for the application of the theory is that x(t) is sampled from an underlying ergodic system.  For the theoretical details, demonstrations and examples on dynamical systems see ref. 4. The above properties are instantaneous because they change at each instant t, but they are also local, because states observed at different times but close in the phase space will have similar instantaneous properties.

We refer to instantaneous dimension rather than to local dimension to avoid ambiguity with the notion of local to indicate a geographic region. This package contains code to estimate the local dimension, persistence and co-recurrence of dynamical systems from time series. It contains two main scripts and three auxiliary functions.

### Main functions

-Main_Univariate_Analysis_Example.m: It includes the computation of the local dimension and persistence for the Lorenz 1963 attractor in the univariate case.

-Main_Bivariate_Analysis_Example.m: It includes the computation of the local dimension, the persistence and the co-recurrence coefficient for two random fields in the bivariate case.

### Auxiliary functions

-fun_dynsys_univariate_analysis.m: Computation of local dimensions and persistence for each point along a trajectory x, for a given quantile.

-fun_dynsys_bivariate_analysis.m: Computation of local dimensions, persistence, co-dimensions, co-persistence, co-recurrences for each point along a trajectory x, for a given quantile.

-fun_extremal_index_sueveges: This function computes the extremal index for a time series.