reservoirpy.datasets.mackey_glass#
- reservoirpy.datasets.mackey_glass(n_timesteps, tau=17, a=0.2, b=0.1, n=10, x0=1.2, h=1.0, seed=None, **kwargs)[source]#
Mackey-Glass timeseries [8] [9], computed from the Mackey-Glass delayed differential equation.
\[\frac{x}{t} = \frac{ax(t-\tau)}{1+x(t-\tau)^n} - bx(t)\]- Parameters:
n_timesteps (int) – Number of timesteps to compute.
tau (int, default to 17) – Time delay \(\tau\) of Mackey-Glass equation. By defaults, equals to 17. Other values can change the chaotic behaviour of the timeseries.
a (float, default to 0.2) – \(a\) parameter of the equation.
b (float, default to 0.1) – \(b\) parameter of the equation.
n (int, default to 10) – \(n\) parameter of the equation.
x0 (float, optional, default to 1.2) – Initial condition of the timeseries.
h (float, default to 1.0) – Time delta between two discrete timesteps.
seed (int or
numpy.random.Generator
, optional) – Random state seed for reproducibility.
- Returns:
Mackey-Glass timeseries.
- Return type:
array of shape (n_timesteps, 1)
Note
As Mackey-Glass is defined by delayed time differential equations, the first timesteps of the timeseries can’t be initialized at 0 (otherwise, the first steps of computation involving these not-computed-yet-timesteps would yield inconsistent results). A random number generator is therefore used to produce random initial timesteps based on the value of the initial condition passed as parameter. A default seed is hard-coded to ensure reproducibility in any case. It can be changed with the
set_seed()
function.References