reservoirpy.datasets.mackey_glass#
- reservoirpy.datasets.mackey_glass(
- n_timesteps: int,
- tau: int = 17,
- a: float = 0.2,
- b: float = 0.1,
- n: int = 10,
- x0: float = 1.2,
- h: float = 1.0,
- seed: None | int | Generator = None,
- history: None | ndarray = None,
- **kwargs,
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.history (array of shape (T, ), optional) – Past timesteps used to “warmup” the process. T must be greater than tau//h. If None, a random history is generated.
- Return type:
Examples
>>> from reservoirpy.datasets import mackey_glass >>> timeseries = mackey_glass(1000) >>> timeseries.shape (1000, 1)
- Returns:
Mackey-Glass timeseries.
- Return type:
array of shape (n_timesteps, 1)
- Parameters:
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