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. 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.
    2. 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.
    3. 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.
    4. 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.
    5. 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.
    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. 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.
    2. 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.
    3. 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.
    4. 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.
    5. 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.
    6. Marcjasz, Grzegorz & Narajewski, Michał & Weron, Rafał & Ziel, Florian, 2023. "Distributional neural networks for electricity price forecasting," Energy Economics, Elsevier, vol. 125(C).
    7. 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.
    8. 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.
    9. Evangelos Spiliotis & Spyros Makridakis & Artemios-Anargyros Semenoglou & Vassilios Assimakopoulos, 2022. "Comparison of statistical and machine learning methods for daily SKU demand forecasting," Operational Research, Springer, vol. 22(3), pages 3037-3061, July.
    10. Wang, Xiaoqian & Kang, Yanfei & Hyndman, Rob J. & Li, Feng, 2023. "Distributed ARIMA models for ultra-long time series," International Journal of Forecasting, Elsevier, vol. 39(3), pages 1163-1184.
    11. 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.
    12. Katarzyna Maciejowska & Bartosz Uniejewski & Rafa{l} Weron, 2022. "Forecasting Electricity Prices," Papers 2204.11735, arXiv.org.
    13. 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.
    14. Omar, Haytham & Klibi, Walid & Babai, M. Zied & Ducq, Yves, 2023. "Basket data-driven approach for omnichannel demand forecasting," International Journal of Production Economics, Elsevier, vol. 257(C).
    15. Aljuneidi, Tariq & Punia, Sushil & Jebali, Aida & Nikolopoulos, Konstantinos, 2024. "Forecasting and planning for a critical infrastructure sector during a pandemic: Empirical evidence from a food supply chain," European Journal of Operational Research, Elsevier, vol. 317(3), pages 936-952.
    16. Richard Bean, 2023. "Forecasting the Monash Microgrid for the IEEE-CIS Technical Challenge," Energies, MDPI, vol. 16(3), pages 1-23, January.
    17. 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.
    18. 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.
    19. Nikolopoulos, Konstantinos, 2021. "We need to talk about intermittent demand forecasting," European Journal of Operational Research, Elsevier, vol. 291(2), pages 549-559.
    20. 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.

    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.