ahaeusser / echos

Echo State Networks for Time Series Forecasting

Home Page:https://ahaeusser.github.io/echos/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

echos

Lifecycle: experimental Licence Codecov test coverage R-CMD-check

The package provides a tidy interface for modeling and forecasting univariate time series using Echo State Networks (ESNs). The model works within the fable framework provided by the fabletools package, which provides the tools to evaluate, visualize, and combine models in a workflow consistent with the tidyverse.

Disclaimer: The echos package is highly experimental and it is very likely that there will be (substantial) changes in the near future. These changes will probably affect the interface (e.g. arguments within ESN()) and the underlying modeling procedure itself.

Installation

You can install the development version from GitHub with:

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

Getting started

library(echos)
#> Registered S3 method overwritten by 'quantmod':
#>   method            from
#>   as.zoo.data.frame zoo

# 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)

About

Echo State Networks for Time Series Forecasting

https://ahaeusser.github.io/echos/


Languages

Language:R 94.8%Language:C++ 4.8%Language:C 0.4%