# Robust Sales forecasting Using Deep Learning with Static and Dynamic Covariates

^{1}

^{2}

^{3}

^{*}

## Abstract

**:**

## 1. Introduction

## 2. Autoregressive Neural Network Model

## 3. Empirical Study

#### 3.1. Dataset and Exploratory Analysis

#### 3.2. Features Engineering

#### 3.3. Evaluation Design

## 4. Results and Discussion

## 5. Conclusions

## Author Contributions

## Funding

## Data Availability Statement

## Acknowledgments

## Conflicts of Interest

## References

- Ramos, P.; Santos, N.; Rebelo, R. Performance of state space and ARIMA models for consumer retail sales forecasting. Robot. Comput.-Integr. Manuf.
**2015**, 34, 151–163. [Google Scholar] [CrossRef] - Ramos, P.; Oliveira, J.M. A procedure for identification of appropriate state space and ARIMA models based on time-series cross-validation. Algorithms
**2016**, 9, 76. [Google Scholar] [CrossRef] - Bandara, K.; Hewamalage, H.; Liu, Y.H.; Kang, Y.; Bergmeir, C. Improving the accuracy of global forecasting models using time series data augmentation. Pattern Recognit.
**2021**, 120, 108148. [Google Scholar] [CrossRef] - Januschowski, T.; Gasthaus, J.; Wang, Y.; Salinas, D.; Flunkert, V.; Bohlke-Schneider, M.; Callot, L. Criteria for classifying forecasting methods. Int. J. Forecast.
**2020**, 36, 167–177. [Google Scholar] [CrossRef] - Petropoulos, F.; Apiletti, D.; Assimakopoulos, V.; Babai, M.Z.; Barrow, D.K.; Ben Taieb, S.; Bergmeir, C.; Bessa, R.J.; Bijak, J.; Boylan, J.E.; et al. Forecasting: Theory and practice. Int. J. Forecast.
**2022**, 38, 705–871. [Google Scholar] [CrossRef] - Wang, Y.; Smola, A.; Maddix, D.; Gasthaus, J.; Foster, D.; Januschowski, T. Deep Factors for Forecasting. In Proceedings of the 36th International Conference on Machine Learning, Long Beach, CA, USA, 9–15 June 2019; 2019. Volume 97, pp. 6607–6617. [Google Scholar]
- Ramos, P.; Oliveira, J.M.; Kourentzes, N.; Fildes, R. Forecasting Seasonal Sales with Many Drivers: Shrinkage or Dimensionality Reduction? Appl. Syst. Innov.
**2023**, 6, 3. [Google Scholar] [CrossRef] - Oliveira, J.M.; Ramos, P. Assessing the Performance of Hierarchical Forecasting Methods on the Retail Sector. Entropy
**2019**, 21, 436. [Google Scholar] [CrossRef] - Salinas, D.; Flunkert, V.; Gasthaus, J.; Januschowski, T. DeepAR: Probabilistic forecasting with autoregressive recurrent networks. Int. J. Forecast.
**2020**, 36, 1181–1191. [Google Scholar] [CrossRef] - Oliveira, J.M.; Ramos, P. Cross-Learning-Based Sales Forecasting Using Deep Learning via Partial Pooling from Multi-level Data. In Proceedings of the Engineering Applications of Neural Networks; Iliadis, L., Maglogiannis, I., Alonso, S., Jayne, C., Pimenidis, E., Eds.; Springer Nature: Cham, Switzerland, 2023; pp. 279–290. [Google Scholar] [CrossRef]
- Oliveira, J.M.; Ramos, P. Investigating the Accuracy of Autoregressive Recurrent Networks Using Hierarchical Aggregation Structure-Based Data Partitioning. Big Data Cogn. Comput.
**2023**, 7, 100. [Google Scholar] [CrossRef] - Rangapuram, S.S.; Werner, L.D.; Benidis, K.; Mercado, P.; Gasthaus, J.; Januschowski, T. End-to-End Learning of Coherent Probabilistic Forecasts for Hierarchical Time Series. In Proceedings of the 38th International Conference on Machine Learning, Virtual, 18–24 July 2021; 2021. Volume 139, pp. 8832–8843. [Google Scholar]
- Rangapuram, S.S.; Kapoor, S.; Nirwan, R.S.; Mercado, P.; Januschowski, T.; Wang, Y.; Bohlke-Schneider, M. Coherent Probabilistic Forecasting of Temporal Hierarchies. In Proceedings of the 26th International Conference on Artificial Intelligence and Statistics, Valencia, Spain, 25–27 April 2023; 2023. Volume 206, pp. 9362–9376. [Google Scholar]
- Alexandrov, A.; Benidis, K.; Bohlke-Schneider, M.; Flunkert, V.; Gasthaus, J.; Januschowski, T.; Maddix, D.C.; Rangapuram, S.; Salinas, D.; Schulz, J.; et al. GluonTS: Probabilistic and Neural Time Series Modeling in Python. J. Mach. Learn. Res.
**2020**, 21, 1–6. [Google Scholar] - Hochreiter, S.; Schmidhuber, J. Long Short-Term Memory. Neural Comput.
**1997**, 9, 1735–1780. [Google Scholar] [CrossRef] [PubMed] - Kourentzes, N. Intermittent demand forecasts with neural networks. Int. J. Prod. Econ.
**2013**, 143, 198–206. [Google Scholar] [CrossRef] - Lolli, F.; Gamberini, R.; Regattieri, A.; Balugani, E.; Gatos, T.; Gucci, S. Single-hidden layer neural networks for forecasting intermittent demand. Int. J. Prod. Econ.
**2017**, 183, 116–128. [Google Scholar] [CrossRef] - Gutierrez, R.S.; Solis, A.O.; Mukhopadhyay, S. Lumpy demand forecasting using neural networks. Int. J. Prod. Econ.
**2008**, 111, 409–420. [Google Scholar] [CrossRef] - Zhang, G.; Xia, Y.; Xie, M. Intermittent demand forecasting with transformer neural networks. Ann. Oper. Res.
**2023**, 1–22. [Google Scholar] [CrossRef] - Babai, M.Z.; Tsadiras, A.; Papadopoulos, C. On the empirical performance of some new neural network methods for forecasting intermittent demand. IMA J. Manag. Math.
**2019**, 31, 281–305. [Google Scholar] [CrossRef] - Zhou, H.; Qian, W.; Yang, Y. Tweedie gradient boosting for extremely unbalanced zero-inflated data. Commun. Stat.-Simul. Comput.
**2022**, 51, 5507–5529. [Google Scholar] [CrossRef] - Muhaimin, A.; Prastyo, D.D.; Horng-Shing Lu, H. Forecasting with Recurrent Neural Network in Intermittent Demand Data. In Proceedings of the 11th International Conference on Cloud Computing, Data Science & Engineering (Confluence), Noida, India, 28–29 January 2021; pp. 802–809. [Google Scholar] [CrossRef]
- Makridakis, S.; Spiliotis, E.; Assimakopoulos, V. The M5 competition: Background, organization, and implementation. Int. J. Forecast.
**2022**, 38, 1325–1336. [Google Scholar] [CrossRef] - Jeon, Y.; Seong, S. Robust recurrent network model for intermittent time-series forecasting. Int. J. Forecast.
**2022**, 38, 1415–1425. [Google Scholar] [CrossRef] - Akiba, T.; Sano, S.; Yanase, T.; Ohta, T.; Koyama, M. Optuna: A Next-Generation Hyperparameter Optimization Framework. In Proceedings of the 25th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining (KDD ’19), Anchorage, AK, USA, 4–8 August 2019; Association for Computing Machinery: New York, NY, USA, 2019; pp. 2623–2631. [Google Scholar] [CrossRef]
- Hyndman, R.J.; Koehler, A.B. Another look at measures of forecast accuracy. Int. J. Forecast.
**2006**, 22, 679–688. [Google Scholar] [CrossRef] - Makridakis, S.; Spiliotis, E.; Assimakopoulos, V. M5 accuracy competition: Results, findings, and conclusions. Int. J. Forecast.
**2022**, 38, 1346–1364. [Google Scholar] [CrossRef]

**Figure 1.**Proportion of days corresponding to events and SNAP (on the

**left**) and distribution of event types (on the

**right**).

**Figure 5.**Distribution of the weekly average prices within each category’s departments for each year from 2011 to 2016 (X axes on a logarithmic scale). From left to right, we have the Foods category’s departments: Foods1 in pink, Foods2 in light green, Foods3 in dark green; Hobbies departments: Hobbies1 in pink, Hobbies2 in light green; Household’s departments: Household1 in pink, Household2 in light green.

**Figure 6.**Influence of prices and IDs’ inclusion in DeepAR models. Hollow dots represent errors from models without prices/IDs, while solid dots represent errors from models with prices/IDs.

**Table 1.**Performance of DeepAR global models and benchmark evaluated with respect to RMSSE and MASE.

Model | RMSSE | MASE |
---|---|---|

DeepAR | 0.78245 | 0.5718 |

DeepAR + Prices | 0.78493 | 0.5829 |

DeepAR + Events | 0.78247 | 0.5692 |

DeepAR + Time | 0.78190 | 0.5742 |

DeepAR + IDs | 0.77356 | 0.5404 |

DeepAR + Prices + Events | 0.78402 | 0.5776 |

DeepAR + Prices + Time | 0.78330 | 0.5740 |

DeepAR + Prices + IDs | 0.77461 | 0.5466 |

DeepAR + Events + Time | 0.78511 | 0.5766 |

DeepAR + Events + IDs | 0.77221 | 0.5393 |

DeepAR + Time + IDs | 0.76990 | 0.5359 |

DeepAR + Prices + Events + Time | 0.78471 | 0.5777 |

DeepAR + Prices + Events + IDs | 0.77231 | 0.5438 |

DeepAR + Prices + Time + IDs | 0.76971 | 0.5360 |

DeepAR + Events + Time + IDs | 0.76866 | 0.5344 |

DeepAR + Prices + Events + Time + IDs | 0.76864 | 0.5354 |

Seasonal Naïve | 1.03543 | 0.5889 |

Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |

© 2023 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Ramos, P.; Oliveira, J.M.
Robust Sales forecasting Using Deep Learning with Static and Dynamic Covariates. *Appl. Syst. Innov.* **2023**, *6*, 85.
https://doi.org/10.3390/asi6050085

**AMA Style**

Ramos P, Oliveira JM.
Robust Sales forecasting Using Deep Learning with Static and Dynamic Covariates. *Applied System Innovation*. 2023; 6(5):85.
https://doi.org/10.3390/asi6050085

**Chicago/Turabian Style**

Ramos, Patrícia, and José Manuel Oliveira.
2023. "Robust Sales forecasting Using Deep Learning with Static and Dynamic Covariates" *Applied System Innovation* 6, no. 5: 85.
https://doi.org/10.3390/asi6050085