pyhctsa.operations.nonlinearity.lyap_spec

pyhctsa.operations.nonlinearity.lyap_spec(y, tau_method=1, m=3, k_nn=30, max_n=10000, theiler_win=('ac', 1), random_seed=42)

The spectrum of Lyapunov exponents of the delay-embedded trajectory.

Estimates all m exponents (not just the largest, cf. largest_lyap()) with TISEAN’s lyap_spec, an implementation of the method of Sano and Sawada: local affine maps of the embedded trajectory are fitted to the neighbors of each point, and tangent vectors propagated along them with periodic orthonormalization. From the spectrum come the rate of volume contraction (the sum of the exponents) and the Kaplan-Yorke estimate of the attractor’s dimension. The routine is run in process (a port of lyap_spec.c, which reproduces the TISEAN binary, including its random initial vectors).

A little noise (0.001 of the standard deviation) is added to the series first, so that the local fits are well posed for quantized series; random_seed seeds it (the portable generator bf_random(), so the dither is the same as hctsa’s).

Parameters:
y : array-like

Input time series.

tau_method : int or str, optional

The time delay of the embedding: an integer, or a rule understood by pyhctsa.utils.get_tau() ('ac', 'ac1e', 'mi'). Default is 1.

m : int, optional

The embedding dimension, and the number of exponents estimated (at least 3). Default is 3.

k_nn : int, optional

The number of neighbors used for each local fit. Default is 30.

max_n : int or 'full', optional

The maximum number of samples (the series is cropped to its first max_n samples), or 'full'. Default is 10000.

theiler_win=('ac', 1)

The Theiler window (see pyhctsa.utils.theiler_window()): neighbors closer in time than this are not used. Default is ['ac', 1].

random_seed : int or str, optional

Seed of the added noise (see bf_random_seed()). Default is 42.

Returns:

LE1, LE2, LE3 (the three largest exponents, per sample), sumPos and numPos (the sum and number of positive exponents), sumAll (their sum) and KYdim (the Kaplan-Yorke dimension). NaN if the delay or Theiler window cannot be set, the series is too short for the fits (fewer than 10 * k_nn + 2 * theiler_win embedded points), TISEAN finds too few neighbors, or an exponent is not finite.

Return type:

dict