Learn R Programming

echos (version 1.0.3)

plot.tune_esn: Plot forecasts from a tuned ESN object

Description

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 tune_esn
plot(x, metric = "mse", ...)

Value

Line chart of point forecast and actual values.

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().

See Also

Other base functions: forecast_esn(), is.esn(), is.forecast_esn(), is.tune_esn(), plot.esn(), plot.forecast_esn(), print.esn(), summary.esn(), summary.tune_esn(), train_esn(), tune_esn()

Examples

Run this code
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)

Run the code above in your browser using DataLab