Pedro Pessoa, Paul Campitelli, Douglas P Shepherd, S Banu Ozkan, Steve Pressé
{"title":"Mamba time series forecasting with uncertainty quantification.","authors":"Pedro Pessoa, Paul Campitelli, Douglas P Shepherd, S Banu Ozkan, Steve Pressé","doi":"10.1088/2632-2153/adec3b","DOIUrl":null,"url":null,"abstract":"<p><p>State space models, such as Mamba, have recently garnered attention in time series forecasting (TSF) due to their ability to capture sequence patterns. However, in electricity consumption benchmarks, Mamba forecasts exhibit a mean error of approximately 8%. Similarly, in traffic occupancy benchmarks, the mean error reaches 18%. This discrepancy leaves us to wonder whether the prediction is simply inaccurate or falls within error given spread in historical data. To address this limitation, we propose a method to quantify the predictive uncertainty of Mamba forecasts. To achieve this, we propose a dual-network framework based on the Mamba architecture for probabilistic forecasting, where one network generates point forecasts while the other estimates predictive uncertainty by modeling variance. We abbreviate our tool, Mamba with probabilistic TSF, as Mamba-ProbTSF and the code for its implementation is available on GitHub https://github.com/PessoaP/Mamba-ProbTSF. Evaluating this approach on synthetic and real-world benchmark datasets, we find Kullback-Leibler divergence between the learned distributions and the data-which, in the limit of infinite data, should converge to zero if the model correctly captures the underlying probability distribution-reduced to the order of 10<sup>-3</sup> for synthetic data and 10<sup>-1</sup> for real-world benchmark. We find that in both the electricity consumption and traffic occupancy benchmark, the true trajectory stays within the predicted uncertainty interval at the two-sigma level about 95% of the time. We further compare Mamba-ProbTSF against leading probabilistic forecast methods, DeepAR and ARIMA, and show that our method consistently achieves lower forecast errors while offering more reliable uncertainty quantification. We end with a consideration of potential limitations, adjustments to improve performance, and considerations for applying this framework to processes for purely or largely stochastic dynamics where the stochastic changes accumulate as observed, for example, in pure Brownian motion or molecular dynamics trajectories.</p>","PeriodicalId":33757,"journal":{"name":"Machine Learning Science and Technology","volume":"6 3","pages":"035012"},"PeriodicalIF":6.3000,"publicationDate":"2025-09-30","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"https://www.ncbi.nlm.nih.gov/pmc/articles/PMC12281171/pdf/","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Machine Learning Science and Technology","FirstCategoryId":"101","ListUrlMain":"https://doi.org/10.1088/2632-2153/adec3b","RegionNum":2,"RegionCategory":"物理与天体物理","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"2025/7/22 0:00:00","PubModel":"Epub","JCR":"Q1","JCRName":"COMPUTER SCIENCE, ARTIFICIAL INTELLIGENCE","Score":null,"Total":0}
引用次数: 0
Abstract
State space models, such as Mamba, have recently garnered attention in time series forecasting (TSF) due to their ability to capture sequence patterns. However, in electricity consumption benchmarks, Mamba forecasts exhibit a mean error of approximately 8%. Similarly, in traffic occupancy benchmarks, the mean error reaches 18%. This discrepancy leaves us to wonder whether the prediction is simply inaccurate or falls within error given spread in historical data. To address this limitation, we propose a method to quantify the predictive uncertainty of Mamba forecasts. To achieve this, we propose a dual-network framework based on the Mamba architecture for probabilistic forecasting, where one network generates point forecasts while the other estimates predictive uncertainty by modeling variance. We abbreviate our tool, Mamba with probabilistic TSF, as Mamba-ProbTSF and the code for its implementation is available on GitHub https://github.com/PessoaP/Mamba-ProbTSF. Evaluating this approach on synthetic and real-world benchmark datasets, we find Kullback-Leibler divergence between the learned distributions and the data-which, in the limit of infinite data, should converge to zero if the model correctly captures the underlying probability distribution-reduced to the order of 10-3 for synthetic data and 10-1 for real-world benchmark. We find that in both the electricity consumption and traffic occupancy benchmark, the true trajectory stays within the predicted uncertainty interval at the two-sigma level about 95% of the time. We further compare Mamba-ProbTSF against leading probabilistic forecast methods, DeepAR and ARIMA, and show that our method consistently achieves lower forecast errors while offering more reliable uncertainty quantification. We end with a consideration of potential limitations, adjustments to improve performance, and considerations for applying this framework to processes for purely or largely stochastic dynamics where the stochastic changes accumulate as observed, for example, in pure Brownian motion or molecular dynamics trajectories.
期刊介绍:
Machine Learning Science and Technology is a multidisciplinary open access journal that bridges the application of machine learning across the sciences with advances in machine learning methods and theory as motivated by physical insights. Specifically, articles must fall into one of the following categories: advance the state of machine learning-driven applications in the sciences or make conceptual, methodological or theoretical advances in machine learning with applications to, inspiration from, or motivated by scientific problems.