powered by
Creating different forecast paths for forecast objects (when applicable), by utilizing the underline model distribution with the simulate function
simulate
forecast_sim(model, h, n, sim_color = "blue", opacity = 0.05, plot = TRUE)
The baseline series, the simulated values and a plot
A forecasting model supporting Arima, auto.arima, ets, and nnetar models from the **forecast** package
Arima
auto.arima
ets
nnetar
An integer, defines the forecast horizon
An integer, set the number of iterations of the simulation
Set the color of the simulation paths lines
Set the opacity level of the simulation path lines
Logical, if TRUE will desplay the output plot
if (FALSE) { library(forecast) data(USgas) # Create a model fit <- auto.arima(USgas) # Simulate 100 possible forecast path, with horizon of 60 months forecast_sim(model = fit, h = 60, n = 100) }
Run the code above in your browser using DataLab