Is there a way to forecast a time series multiple linear regression using externally made dummy variables?

This question concerns question 4h of this textbook exercise. It asks to make future predictions based on a chosen TSLM model which involves an endogenously (if i'm using this right) made dummy variable based off certain time points. My main code is as follows

The main problem I've encountered is that when I use forecast() on my model, it gives an error message:

This is very confusing because shouldn't my modified data already include the dummy variables? Hence, the model includes it and should be able to forecast the data. Yet it doesn't. Is there something I'm not doing?

Topic dummy-variables forecasting linear-regression time-series r

Category Data Science


If you use exogenous variables, then you need to provide their future values in the forecast() function. You only provide the value of Festival for the historic time periods used in training the model. The forecast() function needs to know the values of Festival for the future time periods.

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.