Skip to contents

Forecast an Echo State Network (ESN) from a trained model via recursive forecasting. Forecast intervals are generated by simulating future sample path based on a moving block bootstrap of the residuals and estimating the quantiles from the simulations.

Usage

forecast_esn(
  object,
  n_ahead = 18,
  levels = c(80, 95),
  n_sim = 100,
  n_seed = 42
)

Arguments

object

An object of class esn. The result of a call to train_esn().

n_ahead

Integer value. The number of periods for forecasting (i.e. forecast horizon).

levels

Numeric vector. The levels of the forecast intervals (in percent), e.g., c(80, 95). Values must lie between 0 and 100.

n_sim

Integer value. The number of simulated future paths used to compute forecast intervals via a moving block bootstrap of the (demeaned) in-sample residuals. If NULL, no intervals are computed.

n_seed

Integer value. The seed for the random number generator (for reproducibility).

Value

A list containing:

  • point: Numeric vector containing the point forecasts.

  • interval: Numeric matrix containing the forecast intervals.

  • sim: Numeric matrix containing the simulated future sample path.

  • std: Numeric vector with standard deviations.

  • levels: Integer vector. The levels of the forecast intervals.

  • actual: Numeric vector containing the actual values.

  • fitted: Numeric vector containing the fitted values.

  • n_ahead: Integer value. The number of periods for forecasting (forecast horizon).

  • model_spec: Character value. The model specification as string.

References

  • Häußer, A. (2027). Echo State Networks for Time Series Forecasting: Hyperparameter Sweep and Benchmarking. Applied Soft Computing, 204, 116346. doi:10.1016/j.asoc.2026.116346

  • Häußer, A. (2026). echos: An R Package for Automatic Time Series Forecasting using Echo State Networks. The R Journal, 18(3), 120–143. doi:10.32614/RJ-2026-040

  • Jaeger, H. (2001). The “echo state” approach to analysing and training recurrent neural networks. GMD Report 148, German National Research Center for Information Technology.

  • Jaeger, H. (2002). Tutorial on training recurrent neural networks, covering BPTT, RTRL, EKF and the "echo state network" approach. GMD Report 159, German National Research Center for Information Technology.

  • Lukosevicius, M. (2012). A practical guide to applying echo state networks. In Neural Networks: Tricks of the Trade, 2nd edition, pages 659–686. Springer. doi:10.1007/978-3-642-35289-8_36

  • Lukosevicius, M. and Jaeger, H. (2009). Reservoir computing approaches to recurrent neural network training. Computer Science Review, 3(3):127–149. doi:10.1016/j.cosrev.2009.03.005

Examples

xdata <- as.numeric(AirPassengers)
xmodel <- train_esn(y = xdata)
xfcst <- forecast_esn(xmodel, n_ahead = 12)
plot(xfcst)