# Robust Sales forecasting Using Deep Learning with Static and Dynamic Covariates
## 3 Empirical Study  
### Dataset and Exploratory Analysis  
In this study, we used the M5 competition dataset, which is a well-established and openly available dataset of hierarchical unit sales data from Walmart. The M5 dataset is widely used for forecasting research because it is credible and reproducible. The M5 dataset comprises 3049 items categorized under Hobbies, Foods, and Household. These categories are further divided into a total of seven departments. Specifically, the Foods category is subdivided into three distinct departments (Foods1, Foods2, and Foods3), while both the Hobbies and Household categories are each subdivided into two departments (Hobbies1, Hobbies2, Household1, and Household2) [23]. These items are available for sale across 10 stores located in three states: California (CA), Texas (TX), and Wisconsin (WI). The state of California encompasses four stores (CA1, CA2, CA3, and CA4), whereas the states of Texas and Wisconsin each have three stores (TX1, TX2, and TX3; WI1, WI2, and WI3, respectively). The dataset covers a period of 5.4 years, from 29 January 2011 to 19 June 2016, on a daily basis, totaling 1969 days. In addition to sales data, the M5 dataset also includes the regular price of each item, supplemental nutrition assistance program (SNAP) days, and special events that may impact sales. Approximately 8% of days in the dataset are marked by a special event, which is equivalent to around 160 events in the span of 1969 days. Of these events, around one-third are religious, such as Orthodox Christmas, while another one-third are national holidays, like Independence Day. The remaining third is divided into two-thirds encompassing cultural events, such as Valentine's Day, and one-third sporting events, such as the Super Bowl (please see Figure 1). Figure 1: Proportion of days corresponding to events and SNAP (on the **left**) and distribution of event types (on the **right**). The SNAP is a federally funded initiative in the United States aiming to help individuals and families with low incomes to buy food. It was previously referred to as food stamps and is managed by the U.S. Department of Agriculture. As the largest nutrition assistance program in the nation, SNAP plays a crucial role in providing support for those in need of food assistance. The M5 dataset provides information on the SNAP in each state for each day. When we examine the proportion of days on which Walmart stores permit purchases with SNAP benefits, we observe that it is consistent across all three states: 650 days or 33%. SNAP benefits are available for exactly 10 days each month in all states, and these days occur on fixed dates that are the same for every month in every state. In California, SNAP benefits are available in the first 10 days of the month, while in Texas, benefits are available on the 1 st, 3 rd, 5 th, 6 th, 7 th, 9 th, 11 th, 12 th, 13 th, and 15 th days. In Wisconsin, SNAP benefits are available on the 2 nd, 3 rd, 5 th, 6 th, 8 th, 9 th, 11 th, 12 th, 14 th, and 15 th days. Notably, SNAP days occur in the first half of the month for all states. Figure 2 provides a comprehensive overview of the sales volume during SNAP and non-SNAP days in the three states: California, Texas, and Wisconsin. Although the daily time series are visible in the background, it is more informative to examine the smoothed representations. Our analysis shows that sales volumes are significantly higher on SNAP days compared to non-SNAP days in every state. The largest difference is observed in Wisconsin, while the variations over time are relatively minor. Specifically, the two curves in Wisconsin appear to reach their biggest difference at approximately 2013. However, as with all smoothing fits, it is important to exercise caution when examining data at the edges. In such cases, the results may be less reliable and should be interpreted with caution. We also analyzed sales volumes during special event days versus non-event days in the three states (please see Figure 3).