Skip to contents

Plot actual values and the point forecasts from the best hyperparameter combination selected via tune.esn() using the selected accuracy metric. Forecasts are shown as separate line segments for each test split, with vertical dashed lines marking the starts of test windows.

Usage

# S3 method for class 'tune_esn'
plot(x, metric = "mse", ...)

Arguments

x

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

metric

Character value. The metric used to select the best hyperparameter combination (metric = c("mse", "mae").

...

Further arguments passed to plot().

Value

Line chart of point forecast and actual values.

Examples

xdata <- as.numeric(AirPassengers)
fit <- tune_esn(
  y = xdata,
  n_ahead = 12,
  n_split = 5,
  alpha = c(0.5, 1),
  rho   = c(1.0),
  tau   = c(0.4),
  inf_crit = "bic"
)

plot(fit)