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. The function is a wrapper for forecast_esn() and intended to be used in combination with fabletools::model().

Usage

# S3 method for class 'ESN'
forecast(
  object,
  new_data,
  normal = TRUE,
  n_sim = 200,
  specials = NULL,
  xreg = NULL,
  ...
)

Arguments

object

An object of class mdl_df, containing an ESN model.

new_data

Forecast horizon (n-step ahead forecast).

normal

Logical value. If TRUE, dist_normal() is used, otherwise dist_sample().

n_sim

Integer value. The number of future sample path generated during simulation.

specials

Currently not in use.

xreg

A tsibble containing exogenous variables.

...

Currently not in use.

Value

An object of class fbl_ts ("fable").

Examples

library(tsibble)
library(fable)
AirPassengers %>%
as_tsibble() %>%
model("ESN" = ESN(value)) %>%
forecast(h = 18)
#> # A fable: 18 x 4 [1M]
#> # Key:     .model [1]
#>    .model    index
#>    <chr>     <mth>
#>  1 ESN    1961 Jan
#>  2 ESN    1961 Feb
#>  3 ESN    1961 Mrz
#>  4 ESN    1961 Apr
#>  5 ESN    1961 Mai
#>  6 ESN    1961 Jun
#>  7 ESN    1961 Jul
#>  8 ESN    1961 Aug
#>  9 ESN    1961 Sep
#> 10 ESN    1961 Okt
#> 11 ESN    1961 Nov
#> 12 ESN    1961 Dez
#> 13 ESN    1962 Jan
#> 14 ESN    1962 Feb
#> 15 ESN    1962 Mrz
#> 16 ESN    1962 Apr
#> 17 ESN    1962 Mai
#> 18 ESN    1962 Jun
#> # ℹ 2 more variables: value <dist>, .mean <dbl>