plot_example | 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)
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 |
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.