Eckmann Lyapunov Exponent

The Eckmann Lyapunov Exponent, from the method of Eckmann, Kamphorst, Ruelle and Ciliberto (1986), estimates the whole spectrum of exponents rather than only the largest: it approximates the dynamics around every point with a linear map and measures how the product of these maps along the path stretches space in every direction.

The formula for the Eckmann Lyapunov Exponent starts from the spacing m of the returns within a vector, set by the embedding dimension E and the number of exponents d:

\[m = \frac{E - 1}{d - 1}\]

Every vector \(X_{i}\) holds the d log returns \(x_{i}\), \(x_{i + m}\), … spaced m periods apart. A linear map \(T_{i}\) that takes \(X_{i}\) to \(X_{i + m}\) is fitted by least squares on the nearest neighbours of \(X_{i}\) by the Chebyshev distance (the largest difference of any coordinate). The maps are multiplied along the path with a QR decomposition into an orthogonal matrix \(Q_{i}\) and an upper triangular matrix \(R_{i}\), starting from the Q of the step before:

\[T_{i} \cdot Q_{i-m} = Q_{i} \cdot R_{i}\]

The diagonal of \(R_{i}\) holds the stretching in each direction, so the k-th exponent \(\lambda_{k}\) is the average log of the k-th diagonal element \(R_{i , kk}\) along the path, per period:

\[\lambda_{k} = \frac{\operatorname{mean}\left(\ln\left(\left\lvert R_{i,\text{kk}}\right\rvert\right)\right)}{m}\]

The exponents run from the largest to the smallest: a positive first exponent points to chaos, as for the Rosenstein Lyapunov Exponent, and the number of positive exponents to the number of directions in which the dynamics stretch.

The Lyapunov exponent measures how fast two nearly identical states of a dynamic system move apart: the average rate, per period, at which a small difference grows (a positive exponent) or dies out (a negative one). It is the defining measure of chaos, a sensitive dependence on the starting point that makes even a deterministic process unpredictable beyond a few periods. A price series shows only one variable of whatever system drives it, so the methods first rebuild the dynamics from a delay embedding: vectors of returns spaced a fixed number of periods apart, which by Takens’ theorem trace out a path with the same exponents as the underlying system.

A positive largest exponent points to chaos, a value around 0 or below to a regular process. For noise, such as daily returns, the estimate is not 0 but depends on the embedding, so the exponent is mostly of use to compare assets or periods with each other rather than as a test for chaos.

Also known as: Lyapunov spectrum, Lyapunov exponents, Eckmann-Ruelle method.

In the Finance Toolkit this is get_lyapunov_exponent with method="eckmann", the same function as Lyapunov Exponent.

Example · EURUSD, GCUSD, BTCUSD · 2021 to 2025

Install the Finance Toolkit with pip install financetoolkit -U, then call get_lyapunov_exponent:

from financetoolkit import Toolkit

toolkit = Toolkit(
    ["EURUSD", "GCUSD", "BTCUSD"],
    api_key="FINANCIAL_MODELING_PREP_KEY",
    start_date="2021-01-01",
    end_date="2025-12-31",
)

toolkit.risk.get_lyapunov_exponent(method="eckmann")

Which returns:

References

  • Paper Eckmann, J.-P., Kamphorst, S.O., Ruelle, D. & Ciliberto, S. (1986). “Liapunov exponents from time series.” Physical Review A, 34(6), 4971-4979.
  • Paper Takens, F. (1981). “Detecting Strange Attractors in Turbulence.” Lecture Notes in Mathematics, 898, 366-381.
  • Library Referenced against nolds’ lyap_e (Eckmann Lyapunov Exponent)
Share