# LSTM's for timeseries with additional regressors

I have a dataset consisting of the weekly sales of 3,000 stores over the past 5 years, and have constructed a LSTM to forecast the next year of sales, given the previous year of sales. At each timestep $$t$$, the features are the previous 52 observations.

$$X_{t-52:t} \rightarrow LSTM \rightarrow \hat{X}_{t:t+52}$$

The LSTM is trained using a rolling window over the timeseries, starting with the input of $$X_{0:52}$$ and output of $$X_{52:104}$$ and ending with the input of $$X_{T-52:T}$$ and output of $$\hat{X}_{T:T+52}$$, so that the cell state is built up over the whole series to eventually forecast $$\hat{X}_{T:T+52}$$.

However, I also have a dataset $$E$$ of events for which I know the dates both past and future. These are events which may affect sales such as Christmas or Easter. It is encoded as a binary vector of length n_events=30 for each week $$t$$. I'm wondering what the best way would be to include this data as my forecast. Ideally, I want the NN to be able to learn the uplift or decrease associated with each event and use this information in its forecast. It is more complex than seasonality because some events such as Easter move around in a way that cannot be learned by the NN.

However, the events for the next year at any timestep $$t$$ is a tensor of shape [n_events, forecasting_horizon] = [36, 52] with 1972 individual "features" and hence is too large to realistically include in the input to the LSTM. What other methods could I use to feed these features into the model in a way that would inform its forecast over the next 52 weeks?

• Did you find a solution? Sep 6, 2022 at 7:28