fabletools
fabletools copied to clipboard
Lagged predictor forecasting and Scenario-based forecasting
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.
- 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 usenew_data
withNA
values for the future regressors. - The 'percentage increase' from the textbook is referring to the definition of
Income
,Savings
, andUnemployment
- all of which are percentage changes. Thescenarios()
function simply allows multiplenew_data
inputs to theforecast()
(andgenerate()
function - it doesn't do any calculations like percentage changes.