Learn R Programming

echos (version 1.0.3)

plot.forecast_esn: Plot forecasts of a trained ESN model

Description

Plot point forecasts and forecast intervals, actual values of a trained ESN model. Optionally, test data (out-of-sample) and fitted values can be added to the plot.

Usage

# S3 method for forecast_esn
plot(x, test = NULL, fitted = TRUE, interval = TRUE, n_obs = NULL, ...)

Value

Line chart of point forecast and actual values.

Arguments

x

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

test

Numeric vector. Test data, i.e., out-of-sample actual values.

fitted

Logical value. If TRUE, fitted values are added.

interval

Logical value. If TRUE, forecast intervals are added.

n_obs

Integer value. If NULL, all in-sample values are shown, otherwise only the last n_obs.

...

Further arguments passed to plot().

See Also

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

Examples

Run this code
xdata <- as.numeric(AirPassengers)
xmodel <- train_esn(y = xdata)
xfcst <- forecast_esn(xmodel, n_ahead = 12)
plot(xfcst)

Run the code above in your browser using DataLab