fabletools icon indicating copy to clipboard operation
fabletools copied to clipboard

Lagged predictor forecasting and Scenario-based forecasting

Open Roy-Forethought opened this issue 3 years ago • 1 comments

Hi, I've run into some issues and wanted to clarify two points.

  • First, when using a dynamic regression model to create forecasts for the next 3 periods, are future values required even when all the predictors are lagged (see below example)?

    example = ARIMA(DV ~ trend() + season() + lag(Var1,6) + lag(Var2,6) + lag(Var3,3))

  • Second, I have attempted to use scenario-based forecasting (as outlined in Chp 7.6) and wanted to seek clarification on the code (see example below taken from the text. The text describes the numbers bolded below as percentage increase, but how does this translate in the code? When I run the code, it simply creates a dataframe with 1 and 0.5?

    future_scenarios <- scenarios(
      Increase = new_data(us_change, 4) %>%
        mutate(Income=**1**, Savings=**0.5**, Unemployment=**0**),
      Decrease = new_data(us_change, 4) %>%
       mutate(Income=**-1**, Savings=**-0.5**, Unemployment=**0**),
     names_to = "Scenario")
    

Apologies if I have left some information out and thank you for any help.

Roy-Forethought avatar Jun 03 '21 03:06 Roy-Forethought

  1. Future values should not be required when forecasting the next 3 steps, as these values should be stored within the model object. I'm not sure (I don't think) if this is currently implemented to allow for forecasting without new_data, but this would be a useful improvement. Until this works, you can simply use new_data with NA values for the future regressors.
  2. The 'percentage increase' from the textbook is referring to the definition of Income, Savings, and Unemployment - all of which are percentage changes. The scenarios() function simply allows multiple new_data inputs to the forecast() (and generate() function - it doesn't do any calculations like percentage changes.

mitchelloharawild avatar Jul 26 '21 05:07 mitchelloharawild