Manuscript Offprint
arXiv:2610.40984RC Prediction: A Python Package for Parameter-Aware Reservoir Computing
Summary
A nonlinear dynamical system can be characterized by the autonomous evolution of its state in time and its dependence on system parameters. As a parameter varies, the dynamics can change quantitatively and, at bifurcation points, qualitatively. When the governing equations are unknown, a data-driven model should therefore capture both elements from observational data, rather than reproduce the dynamics at a single operating condition only. Parameter-aware reservoir computing (PARC) is a model-free framework for this purpose, where the parameter is supplied to a reservoir computer through an additional input channel. PARC is trained on time series recorded at several parameter values, and the trained reservoir, run in closed loop as an autonomous dynamical system, generates trajectories at parameter values that were never observed. rc_prediction is an open-source Python package that implements this workflow. It provides multi-parameter training of a reservoir, autonomous closed-loop prediction at user-specified parameter values, parameter scans, and a standard echo state network for forecasting at a fixed parameter. Hyperparameter optimization and optional GPU acceleration through PyTorch are also provided. We use three benchmark dynamical systems as examples to demonstrate its usage. As one of the featured applications, here we illustrate the prediction of critical transitions and system collapse: trained only on pre-critical data, the model is queried beyond the training range to predict whether the system collapses, to estimate the critical parameter , and to characterize transient lifetimes.
Reservoir computing (RC) [2–4] is a recurrent neural network paradigm in which only a linear readout layer is trained, while a large, randomly connected, fixed “reservoir” provides rich
- Corresponding author: Ying-Cheng.Lai@asu.edu
nonlinear dynamics [5]. Because training reduces to a linear (ridge) regression problem, RC is computationally cheap relative to fully trained recurrent networks and is well suited to data-driven forecasting of chaotic systems, including spatiotemporally chaotic systems of large effective dimension [6]. Moreover, a trained reservoir computer is itself a dynamical system: when its output is fed back as its next input, it evolves autonomously in closed loop and generates its own future trajectory without further measurements. In light of these features, reservoir computing has been widely utilized and studied in nonlinear dynamics, including prediction [7–35], inference [36–49], control [50], detection [51, 52], and physical implementations [53–67]. In addition, it has been combined with transformers [68], and machine learning of dynamical systems has been studied with meta-learning [69]. Generally, the ability of reservoir computing to learn the dynamics of a system has been deeply investigated, while how the dynamics change with the parameters can be modeled with reservoir computing remains an open question for standard RC.
Kong et al. [70] extended standard RC to a parameter-aware setting by feeding the parameter into the reservoir through an additional input channel and training a single readout on time series from several parameter values, named parameter-aware reservoir computing (PARC). The closed-loop configuration supplies the autonomous evolution, and the parameter channel, which remains open after training, turns the trained machine into a family of dynamical systems indexed by that can be queried at any parameter value. Related studies have used this framework to anticipate crises, system collapse, and transient lifetimes from pre-critical data [70], to reproduce the statistics of transient chaos and intermittency beyond the training regime [71], to anticipate the onset of synchronization in coupled oscillators [72], to construct digital twins that respond to driving signals not encountered during training [73], to reconstruct bifurcation diagrams of chaotic circuits from measured time series [74], and to track time-varying parameters from partial state observation [75]. Follow-up work has also adapted the framework to update the reservoir readout online as new data arrive [76]. PARC therefore addresses the problem of learning the dynamics together with their dependence on the parameter.
We note that several open-source libraries for reservoir computing already exist, such as ReservoirPy [77] and PyRCN [78], which provide flexible, general-purpose tools for building and training echo state networks. A parameter-aware model could in principle be assembled from such components, but these libraries focus on conventional time-series modeling and do not provide a dedicated workflow for training a single model on time series pooled across several parameter values, closed-loop rollout at a prescribed parameter value, and the analyses built on such rollouts. We therefore developed rc_prediction to provide this workflow as a documented, tested, and installable implementation, together with the benchmark systems and analysis tools needed to reproduce and extend the results of Kong et al. [70].
While PARC has been applied to a wide range of dynamical tasks, here we choose one of its featured applications for demonstration, that is, the prediction of critical transitions. Specifically, as a control parameter is varied smoothly past a threshold , the long-term behavior of the system changes abruptly, often from sustained and bounded dynamics to transient chaos followed by escape or collapse. Examples include predator-prey collapse in ecological networks, voltage collapse in power grids, and regime shifts in climate subsystems [79]. Throughout, denotes this true critical point, a property of the system itself, which is generally unknown in practice. Its estimate obtained from the trained reservoir alone is denoted by . For benchmark systems, where is known, the difference between and measures the accuracy of the prediction. For this task, rc_prediction provides dedicated tools: collapse criteria that distinguish physical collapse from numerical divergence of the surrogate, critical-point scans that report their finite horizon and the bracket of the transition, and ensembles over reservoirs with right-censored transient lifetimes.
Method
The PARC method proceeds in two stages. In the training stage, a single reservoir computer is driven by time series recorded at several parameter values, each presented together with its parameter value, and one readout is fit to all of them. The shared reservoir and readout thus represent a family of parameter-dependent dynamical responses; the model is a dynamical surrogate rather than a classifier of outcomes. In the prediction stage, the trained reservoir is closed into an autonomous dynamical system, and the parameter channel is used to query it at a chosen parameter value. Analyses such as collapse detection and critical-point scanning are subsequently applied to the trajectories generated in this way. Figure 1 illustrates the workflow in the collapse-prediction setting featured here: the reservoir is trained at several pre-critical parameter values and then run autonomously at unseen parameter values to detect collapse and estimate the critical point. The bottom plot in the prediction panel of Fig. 1 is a binary scan that records, at each grid value, only whether the closed-loop trajectory collapses within the horizon. It locates a parameter-dependent transition but, unlike a bifurcation diagram, does not resolve the attractor at each parameter value.

Figure 1: Parameter-aware reservoir computing as implemented in rc_prediction, shown for the collapse-prediction setting. (1) Time series are recorded at several pre-critical parameter values . (2) The state (blue) enters the reservoir through , and the scaled parameter (orange) through its own input weights . The reservoir, with state , is fixed and randomly connected; only the linear readout is trained, by a single ridge regression pooled over all training values . For prediction, the output is fed back as the next input, (dashed loop), while the parameter input is held at a test value . (3) Top: the closed-loop trajectory at one is the model's prediction of whether and when the system collapses. Bottom: repeating this over a grid of parameter values gives the estimate , the first collapsing grid value.
Parameter-aware reservoir dynamics
Let denote the observed state of the dynamical system and let denote the scalar bifurcation (control) parameter. Following Kong et al. [70], the parameter enters the reservoir through its own input channel, and the reservoir state evolves under a leaky echo-state update
where is a fixed, sparse, symmetric, randomly generated recurrent weight matrix (nonzero entries uniform in , mean degree ) rescaled to a target spectral radius ; and are fixed dense input weights with entries uniform in , where is the input-scaling factor; the gain and bias scale and shift the parameter so that its input is comparable in magnitude to that of the state; and is the leaking rate. , , and are drawn at random once and never trained.
The readout uses a quadratic feature map that squares every other reservoir unit, a trick introduced by Lu et al. [36] and adopted by Kong et al. [70] that breaks the odd symmetry of tanh and improves the readout's ability to reconstruct even observables:
Because has received the inputs up to and including , the readout is a one-step-ahead prediction. The output weight matrix is the only trained component of the model. It is fit by ridge (Tikhonov-regularized) linear regression with regularization strength so that, during teacher-forced training, .
Training on multiple parameter values
The key idea that allows the model to generalize across is that training data are drawn from several distinct parameter values rather than from a single trajectory. In the general PARC framework, these values sample the parameter region of interest, and the trained model may be queried between them (interpolation) or beyond them (extrapolation). In the collapse-prediction setting considered here, all training values lie in the pre-critical regime, , and the model is queried beyond the largest of them. For each training parameter , a segment of the corresponding time series is teacher-forced through Eq. (1) (i.e., the true is fed back at every step rather than the model's own prediction), and the resulting pairs from all parameter values are pooled into a single ridge regression that fits one shared . The first points of each segment (the washout; by default) are excluded from the regression targets, so that transients caused by the reservoir's zero initial state do not enter the fit. When a training length is set, the points that follow are fitted. Optionally, Gaussian noise of standard deviation is added to the reservoir inputs (but not to the targets) during training; this standard regularization makes the autonomous closed-loop dynamics markedly more stable. The package requires at least three distinct training values (), all of which must be pre-critical, and at least 20 time steps per value. This requirement reflects the collapse-prediction protocol for which the current implementation is designed; it is a property of , not of the PARC methodology in general, which does not restrict the training values to one side of a transition.
Closed-loop prediction and collapse detection
Once trained, the model is queried at a test parameter – which may lie between, below, or above the training values and, in the collapse setting, above – by running the reservoir in closed loop: the model's own one-step prediction is fed back as the next input state,
(3) with held fixed in the parameter input of Eq. (1) at every step. This autonomous rollout is the model's forecast of how the true system would behave at , despite never having observed data at that parameter value. Whether this forecast is faithful is not guaranteed and must be assessed, for instance against ensembles of reservoirs or, in benchmarks, against the true system. For a chaotic system, a rollout can be expected to follow the true trajectory only for a limited time; beyond that, the relevant comparison concerns statistical and qualitative properties, such as whether and when the trajectory leaves the attractor.
Collapse detection is a downstream analysis of these rollouts. Each rollout is run for a finite horizon of steps, and collapse is detected according to a system-specific criterion; the earliest event and its reason are reported:
- Bound: any state component exceeds a user-specified magnitude (used for the Ikeda map, whose post-critical trajectories escape to a distant region).
- Extinction: the density of a designated species falls below a threshold (0.01 by default), used for population and food-web systems.
- Divergence: the surrogate produces non-finite values or its state norm grows beyond ten times its initial scale. This is reported separately because a runaway surrogate is not, by itself, evidence of physical collapse.
Because no post-critical data enter the training, the predicted collapse is to be read as an event: the state that the surrogate reaches after collapse lies outside the support of the training data and is not expected to reproduce the physical post-collapse state [70].
The trained model supports three kinds of prediction. A single closed-loop rollout at one test parameter reports the trajectory and whether, when, and why collapse occurred. A scan runs one rollout per value on a grid of test parameters. Because a finite rollout only establishes whether collapse was observed within steps, and transients become long near , the scan reports its horizon and the bracket between the last bounded and the first collapsing grid value, flags non-monotonic outcomes, and uses the first collapsing value as the estimate of . Finally, an ensemble repeats the prediction over independently initialized reservoirs and reports the fraction that collapse and the distribution of transient lifetimes. Runs that do not collapse within the horizon are treated as right-censored rather than assigned a lifetime, and the mean lifetime is taken over collapsing runs only. Variation across reservoirs measures model uncertainty; it is distinct from variation across initial conditions of the physical system, which the user controls through the warm-up trajectory. By default, a rollout, including each rollout of a scan, is initialized with the last 50 steps of the training series at the largest training value not exceeding , or at the smallest training value if lies below all of them.
Package Structure
rc_prediction is organized around the two factors of the readout equation, , as shown in Fig. 2: data sources and benchmark systems supply , the reservoir components generate the features , and the readout components fit and evaluate . The parameter-aware model reuses the same reservoir and ridge-readout machinery as the standard ESN and adds the parameter channel, multi-parameter training, and closed-loop rollout at a prescribed parameter value; collapse detection, critical-point scans, and ensembles are analysis routines built on top of these rollouts. The package is built with Hatchling, follows a standard source layout, and depends only on NumPy, SciPy, and scikit-learn.

Figure 2: Structure of rc_prediction. The model predicts the next state as a trained linear readout of the reservoir features, ; each factor of this equation corresponds to one part of the package, which supplies the data , fits the readout , or generates the reservoir features . The dashed box labeled “Parameter-aware extensions” collects the components added for the parameter-aware framework on top of a standard echo state network.
Optional GPU acceleration
The recurrent update in Eq. (1) is applied sequentially in time, and its per-step cost is dominated by the dense matrix-vector product (during readout training, the Gram matrix formed from stacked reservoir states), both of which scale with the square of the reservoir size . Both the standard ESN and the parameter-aware model accept an opt-in GPU flag that offloads these operations to a CUDA device through PyTorch instead of NumPy and SciPy on the CPU; both paths use double precision. Requesting the GPU without PyTorch or a CUDA-visible device raises an error immediately rather than silently falling back to the CPU, and with the flag off PyTorch is never imported.
Table 1 reports the wall-clock time of 500 reservoir state updates driven by a fixed input sequence, measured with a benchmark script distributed with the package on an Intel Core i9-13900KS (24 cores, 32 threads; NumPy with OpenBLAS using 24 threads) and an NVIDIA GeForce RTX 4090 (CUDA 12.4, PyTorch 2.6.0). The recurrent matrix (10% density) is stored as a SciPy sparse matrix on the CPU and as a dense matrix on the GPU; in both cases the work per step scales with . Each run time is the median of five repetitions after a warm-up. Weight generation, including the spectral-radius rescaling, is excluded and timed once; GPU timings include the host-device transfers that the package performs at every step, each of which synchronizes the device. Because the recurrence is sequential, the GPU only pays off once the per-step product is large enough to amortize this overhead: in this configuration the GPU was slower for and faster for , by a factor of 4.5 at . These figures depend on the hardware and should not be read as general thresholds.
With identical seeds, CPU and GPU reservoir states driven by the same input agree to within
Table 1: CPU vs. GPU wall-clock time for 500 reservoir state updates driven by a fixed input sequence, at reservoir size . Run times are medians of five repetitions. Setup (a single measurement, excluded from the run times) is the one-time weight generation on the CPU and is dominated at large by the spectral-radius computation. Hardware and software are given in the text.
| Setup (s) | CPU run (s) | GPU run (s) | Speedup | |
|---|---|---|---|---|
| 200 | 0.016 | 0.004 | 0.055 | |
| 500 | 0.084 | 0.008 | 0.051 | |
| 1000 | 0.118 | 0.020 | 0.052 | |
| 2000 | 0.392 | 0.075 | 0.053 | |
| 4000 | 1.791 | 0.287 | 0.116 | |
| 8000 | 33.4 | 1.484 | 0.330 |
over 500 steps (). The fitted readouts agree to about , because the two matrix-inversion routines differ. Autonomous closed-loop rollouts of chaotic systems amplify such differences, as any change in floating-point summation order would, and CPU and GPU trajectories separate beyond after about a dozen steps; only statistical properties, such as collapse probabilities, should be compared between devices.
Installation and Usage
rc_prediction requires Python 3.10 and is published on the Python Package Index (PyPI) and on GitHub under the Apache License 2.0. All results in this paper were produced with version 0.1.3, the first release under this license; earlier releases were distributed under the MIT License. Optional extras install Matplotlib and Jupyter for the examples and tutorial notebook, development tools for testing and packaging, and PyTorch for GPU acceleration. The package follows scikit-learn conventions: a model is constructed with its hyperparameters, fit to training data, and then queried for predictions. Figure 3 summarizes how a user can start from a dataset and choose the appropriate model, collapse criterion, and prediction method, and Table 2 lists the hyperparameters of the parameter-aware model with their default values.
Table 2: Hyperparameters of the parameter-aware model and their default values.
| Symbol | Meaning | Default |
|---|---|---|
| Reservoir size | 500 | |
| Mean degree of the sparse recurrent matrix | 4.0 | |
| Spectral radius of | 0.9 | |
| Input scaling of and | 1.0 | |
| Parameter-channel gain | 0.5 | |
| Parameter-channel bias | 0.0 | |
| Leaking rate | 0.3 | |
| Ridge regularization strength | ||
| Training input-noise standard deviation | 0 | |
| Washout (initial points of each series excluded from the fit) | 10 |
Hyperparameters can also be selected automatically by a random search over user-specified

Figure 3: Decision flow chart for applying rc_prediction. (1) Data: starting from a dataset, a user decides between the standard ESN and the parameter-aware model and checks that enough pre-critical data are available. (2) Training: the user configures collapse detection, hyperparameter tuning, and GPU acceleration, and then fits the model. (3) Prediction: the user selects the prediction that answers the scientific question.
ranges, scored by prediction error on held-out data. Every prediction returns a small result object: a single rollout reports the predicted trajectory, the test parameter, and whether and at which step collapse occurred; a scan reports the parameter grid, the collapse outcome at each grid point, and the estimate ; and an ensemble reports the fraction of realizations that collapsed, their individual transient lifetimes, and their mean.
Benchmark Systems
rc_prediction bundles three benchmark dynamical systems, following the original paper and related literature. Each system can simulate a single trajectory or a complete training set at several parameter values. The Ikeda map and the food chain both change, at a critical parameter value, from sustained bounded dynamics to transient chaos followed by escape or collapse, and they are the systems on which the parameter-aware workflow is evaluated in the worked examples. The Kuramoto-Sivashinsky equation is provided as a simulator of spatiotemporally chaotic training data; no parameter-aware prediction results for it are reported in this paper.
Ikeda map
The Ikeda map originates as a discrete-time model of the transmitted light field in a ring-cavity optical resonator [80] and is a discrete-time complex map with bifurcation parameter :
(4) with default parameters , , , and critical value . The state is represented by the real and imaginary parts of , and the default training values are all pre-critical. Below the chaotic attractor satisfies ; above it, trajectories are transiently chaotic and eventually escape to a distant state with .
Food chain
A three-species Hastings-Powell / McCann-Yodzis food-chain model [81, 82] with resource , consumer , and predator populations,
with , , , , , and , integrated with SciPy's adaptive Runge-Kutta solver and sampled at . The carrying capacity is the bifurcation parameter, with critical value and default training values . Post-critical simulations first settle onto the pre-critical attractor during a warm-up phase before the parameter is changed, following the transient-chaos control methodology of Dhamala and Lai [83].
Kuramoto–Sivashinsky equation
A one-dimensional Kuramoto–Sivashinsky (KS) equation [84, 85] in the form used in the supplementary material of Kong et al. [70],
with on a periodic domain of length discretized by 32 grid points. It is solved with a fourth-order exponential time-differencing Runge-Kutta (ETDRK4) spectral scheme with step , and is the bifurcation parameter with default training values . The KS system provides a spatiotemporally chaotic benchmark beyond the low-dimensional Ikeda map and food chain, and is a standard testbed for reservoir-computing forecasting of high-dimensional chaos [6].
Worked Examples
Example scripts in the repository reproduce every result below with version 0.1.3 (see “Reproducibility” below); Table 3 lists every setting, including seeds, horizons, and initialization. The two parameter-aware examples, the Ikeda map and the food chain, address a particularly demanding task: anticipating a transition that lies beyond the training parameter range, from pre-critical data alone. They therefore test extrapolation in parameter space, and they evaluate the collapse outcome within a finite horizon, the estimated critical point, and transient lifetimes; they do not test the reconstruction of bifurcation diagrams. The Lorenz-63 example uses the standard ESN at a fixed parameter value and serves only as a check of the core reservoir implementation.

Figure 4: Spatiotemporal chaos generated by the Kuramoto–Sivashinsky benchmark at , shown as a space-time heatmap of over the 32-point periodic grid.
Table 3: Settings used in the worked examples. Symbols follow Table 2. The Ikeda hyperparameters are those selected by the blind search (rounded here; exact values are stored with the scripts). For the parameter-aware models, the first points of each series are excluded from the fit and the next points are fitted.
| Ikeda map (blind) | Food chain | Lorenz-63 | |
|---|---|---|---|
| Model | Parameter-aware RC | Parameter-aware RC | Standard ESN |
| Training data | |||
| Training length | 5000 per value | 400 per value | 3999 steps |
| Reservoir size | 500 | 400 | 500 |
| Connectivity | density 0.1 | ||
| Spectral radius | 0.401 | 2.3 | 0.9 |
| Input scaling | 2.17 | 3.6 | 0.5 |
| Parameter channel | 1.81, 0.175 | 0.50, -2.2 | — |
| Leaking rate | 0.770 | 0.30 | 0.3 |
| Ridge | |||
| Training noise | 0.0127 | 0 | — |
| Washout | 10 points | 10 points | 500 steps |
| Collapse criterion | — | ||
| Horizon | 5000 (up to 20000) | 1500; scan 1200 | — |
| Scan grid | [0.98, 1.03], step 0.002 | [0.995, 1.005], 11 points | — |
| Reservoir seeds | 1–24 | 3 | 42 |
| Initialization | last 50 training steps | last 50 training steps | zero state |
| Test data | scan grid | ; scan grid | held-out last 20% |
Table 4: Blind hyperparameter search for the Ikeda example: sampling ranges (600 candidates, search seed 2026) and scoring protocol. Only pre-critical training data are used.
| Hyperparameter | Range |
|---|---|
| Reservoir size | |
| Mean degree | uniform [2, 8] |
| Spectral radius | uniform [0.1, 1.5] |
| Input scaling | uniform [0.3, 3] |
| Parameter gain | uniform [0.2, 3] |
| Parameter bias | uniform [-1.2, 0.5] |
| Leaking rate | uniform [0.3, 1] |
| Ridge | log-uniform |
| Training noise | log-uniform |
| Data split | first 4000 steps of each training series for fitting, remainder held out |
| Score | Wasserstein-1 distance between in a 5000-step rollout and in held-out data; 1 if the rollout crosses the bound; mean over 3 training values and 4 seeds |
| Collapse bound | largest state component in the training data (= 2.89) |
Ikeda map: All choices for this example are made from pre-critical data alone: the collapse bound is 1.5 times the largest state component in the training data (), and the hyperparameters come from a random search over 600 configurations (Table 4). Figure 5 compares the resulting model with the true map. The reservoir in panel (a) stays on the attractor at and collapses at . Across the ensemble, however, the collapse probability rises gradually: up to 29% of the reservoirs already collapse just below , where the true map never does, and 50% is reached only at instead of 1.006. Single-reservoir scans are noisy (median 1.004, interquartile range [0.996, 1.019]; 5 of 24 reservoirs never collapse on the grid), and the finite horizon biases even the true 50% point upward. Transient lifetimes are right only in order of magnitude: 820 and 710 steps at and 1.03, against 1690 and 230 for the true map, with 21–50% of the runs not collapsing within the horizon. The surrogate also often crosses the bound briefly before escaping, unlike the true map. None of the 578 detected collapses was a numerical divergence.
With hyperparameters tuned instead against the true map’s collapse outcomes, information unavailable in practice, the ensemble 50% point moves to . Hyperparameter selection is therefore a dominant source of uncertainty in the predicted critical point.
Food chain: A single reservoir (seed 3), with collapse defined as predator extinction (), stays bounded at . At it predicts extinction after 275 steps, against 337 steps for the true system started from the same state (Fig. 6a). Its scan over with a horizon of 1200 steps is monotonic and brackets the transition between 1.000 and 1.001, just above the true (Fig. 6b). This result has not been repeated over an ensemble of reservoirs.
Lorenz-63: A standard ESN trained on the Lorenz-63 attractor [86] closely tracks the held-out trajectory in one-step-ahead prediction (Fig. 7), validating the core reservoir implementation. This example involves neither the parameter channel nor closed-loop rollout; it is therefore not a test of parameter-aware prediction, and one-step-ahead accuracy alone does not establish the long-term fidelity of the autonomous dynamics.

(a) Closed-loop prediction

(b) Collapse probability

(c) Runs collapsing within 20000 steps

(d) Critical-point estimate vs. horizon
Figure 5: Prediction for the Ikeda map; collapse means . (a) Closed-loop prediction of reservoir seed 4 (blue), whose estimate is closest to the median of 24 reservoirs, and the true map (gray) from the same initial state; the dotted line marks the first threshold crossing. (b) Collapse probability within steps for the true map over 400 initial conditions (black), RC over 24 reservoirs (blue), and the reservoir of (a) over 24 initial conditions (orange). The true curve dips at a periodic window near ; the orange curve dips similarly near 1.022. (c) Mean lifetime of runs collapsing within steps, where at least half collapse (top), and the censored fraction (bottom). (d) Critical-point estimates versus : 50% collapse level of the true map (black) and the RC ensemble (blue, solid), and median (blue, dashed) and interquartile range (shading) of single-reservoir . Dotted lines in (b) and (d) mark .

(a) Predator density

(b) Critical-point scan (horizon 1200)
Figure 6: Food chain. (a) Top: true predator density at the three training values of . Bottom: at for the true system (black) and the RC prediction (blue) from the same initial state, with the extinction threshold (dashed); dotted lines mark where each crosses it. (b) Critical-point scan: the shaded interval is the bracket between the last bounded and the first collapsed value, and the solid line is the true [70].

Figure 7: One-step-ahead prediction of the Lorenz-63 system by a standard ESN with 500 units, on held-out data. The first three panels show the target and the prediction for the standardized variables , , and . The fourth panel shows the error, defined as the target minus the prediction. The test NRMSE (Normalized Root Mean Square Error) is .
Reproducibility
All results were produced with version 0.1.3 by the scripts below, in the repository's examples directory. Each script fixes every random seed.
Scripts.
-
ikeda_blind_tuning.py: the blind hyperparameter search (Table 4); writes the selected configuration and the ten best candidates.
-
ikeda_validation.py: Fig. 5 and all Ikeda numbers in the text, and the raw collapse steps of every run. An option switches from the blind configuration to the one tuned with post-critical information.
-
ikeda_prediction.py, food_chain_prediction.py: the single-model examples.
-
food_chain_figure.py: Fig. 6.
-
lorenz_prediction.py: Fig. 7.
-
gpu_benchmark.py: Table 1 and the CPU/GPU agreement figures.
Initial conditions.
-
Training series: simulated from the seeds in Table 3 after a burn-in of 1000 steps (Ikeda map) or 600 time units (food chain).
-
Ikeda validation, true map: 400 initial conditions drawn uniformly from [0, 1]² (seed 0) and iterated 2000 steps at , so that they lie on the pre-critical attractor.
-
Ikeda validation, RC: rollouts over reservoirs are warmed up with the last 50 training steps at ; rollouts over initial conditions with 24 disjoint 50-step windows, spaced 500 steps apart, of a separate true trajectory at (seed 7).
-
Food chain: the true post-critical trajectory starts from the same state as the RC rollout, the last training state at .
Quality Control
The package ships a suite of 41 unit tests, run with pytest, covering fitting, prediction, collapse classification, critical-point scans with their brackets, and censored ensembles of the parameter-aware model; the simulators and training sets of all three benchmark systems; the standard ESN, reservoir, ridge readout, and error metrics; reproducibility of reservoirs built from the same seed; and the hyperparameter search. Four of the tests concern GPU acceleration. Two check that CPU and GPU results agree and run only on a machine with a CUDA device. The other two check that requesting the GPU without one raises an error and run only on a machine without a CUDA device. On any machine, therefore, 39 tests run and 2 are skipped.
Conclusion
rc_prediction packages the parameter-aware reservoir-computing method of Kong et al. [70] into a documented, tested, and installable Python library. Its core is the PARC workflow: a single reservoir with a parameter channel is trained on time series pooled across several parameter values and then run as an autonomous closed-loop system at prescribed, previously unseen parameter values. The package also includes a general-purpose echo state network, Ikeda-map, food-chain, and Kuramoto-Sivashinsky benchmarks, hyperparameter search, and optional GPU acceleration for large reservoirs. It is available on PyPI and on GitHub at https://github.com/jinchen7-cmd/Reservoir-Computing under the Apache License 2.0.
The scientific application featured in this paper is the prediction of critical transitions and system collapse from pre-critical data. For this task, the package provides the tools needed to check its predictions: collapse classification that separates physical collapse from numerical divergence, critical-point scans that report their horizon and bracket, and ensembles with censored transient lifetimes. In a blind test on the Ikeda map, with hyperparameters and collapse bound chosen from pre-critical data only, the model correctly separates bounded from collapsing regimes near the transition, but the ensemble places it about 0.005 too high in , a substantial fraction of runs does not collapse within the horizon, and transient lifetimes are reproduced only in order of magnitude; tuning with post-critical information narrows the critical-point error but not the lifetime discrepancy. For the food chain, a single reservoir brackets the transition just above the true , a result not yet repeated over an ensemble of reservoirs.
These results also delineate the practical limitations of the approach. Hyperparameter selection is a dominant source of uncertainty, and single reservoirs are considerably less reliable than ensembles, so predictions should be reported with their spread across independently initialized reservoirs. Finite prediction horizons bias critical-point estimates and censor long transients, and the state reached after a predicted collapse is not a prediction of the physical post-collapse state. The present implementation requires pre-critical training data at three or more parameter values, and the examples in this paper address collapse prediction only; other applications of PARC, such as the reconstruction of bifurcation diagrams or the anticipation of synchronization, are established in the cited literature but are neither implemented as dedicated utilities nor demonstrated here. Within these limits, rc_prediction provides a reproducible computational foundation on which such studies of parameter-dependent nonlinear dynamics can be built.
References
[1] Z.-M. Zhai, C. Grebogi, and Y.-C. Lai, Digital twins of discrete and continuous dynamical systems, Discrete Contin. Dyn. Syst. - I: Intell. 1, 10.3934/dcdsi.R260401 (2026).
[2] H. Jaeger, The “echo state” approach to analysing and training recurrent neural networks, GMD Report 148 (German National Research Center for Information Technology, 2001).
[3] W. Maass, T. Natschläger, and H. Markram, Real-time computing without stable states: A new framework for neural computation based on perturbations, Neural Comput. 14, 2531 (2002).
[4] M. Lukoševićus and H. Jaeger, Reservoir computing approaches to recurrent neural network training, Comput. Sci. Rev. 3, 127 (2009).
[5] Y.-C. Lai, Reservoir Computing: Machine Learning Meets Nonlinear Dynamics (World Scientific, Singapore, 2026).
[6] J. Pathak, B. Hunt, M. Girvan, Z. Lu, and E. Ott, Model-free prediction of large spatiotemporally chaotic systems from data: A reservoir computing approach, Phys. Rev. Lett. 120, 024102 (2018).
[7] H. Jaeger and H. Haas, Harnessing nonlinearity: Predicting chaotic systems and saving energy in wireless communication, Science 304, 78 (2004).
[8] D. Sussillo and L. F. Abbott, Generating coherent patterns of activity from chaotic neural networks, Neuron 63, 544 (2009).
[9] J. Pathak, Z. Lu, B. R. Hunt, M. Girvan, and E. Ott, Using machine learning to replicate chaotic attractors and calculate Lyapunov exponents from data, Chaos 27, 121102 (2017).
[10] J. Pathak, A. Wikner, R. Fussell, S. Chandra, B. R. Hunt, M. Girvan, and E. Ott, Hybrid forecasting of chaotic processes: Using machine learning in conjunction with a knowledge-based model, Chaos 28, 041101 (2018).
[11] L. Grigoryeva and J.-P. Ortega, Echo state networks are universal, Neural Netw. 108, 495 (2018).
[12] A. Griffith, A. Pomerance, and D. J. Gauthier, Forecasting chaotic systems with very low connectivity reservoir computers, Chaos 29, 123108 (2019).
[13] T. L. Carroll and L. M. Pecora, Network structure effects in reservoir computers, Chaos 29, 083130 (2019).
[14] A. Haluszczynski and C. Räth, Good and bad predictions: Assessing and improving the replication of chaotic attractors by means of reservoir computing, Chaos 29, 103143 (2019).
[15] T. Lymburn, D. M. Walker, M. Small, and T. Jüngling, The reservoir's perspective on generalized synchronization, Chaos 29, 093133 (2019).
[16] J. Jiang and Y.-C. Lai, Model-free prediction of spatiotemporal dynamical systems with recurrent neural networks: Role of network spectral radius, Phys. Rev. Res. 1, 033056 (2019).
[17] P. R. Vlachas, J. Pathak, B. R. Hunt, T. P. Sapsis, M. Girvan, E. Ott, and P. Koumoutsakos, Backpropagation algorithms and reservoir computing in recurrent neural networks for the forecasting of complex spatiotemporal dynamics, Neural Netw. 126, 191 (2020).
[18] L. Gonon and J.-P. Ortega, Reservoir computing universality with stochastic inputs, IEEE Trans. Neural Netw. Learn. Syst. 31, 100 (2020).
[19] A. Hart, J. Hook, and J. Dawes, Embedding and approximation theorems for echo state networks, Neural Netw. 128, 234 (2020).
[20] P. Chen, R. Liu, K. Aihara, and L. Chen, Autoreservoir computing for multistep ahead prediction based on the spatiotemporal information transformation, Nat. Commun. 11, 4568 (2020).
[21] S. Pandey and J. Schumacher, Reservoir computing model of two-dimensional turbulent convection, Phys. Rev. Fluids 5, 113506 (2020).
[22] A. Chattopadhyay, P. Hassanzadeh, and D. Subramanian, Data-driven predictions of a multi-scale Lorenz 96 chaotic system using machine-learning methods: Reservoir computing, artificial neural network, and long short-term memory network, Nonlinear Process. Geophys. 27, 373 (2020).
[23] H. Fan, J. Jiang, C. Zhang, X. Wang, and Y.-C. Lai, Long-term prediction of chaotic systems with machine learning, Phys. Rev. Res. 2, 012080 (2020).
[24] C. Klos, Y. F. Kalle Kossio, S. Goedeke, A. Gilra, and R.-M. Memmesheimer, Dynamical learning of dynamics, Phys. Rev. Lett. 125, 088103 (2020).
[25] E. Bollt, On explaining the surprising success of reservoir computing forecaster of chaos? The universal machine learning dynamical system with contrast to VAR and DMD, Chaos 31, 013108 (2021).
[26] A. Racca and L. Magri, Robust optimization and validation of echo state networks for learning chaotic dynamics, Neural Netw. 142, 252 (2021).
[27] J. A. Platt, A. Wong, R. Clark, S. G. Penny, and H. D. I. Abarbanel, Robust forecasting using predictive generalized synchronization in reservoir computing, Chaos 31, 123118 (2021).
[28] H. Zhang, H. Fan, L. Wang, and X. Wang, Learning Hamiltonian dynamics with reservoir computing, Phys. Rev. E 104, 024205 (2021).
[29] J. Z. Kim, Z. Lu, E. Nozari, G. J. Pappas, and D. S. Bassett, Teaching recurrent neural networks to infer global temporal structure from local examples, Nat. Mach. Intell. 3, 316 (2021).
[30] D. J. Gauthier, E. Bollt, A. Griffith, and W. A. S. Barbosa, Next generation reservoir computing, Nat. Commun. 12, 5564 (2021).
[31] W. Gilpin, Model scale versus domain knowledge in statistical forecasting of chaotic systems, Phys. Rev. Res. 5, 043252 (2023).
[32] D. Patel and E. Ott, Using machine learning to anticipate tipping points and extrapolate to post-tipping dynamics of non-stationary dynamical systems, Chaos 33, 023143 (2023).
[33] Y. Zhang and S. P. Cornelius, Catch-22s of reservoir computing, Phys. Rev. Res. 5, 033213 (2023).
[34] D. Köglmayr and C. Räth, Extrapolating tipping points and simulating non-stationary dynamics of complex systems using efficient machine learning, Sci. Rep. 14, 507 (2024).
[35] L.-W. Kong, G. A. Brewer, and Y.-C. Lai, Reservoir-computing based associative memory and itinerancy for complex dynamical attractors, Nat. Commun. 15, 4840 (2024).
[36] Z. Lu, J. Pathak, B. Hunt, M. Girvan, R. Brockett, and E. Ott, Reservoir observers: Model-free inference of unmeasured variables in chaotic systems, Chaos 27, 041102 (2017).
[37] K. Nakai and Y. Saiki, Machine-learning inference of fluid variables from data using reservoir computing, Phys. Rev. E 98, 023111 (2018).
[38] R. S. Zimmermann and U. Parlitz, Observing spatio-temporal dynamics of excitable media using reservoir computing, Chaos 28, 043118 (2018).
[39] Q. Zhu, H. Ma, and W. Lin, Detecting unstable periodic orbits based only on time series: When adaptive delayed feedback control meets reservoir computing, Chaos 29, 093125 (2019).
[40] A. Banerjee, J. Pathak, R. Roy, J. G. Restrepo, and E. Ott, Using machine learning to assess short term causal dependence and infer network links, Chaos 29, 121104 (2019).
[41] X. Chen, T. Weng, H. Yang, C. Gu, J. Zhang, and M. Small, Mapping topological characteristics of dynamical systems into neural networks: A reservoir computing approach, Phys. Rev. E 102, 033314 (2020).
[42] Z. Lu and D. S. Bassett, Invertible generalized synchronization: A putative mechanism for implicit learning in neural systems, Chaos 30, 063133 (2020).
[43] Y. Huang, Z. Fu, and C. L. E. Franzke, Detecting causality from time series in a machine learning framework, Chaos 30, 063116 (2020).
[44] G. A. Gottwald and S. Reich, Supervised learning from noisy observations: Combining machine-learning techniques with data assimilation, Physica D 423, 132911 (2021).
[45] A. Röhm, D. J. Gauthier, and I. Fischer, Model-free inference of unseen attractors: Reconstructing phase space features from a single noisy trajectory using reservoir computing, Chaos 31, 103127 (2021).
[46] G. Angelatos, S. A. Khan, and H. E. Türeci, Reservoir computing approach to quantum state measurement, Phys. Rev. X 11, 041062 (2021).
[47] H. Fan, L. Wang, Y. Du, Y. Wang, J. Xiao, and X. Wang, Learning the dynamics of coupled oscillators from transients, Phys. Rev. Res. 4, 013137 (2022).
[48] D. J. Gauthier, I. Fischer, and A. Röhm, Learning unseen coexisting attractors, Chaos 32, 113107 (2022).
[49] X. Li, Q. Zhu, C. Zhao, X. Duan, B. Zhao, X. Zhang, H. Ma, J. Sun, and W. Lin, Higher-order Granger reservoir computing: Simultaneously achieving scalable complex structures inference and accurate dynamics prediction, Nat. Commun. 15, 2506 (2024).
[50] Z.-M. Zhai, M. Moradi, L.-W. Kong, B. Glaz, M. Haile, and Y.-C. Lai, Model-free tracking control of complex dynamical trajectories with machine learning, Nat. Commun. 14, 5698 (2023).
[51] T. L. Carroll, Using reservoir computers to distinguish chaotic signals, Phys. Rev. E 98, 052209 (2018).
[52] Z.-M. Zhai, M. Moradi, L.-W. Kong, and Y.-C. Lai, Detecting weak physical signal from noise: A machine-learning approach with applications to magnetic-anomaly-guided navigation, Phys. Rev. Appl. 19, 034030 (2023).
[53] C. Fernando and S. Sojakka, Pattern recognition in a bucket, in Advances in Artificial Life – ECAL 2003, Lecture Notes in Computer Science, Vol. 2801 (Springer, 2003) pp. 588–597.
[54] L. Appeltant, M. C. Soriano, G. Van der Sande, J. Danckaert, S. Massar, J. Dambre, B. Schrauwen, C. R. Mirasso, and I. Fischer, Information processing using a single dynamical node as complex system, Nat. Commun. 2, 468 (2011).
[55] Y. Paquot, F. Duport, A. Smerieri, J. Dambre, B. Schrauwen, M. Haelterman, and S. Massar, Optoelectronic reservoir computing, Sci. Rep. 2, 287 (2012).
[56] D. Brunner, M. C. Soriano, C. R. Mirasso, and I. Fischer, Parallel photonic information processing at gigabyte per second data rates using transient states, Nat. Commun. 4, 1364 (2013).
[57] K. Vandoorne, P. Mechet, T. Van Vaerenbergh, M. Fiers, G. Morthier, D. Verstraeten, B. Schrauwen, J. Dambre, and P. Bienstman, Experimental demonstration of reservoir computing on a silicon photonics chip, Nat. Commun. 5, 3541 (2014).
[58] J. Torrejon, M. Riou, F. Abreu Araujo, S. Tsunegi, G. Khalsa, D. Querlioz, P. Bortolotti, V. Cros, K. Yakushiji, A. Fukushima, H. Kubota, S. Yuasa, M. D. Stiles, and J. Grollier, Neuromorphic computing with nanoscale spintronic oscillators, Nature 547, 428 (2017).
[59] C. Du, F. Cai, M. A. Zidan, W. Ma, S. H. Lee, and W. D. Lu, Reservoir computing using dynamic memristors for temporal information processing, Nat. Commun. 8, 2204 (2017).
[60] K. Fujii and K. Nakajima, Harnessing disordered-ensemble quantum dynamics for machine learning, Phys. Rev. Appl. 8, 024030 (2017).
[61] L. Larger, A. Baylón-Fuentes, R. Martinenghi, V. S. Udaltsov, Y. K. Chembo, and M. Jacquot, High-speed photonic reservoir computing using a time-delay-based architecture: Million words per second classification, Phys. Rev. X 7, 011015 (2017).
[62] G. Tanaka, T. Yamane, J. B. Héroux, R. Nakane, N. Kanazawa, S. Takeda, H. Numata, D. Nakano, and A. Hirose, Recent advances in physical reservoir computing: A review, Neural Netw. 115, 100 (2019).
[63] M. Rafayelyan, J. Dong, Y. Tan, F. Krzakala, and S. Gigan, Large-scale optical reservoir computing for spatiotemporal chaotic systems prediction, Phys. Rev. X 10, 041037 (2020).
[64] K. Nakajima, Physical reservoir computing—an introductory perspective, Jpn. J. Appl. Phys. 59, 060501 (2020).
[65] Y. Zhong, J. Tang, X. Li, X. Liang, Z. Liu, Y. Li, Y. Xi, P. Yao, Z. Hao, B. Gao, H. Qian, and H. Wu, A memristor-based analogue reservoir computing system for real-time and power-efficient signal processing, Nat. Electron. 5, 672 (2022).
[66] G. Milano, G. Pedretti, K. Montano, S. Ricci, S. Hashemkhani, L. Boarino, D. Ielmini, and C. Ricciardi, In materia reservoir computing with a fully memristive architecture based on self-organizing nanowire networks, Nat. Mater. 21, 195 (2022).
[67] M. Yan, C. Huang, P. Bienstman, P. Tino, W. Lin, and J. Sun, Emerging opportunities and challenges for the future of reservoir computing, Nat. Commun. 15, 2056 (2024).
[68] Z.-M. Zhai, B. D. Stern, and Y.-C. Lai, Bridging known and unknown dynamics by transformer-based machine-learning inference from sparse observations, Nat. Commun. 16, 8053 (2025).
[69] Z.-M. Zhai, B. Glaz, M. Haile, A. Hastings, and Y.-C. Lai, Learning to learn ecosystems from limited data, Proc. Natl. Acad. Sci. USA 122, e2525347122 (2025).
[70] L.-W. Kong, H. Fan, C. Grebogi, and Y.-C. Lai, Machine learning prediction of critical transition and system collapse, Phys. Rev. Res. 3, 013090 (2021).
[71] L.-W. Kong, H. Fan, C. Grebogi, and Y.-C. Lai, Emergence of transient chaos and intermittency in machine learning, J. Phys. Complex. 2, 035014 (2021).
[72] H. Fan, L.-W. Kong, Y.-C. Lai, and X. Wang, Anticipating synchronization with machine learning, Phys. Rev. Res. 3, 023237 (2021).
[73] L.-W. Kong, Y. Weng, B. Glaz, M. Haile, and Y.-C. Lai, Reservoir computing as digital twins for nonlinear dynamical systems, Chaos 33, 033111 (2023).
[74] H. Luo, Y. Du, H. Fan, X. Wang, J. Guo, and X. Wang, Reconstructing bifurcation diagrams of chaotic circuits with reservoir computing, Phys. Rev. E 109, 024210 (2024).
[75] Z.-M. Zhai, M. Moradi, B. Glaz, M. Haile, and Y.-C. Lai, Machine-learning parameter tracking with partial state observation, Phys. Rev. Res. 6, 013196 (2024).
[76] S. Panahi and Y.-C. Lai, Adaptable reservoir computing: A paradigm for model-free data-driven prediction of critical transitions in nonlinear dynamical systems, Chaos 34, 051501 (2024).
[77] N. Trouvain, L. Pedrelli, T. T. Dinh, and X. Hinaut, ReservoirPy: An efficient and user-friendly library to design echo state networks, in Artificial Neural Networks and Machine Learning – ICANN 2020, Lecture Notes in Computer Science, Vol. 12397 (Springer, 2020) pp. 494–505.
[78] P. Steiner, A. Jalalvand, S. Stone, and P. Birkholz, PyRCN: A toolbox for exploration and application of Reservoir Computing Networks, Eng. Appl. Artif. Intell. 113, 104964 (2022).
[79] M. Scheffer, J. Bascompte, W. A. Brock, V. Brovkin, S. R. Carpenter, V. Dakos, H. Held, E. H. van Nes, M. Rietkerk, and G. Sugihara, Early-warning signals for critical transitions, Nature 461, 53 (2009).
[80] K. Ikeda, Multiple-valued stationary state and its instability of the transmitted light by a ring cavity system, Opt. Commun. 30, 257 (1979).
[81] A. Hastings and T. Powell, Chaos in a three-species food chain, Ecology 72, 896 (1991).
[82] K. McCann and P. Yodzis, Bifurcation structure of a three-species food-chain model, Theor. Popul. Biol. 48, 93 (1995).
[83] M. Dhamala and Y.-C. Lai, Controlling transient chaos in deterministic flows with applications to electrical power systems and ecology, Phys. Rev. E 59, 1646 (1999).
[84] Y. Kuramoto and T. Tsuzuki, Persistent propagation of concentration waves in dissipative media far from thermal equilibrium, Prog. Theor. Phys. 55, 356 (1976).
[85] G. I. Sivashinsky, Nonlinear analysis of hydrodynamic instability in laminar flames – I. Derivation of basic equations, Acta Astronaut. 4, 1177 (1977).
[86] E. N. Lorenz, Deterministic nonperiodic flow, J. Atmos. Sci. 20, 130 (1963).