plot_example {tsfgrnn} | R Documentation |
This function is useful to see how the forecast has been computed. An ordinal specifying the order of the weight has to be supplied and the function plots the training pattern associated with that ordinal.
plot_example(forecast, position, h = 1, timeS = c("preprocessed", "original"))
forecast |
The grnnForecast object. |
position |
An integer. It is an ordinal number indicating what training
pattern to plot. For instance, if |
h |
An integer. This value is only useful when the recursive strategy is being used. It indicates the forecasting horizon |
timeS |
A string value indicating what time series to plot. Possible values are "preprocessed" (the default) and "original". That is, you can plot the preprocessed or the original time series. |
A ggplot object representing an example used in the prediction.
pred <- grnn_forecasting(USAccDeaths, h = 12, lags = 1:12, sigma = 50) library(ggplot2) plot_example(pred, 1)