IDEAS home Printed from https://ideas.repec.org/a/gam/jmathe/v13y2025i5p814-d1602666.html
   My bibliography  Save this article

Transformer-Based Models for Probabilistic Time Series Forecasting with Explanatory Variables

Author

Listed:
  • Ricardo Caetano

    (ISCAP, Polytechnic of Porto, Rua Jaime Lopes Amorim s/n, 4465-004 São Mamede de Infesta, Portugal
    These authors contributed equally to this work.)

  • José Manuel Oliveira

    (Institute for Systems and Computer Engineering, Technology and Science, Campus da FEUP, Rua Dr. Roberto Frias, 4200-465 Porto, Portugal
    Faculty of Economics, University of Porto, Rua Dr. Roberto Frias, 4200-464 Porto, Portugal
    These authors contributed equally to this work.)

  • Patrícia Ramos

    (Institute for Systems and Computer Engineering, Technology and Science, Campus da FEUP, Rua Dr. Roberto Frias, 4200-465 Porto, Portugal
    CEOS.PP, ISCAP, Polytechnic of Porto, Rua Jaime Lopes Amorim s/n, 4465-004 São Mamede de Infesta, Portugal
    These authors contributed equally to this work.)

Abstract

Accurate demand forecasting is essential for retail operations as it directly impacts supply chain efficiency, inventory management, and financial performance. However, forecasting retail time series presents significant challenges due to their irregular patterns, hierarchical structures, and strong dependence on external factors such as promotions, pricing strategies, and socio-economic conditions. This study evaluates the effectiveness of Transformer-based architectures, specifically Vanilla Transformer, Informer, Autoformer, ETSformer, NSTransformer, and Reformer, for probabilistic time series forecasting in retail. A key focus is the integration of explanatory variables, such as calendar-related indicators, selling prices, and socio-economic factors, which play a crucial role in capturing demand fluctuations. This study assesses how incorporating these variables enhances forecast accuracy, addressing a research gap in the comprehensive evaluation of explanatory variables within multiple Transformer-based models. Empirical results, based on the M5 dataset, show that incorporating explanatory variables generally improves forecasting performance. Models leveraging these variables achieve up to 12.4% reduction in Normalized Root Mean Squared Error (NRMSE) and 2.9% improvement in Mean Absolute Scaled Error (MASE) compared to models that rely solely on past sales. Furthermore, probabilistic forecasting enhances decision making by quantifying uncertainty, providing more reliable demand predictions for risk management. These findings underscore the effectiveness of Transformer-based models in retail forecasting and emphasize the importance of integrating domain-specific explanatory variables to achieve more accurate, context-aware predictions in dynamic retail environments.

Suggested Citation

  • Ricardo Caetano & José Manuel Oliveira & Patrícia Ramos, 2025. "Transformer-Based Models for Probabilistic Time Series Forecasting with Explanatory Variables," Mathematics, MDPI, vol. 13(5), pages 1-29, February.
  • Handle: RePEc:gam:jmathe:v:13:y:2025:i:5:p:814-:d:1602666
    as

    Download full text from publisher

    File URL: https://www.mdpi.com/2227-7390/13/5/814/pdf
    Download Restriction: no

    File URL: https://www.mdpi.com/2227-7390/13/5/814/
    Download Restriction: no
    ---><---

    References listed on IDEAS

    as
    1. Petropoulos, Fotios & Apiletti, Daniele & Assimakopoulos, Vassilios & Babai, Mohamed Zied & Barrow, Devon K. & Ben Taieb, Souhaib & Bergmeir, Christoph & Bessa, Ricardo J. & Bijak, Jakub & Boylan, Joh, 2022. "Forecasting: theory and practice," International Journal of Forecasting, Elsevier, vol. 38(3), pages 705-871.
      • Fotios Petropoulos & Daniele Apiletti & Vassilios Assimakopoulos & Mohamed Zied Babai & Devon K. Barrow & Souhaib Ben Taieb & Christoph Bergmeir & Ricardo J. Bessa & Jakub Bijak & John E. Boylan & Jet, 2020. "Forecasting: theory and practice," Papers 2012.03854, arXiv.org, revised Jan 2022.
    2. Salinas, David & Flunkert, Valentin & Gasthaus, Jan & Januschowski, Tim, 2020. "DeepAR: Probabilistic forecasting with autoregressive recurrent networks," International Journal of Forecasting, Elsevier, vol. 36(3), pages 1181-1191.
    3. Sushil Punia & Konstantinos Nikolopoulos & Surya Prakash Singh & Jitendra K. Madaan & Konstantia Litsiou, 2020. "Deep learning with long short-term memory networks and random forests for demand forecasting in multi-channel retail," International Journal of Production Research, Taylor & Francis Journals, vol. 58(16), pages 4964-4979, July.
    4. Wellens, Arnoud P. & Boute, Robert N. & Udenio, Maximiliano, 2024. "Simplifying tree-based methods for retail sales forecasting with explanatory variables," European Journal of Operational Research, Elsevier, vol. 314(2), pages 523-539.
    5. Hyndman, Rob J. & Koehler, Anne B., 2006. "Another look at measures of forecast accuracy," International Journal of Forecasting, Elsevier, vol. 22(4), pages 679-688.
    6. Thais de Castro Moraes & Xue‐Ming Yuan & Ek Peng Chew, 2024. "Hybrid convolutional long short‐term memory models for sales forecasting in retail," Journal of Forecasting, John Wiley & Sons, Ltd., vol. 43(5), pages 1278-1293, August.
    7. José Manuel Oliveira & Patrícia Ramos, 2024. "Evaluating the Effectiveness of Time Series Transformers for Demand Forecasting in Retail," Mathematics, MDPI, vol. 12(17), pages 1-28, August.
    8. Chandadevi Giri & Yan Chen, 2022. "Deep Learning for Demand Forecasting in the Fashion and Apparel Retail Industry," Forecasting, MDPI, vol. 4(2), pages 1-17, June.
    Full references (including those not matched with items on IDEAS)

    Most related items

    These are the items that most often cite the same works as this one and are cited by the same works as this one.
    1. Bojer, Casper Solheim & Meldgaard, Jens Peder, 2021. "Kaggle forecasting competitions: An overlooked learning opportunity," International Journal of Forecasting, Elsevier, vol. 37(2), pages 587-603.
    2. Spiliotis, Evangelos & Petropoulos, Fotios, 2024. "On the update frequency of univariate forecasting models," European Journal of Operational Research, Elsevier, vol. 314(1), pages 111-121.
    3. Wang, Shengjie & Kang, Yanfei & Petropoulos, Fotios, 2024. "Combining probabilistic forecasts of intermittent demand," European Journal of Operational Research, Elsevier, vol. 315(3), pages 1038-1048.
    4. Nghia Chu & Binh Dao & Nga Pham & Huy Nguyen & Hien Tran, 2022. "Predicting Mutual Funds' Performance using Deep Learning and Ensemble Techniques," Papers 2209.09649, arXiv.org, revised Jul 2023.
    5. Marco Zanotti, 2025. "Do global forecasting models require frequent retraining?," Working Papers 551, University of Milano-Bicocca, Department of Economics.
    6. Wellens, Arnoud P. & Boute, Robert N. & Udenio, Maximiliano, 2024. "Simplifying tree-based methods for retail sales forecasting with explanatory variables," European Journal of Operational Research, Elsevier, vol. 314(2), pages 523-539.
    7. Long, Xueying & Bui, Quang & Oktavian, Grady & Schmidt, Daniel F. & Bergmeir, Christoph & Godahewa, Rakshitha & Lee, Seong Per & Zhao, Kaifeng & Condylis, Paul, 2025. "Scalable probabilistic forecasting in retail with gradient boosted trees: A practitioner’s approach," International Journal of Production Economics, Elsevier, vol. 279(C).
    8. Nikolopoulos, Konstantinos, 2021. "We need to talk about intermittent demand forecasting," European Journal of Operational Research, Elsevier, vol. 291(2), pages 549-559.
    9. Qi, Lingzhi & Li, Xixi & Wang, Qiang & Jia, Suling, 2023. "fETSmcs: Feature-based ETS model component selection," International Journal of Forecasting, Elsevier, vol. 39(3), pages 1303-1317.
    10. Ye, Lili & Xie, Naiming & Boylan, John E. & Shang, Zhongju, 2024. "Forecasting seasonal demand for retail: A Fourier time-varying grey model," International Journal of Forecasting, Elsevier, vol. 40(4), pages 1467-1485.
    11. Semenoglou, Artemios-Anargyros & Spiliotis, Evangelos & Makridakis, Spyros & Assimakopoulos, Vassilios, 2021. "Investigating the accuracy of cross-learning time series forecasting methods," International Journal of Forecasting, Elsevier, vol. 37(3), pages 1072-1084.
    12. Theodorou, Evangelos & Spiliotis, Evangelos & Assimakopoulos, Vassilios, 2025. "Forecast accuracy and inventory performance: Insights on their relationship from the M5 competition data," European Journal of Operational Research, Elsevier, vol. 322(2), pages 414-426.
    13. Marcjasz, Grzegorz & Narajewski, Michał & Weron, Rafał & Ziel, Florian, 2023. "Distributional neural networks for electricity price forecasting," Energy Economics, Elsevier, vol. 125(C).
    14. Kafa, Nadine & Babai, M. Zied & Klibi, Walid, 2025. "Forecasting mail flow: A hierarchical approach for enhanced societal wellbeing," International Journal of Forecasting, Elsevier, vol. 41(1), pages 51-65.
    15. Anderer, Matthias & Li, Feng, 2022. "Hierarchical forecasting with a top-down alignment of independent-level forecasts," International Journal of Forecasting, Elsevier, vol. 38(4), pages 1405-1414.
    16. Jeroen Rombouts & Marie Ternes & Ines Wilms, 2024. "Cross-Temporal Forecast Reconciliation at Digital Platforms with Machine Learning," Papers 2402.09033, arXiv.org, revised May 2024.
    17. Bergsteinsson, Hjörleifur G. & Sørensen, Mikkel Lindstrøm & Møller, Jan Kloppenborg & Madsen, Henrik, 2023. "Heat load forecasting using adaptive spatial hierarchies," Applied Energy, Elsevier, vol. 350(C).
    18. Makridakis, Spyros & Spiliotis, Evangelos & Assimakopoulos, Vassilios, 2022. "M5 accuracy competition: Results, findings, and conclusions," International Journal of Forecasting, Elsevier, vol. 38(4), pages 1346-1364.
    19. Nikolopoulos, Konstantinos & Punia, Sushil & Schäfers, Andreas & Tsinopoulos, Christos & Vasilakis, Chrysovalantis, 2021. "Forecasting and planning during a pandemic: COVID-19 growth rates, supply chain disruptions, and governmental decisions," European Journal of Operational Research, Elsevier, vol. 290(1), pages 99-115.
    20. Olivares, Kin G. & Challu, Cristian & Marcjasz, Grzegorz & Weron, Rafał & Dubrawski, Artur, 2023. "Neural basis expansion analysis with exogenous variables: Forecasting electricity prices with NBEATSx," International Journal of Forecasting, Elsevier, vol. 39(2), pages 884-900.

    Corrections

    All material on this site has been provided by the respective publishers and authors. You can help correct errors and omissions. When requesting a correction, please mention this item's handle: RePEc:gam:jmathe:v:13:y:2025:i:5:p:814-:d:1602666. See general information about how to correct material in RePEc.

    If you have authored this item and are not yet registered with RePEc, we encourage you to do it here. This allows to link your profile to this item. It also allows you to accept potential citations to this item that we are uncertain about.

    If CitEc recognized a bibliographic reference but did not link an item in RePEc to it, you can help with this form .

    If you know of missing items citing this one, you can help us creating those links by adding the relevant references in the same way as above, for each refering item. If you are a registered author of this item, you may also want to check the "citations" tab in your RePEc Author Service profile, as there may be some citations waiting for confirmation.

    For technical questions regarding this item, or to correct its authors, title, abstract, bibliographic or download information, contact: MDPI Indexing Manager (email available below). General contact details of provider: https://www.mdpi.com .

    Please note that corrections may take a couple of weeks to filter through the various RePEc services.

    IDEAS is a RePEc service. RePEc uses bibliographic data supplied by the respective publishers.