Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Echo State Networks for Time Series Forecasting

NotificationsYou must be signed in to change notification settings

ahaeusser/echos

Repository files navigation

CRAN_Status_BadgeLifecycle: stableLicenceCodecov test coverageR-CMD-check

Theechos package provides a comprehensive set offunctions andmethods for modeling and forecasting univariate time series usingEcho State Networks (ESNs). It offers two alternative approaches:

  • Base R interface: Functions for modeling and forecasting timeseries usingnumeric vectors, allowing for straightforwardintegration with existing R workflows.
  • Tidy interface: A seamless integration with thefable framework based ontsibble, enabling tidy timeseries forecasting and model evaluation. This interface leverages thefabletools package,providing a consistent and streamlined workflow for model development,evaluation, and visualization.

The package features alightweight implementation that enablesfast and fully automatic model training and forecasting using ESNs.You can quickly and easily build accurate ESN models without requiringextensive hyperparameter tuning or manual configuration.

Installation

You can install thestable version fromCRAN:

install.packages("echos")

You can install thedevelopment version fromGitHub:

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

Base R

library(echos)# Forecast horizonn_ahead<-12# forecast horizon# Number of observationsn_obs<- length(AirPassengers)# Number of observations for trainingn_train<-n_obs-n_ahead# Prepare train and test dataxtrain<-AirPassengers[(1:n_train)]xtest<-AirPassengers[((n_train+1):n_obs)]# Train and forecast ESN modelxmodel<- train_esn(y=xtrain)xfcst<- forecast_esn(xmodel,n_ahead=n_ahead)# Plot resultplot(xfcst,test=xtest)

Plot forecast and test data

Tidy R

library(echos)library(tidyverse)library(tsibble)library(fable)# Prepare train datatrain_frame<-m4_data %>%  filter(series%in% c("M21655","M2717"))# Train and forecast ESN modeltrain_frame %>%  model("ESN"= ESN(value),"ARIMA"= ARIMA(value)    ) %>%  forecast(h=18) %>%  autoplot(train_frame,level=NULL)

Plot forecast and train data


[8]ページ先頭

©2009-2025 Movatter.jp