Skip to content

Instantly share code, notes, and snippets.

@anita-owens
Created October 24, 2021 18:31
Show Gist options
  • Select an option

  • Save anita-owens/78080fb9c3ac20d7ae606fd41105ce69 to your computer and use it in GitHub Desktop.

Select an option

Save anita-owens/78080fb9c3ac20d7ae606fd41105ce69 to your computer and use it in GitHub Desktop.
Forecast Future Data
#Step 5 (Alternative): Specify the h or horizon to get a forecast into the future, but if using xregs (independent regressors), you must create a new dataframe with the xregs.
#forecast on the new tibble
forecast_tbl_future_data <- calibration_tbl %>%
modeltime_forecast(
new_data = explanatory_data
)
#plot forecast for the next 3 months
plot_modeltime_forecast(forecast_tbl, .interactive = TRUE)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment