Learn R Programming

echos

The echos package provides a comprehensive set of functions and methods for modeling and forecasting univariate time series using Echo State Networks (ESNs). It offers two alternative approaches:

  • Base R interface: Functions for modeling and forecasting time series using numeric vectors, allowing for straightforward integration with existing R workflows.
  • Tidy interface: A seamless integration with the fable framework based on tsibble, enabling tidy time series forecasting and model evaluation. This interface leverages the fabletools package, providing a consistent and streamlined workflow for model development, evaluation, and visualization.

The package features a lightweight implementation that enables fast and fully automatic model training and forecasting using ESNs. You can quickly and easily build accurate ESN models without requiring extensive hyperparameter tuning or manual configuration.

Installation

You can install the stable version from CRAN:

install.packages("echos")

You can install the development version from GitHub:

# install.packages("devtools")
devtools::install_github("ahaeusser/echos")

Base R

library(echos)

# Forecast horizon
n_ahead <- 12 # forecast horizon
# Number of observations
n_obs <- length(AirPassengers)
# Number of observations for training
n_train <- n_obs - n_ahead

# Prepare train and test data
xtrain <- AirPassengers[(1:n_train)]
xtest <- AirPassengers[((n_train+1):n_obs)]

# Train and forecast ESN model
xmodel <- train_esn(y = xtrain)
xfcst <- forecast_esn(xmodel, n_ahead = n_ahead)

# Plot result
plot(xfcst, test = xtest)

Tidy R

library(echos)
library(tidyverse)
library(tsibble)
library(fable)

# Prepare train data
train_frame <- m4_data %>%
  filter(series %in% c("M21655", "M2717"))

# Train and forecast ESN model
train_frame %>%
  model(
    "ESN" = ESN(value),
    "ARIMA" = ARIMA(value)
    ) %>%
  forecast(h = 18) %>%
  autoplot(train_frame, level = NULL)

Copy Link

Version

Install

install.packages('echos')

Monthly Downloads

198

Version

1.0.2

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Alexander Häußer

Last Published

June 23rd, 2025

Functions in echos (1.0.2)

model_sum.ESN

Model specification of a trained ESN model
print.esn

Print model specification of the trained ESN model
report.ESN

Provide a detailed summary of the trained ESN model
train_esn

Train an Echo State Network
is.esn

Checks if object is of class "esn"
filter_esn

Filter ESN models
ESN

Train an Echo State Network
m4_data

M4 dataset
forecast_esn

Forecast an Echo State Network
glance.ESN

Summary of trained models during random search
is.forecast_esn

Checks if object is of class "forecast_esn"
fitted.ESN

Extract fitted values from a trained ESN
forecast.ESN

Forecast an Echo State Network
summary.esn

Provide a detailed summary of the trained ESN model
tidy.ESN

Estimated coefficients
reservoir

Return the reservoir from a trained ESN as tibble
run_reservoir

Run reservoir
synthetic_data

Synthetic data
plot.forecast_esn

Plot forecasts of a trained ESN model
residuals.ESN

Extract residuals from a trained ESN
plot.esn

Plot internal states of a trained ESN model