Market Regime-Aware Explainability for AI-Driven Financial Decisions: A Counterfactual and Uncertainty-Based Framework

Authors

  • Hadi Hasan Hadi Damghan University, Computer Science (Soft computing and artificial intelligence),Iran

DOI:

https://doi.org/10.29304/jqcsm.2026.18.32907

Keywords:

market regime detection, explainable artificial intelligence, counterfactual explanations, uncertainty quantification, financial decision-making, financial time series, risk-aware AI, algorithmic trading, interpretable machine learning, trustworthy AI

Abstract

AI models now play a key role in financial decisions, including buy, sell, and hold recommendations, risk monitoring, market direction prediction, and portfolio rebalancing. In financial domains, though, high predictive precision isn’t enough, because financial decision-makers want to know why a model made a decision, whether the reasons behind the decisions are sound given the current market conditions, and what type of uncertainty is present in the model's output. Current explainable AI (XAI) methods in finance often provide static feature-attribution explanations, whereas financial markets are dynamic and non-stationary, exhibiting latent regimes such as bullish, bearish, sideways, and high-volatility phases. We present RACU-XAI, a framework for generating market regime-aware frameworks that combines market regime detection, Artificial Intelligence-related financial decision modeling, regime-conditioned explanations, counterfactual explanation generation, and uncertainty quantification. The framework is validated on daily market data for the S&P 500, NASDAQ-100, and Bitcoin/USD, using engineered price, technical, risk, and regime features. We proposed a three-class classification problem over a five-trading-day horizon for the main decision task. The findings indicate that RACU-XAI achieves the best predictive performance on S&P 500 data, with an accuracy of 0.724, an F1 score of 0.712, and an AUC of 0.769. Its performance improves financial performance after transaction costs, and the cumulative return is 61.4%, the Sharpe ratio is 1.31, and the maximum drawdown is -12.6%. Regime-aware SHAP analysis shows that the explanatory drivers vary widely across market conditions, and counterfactual explanations indicate the minimum changes required to shift the decision from Sell to Hold or from Buy to Hold. Finally, uncertainty estimates are strongly associated with error rates, suggesting that uncertainty could serve as a suitable risk-filtering mechanism. The results indicated that conditioning explanations on market regimes in AI-based decision support systems can reinforce transparency, stability, and risk consciousness in financial markets.

Downloads

Download data is not yet available.

References

A. M. Ozbayoglu, M. U. Gudelek, and O. B. Sezer, "Deep learning for financial applications : A survey," Appl. Soft Comput., vol. 93, p. 106384, Aug. 2020, doi: 10.1016/j.asoc.2020.106384.

O. B. Sezer, M. U. Gudelek, and A. M. Ozbayoglu, “Financial time series forecasting with deep learning : A systematic literature review: 2005–2019,” Appl. Soft Comput., vol. 90, p. 106181, May 2020, doi: 10.1016/j.asoc.2020.106181.

P. Giudici, M. Centurelli, and S. Turchetta, “Artificial Intelligence risk measurement,” Expert Syst. Appl., vol. 235, p. 121220, Jan. 2024, doi: 10.1016/j.eswa.2023.121220.

T. Klein and T. Walther, “Advances in Explainable Artificial Intelligence (xAI) in Finance,” Financ. Res. Lett., vol. 70, p. 106358, Dec. 2024, doi: 10.1016/j.frl.2024.106358.

J. Černevičienė and A. Kabašinskas, “Explainable artificial intelligence (XAI) in finance: a systematic literature review,” Artif. Intell. Rev., vol. 57, no. 8, p. 216, Jul. 2024, doi: 10.1007/s10462-024-10854-8.

S. An, X. Gao, F. An, and T. Wu, “Early warning of regime switching in a complex financial system from a spillover network dynamic perspective,” iScience, vol. 28, no. 3, p. 111924, Mar. 2025, doi: 10.1016/j.isci.2025.111924.

B. Horvath, Z. Issa, and A. Muguruza, “Clustering market regimes using the Wasserstein distance,” The Journal of Computational Finance, 2024, doi: 10.21314/JCF.2024.005.

R. Guidotti, “Counterfactual explanations and how to find them: literature review and benchmarking,” Data Min. Knowl. Discov., vol. 38, no. 5, pp. 2770–2824, Sep. 2024, doi: 10.1007/s10618-022-00831-6.

I. Stepin, J. M. Alonso, A. Catala, and M. Pereira-Farina, “A Survey of Contrastive and Counterfactual Explanation Generation Methods for Explainable Artificial Intelligence,” IEEE Access, vol. 9, pp. 11974–12001, 2021, doi: 10.1109/ACCESS.2021.3051315.

M. Abdar et al., “A review of uncertainty quantification in deep learning: Techniques, applications and challenges,” Information Fusion, vol. 76, pp. 243–297, Dec. 2021, doi: 10.1016/j.inffus.2021.05.008.

J. Gawlikowski et al., “A survey of uncertainty in deep neural networks,” Artif. Intell. Rev., vol. 56, no S1, pp. 1513–1589, Oct. 2023, doi: 10.1007/s10462-023-10562-9.

B. Lim and S. Zohren, “Time-series forecasting with deep learning: a survey,” Philosophical Transactions of the Royal Society A: Mathematical, Physical and Engineering Sciences, vol. 379, no. 2194, p. 20200209, Apr. 2021, doi: 10.1098/rsta.2020.0209.

S. Carta, S. Consoli, A. S. Podda, D. R. Recupero, and M. M. Stanciu, “Statistical arbitrage powered by Explainable Artificial Intelligence,” Expert Syst. Appl., vol. 206, p. 117763, Nov. 2022, doi: 10.1016/j.eswa.2022.117763.

A. Gramegna and P. Giudici, “SHAP and LIME: An Evaluation of Discriminative Power in Credit Risk,” Front. Artif. Intell., vol. 4, Sep. 2021, doi: 10.3389/frai.2021.752558.

S. M. Lundberg et al., “From local explanations to global understanding with explainable AI for trees,” Nat. Mach. Intell., vol. 2, no. 1, pp. 56–67, Jan. 2020, doi: 10.1038/s42256-019-0138-9.

A. Theissler, F. Spinnato, U. Schlegel, and R. Guidotti, “Explainable AI for Time Series Classification: A Review, Taxonomy and Research Directions,” IEEE Access, vol. 10, pp. 100700–100724, 2022, doi: 10.1109/ACCESS.2022.3207765.

A.-H. Karimi, G. Barthe, B. Schölkopf, and I. Valera, “A Survey of Algorithmic Recourse: Contrastive Explanations and Consequential Recommendations,” ACM Comput. Surv., vol. 55, no. 5, pp. 1–29, May 2023, doi: 10.1145/3527848.

S. Dandl, C. Molnar, M. Binder, and B. Bischl, “Multi-Objective Counterfactual Explanations,” 2020, pp. 448–469. doi: 10.1007/978-3-030-58112-1_31.

R. K. Mothilal, A. Sharma, and C. Tan, “Explaining machine learning classifiers through diverse counterfactual explanations,” in Proceedings of the 2020 Conference on Fairness, Accountability, and Transparency, New York, NY, USA: ACM, Jan. 2020, pp. 607–617. doi: 10.1145/3351095.3372850.

A. N. Angelopoulos and S. Bates, “Conformal Prediction: A Gentle Introduction,” Foundations and Trends® in Machine Learning, vol. 16, no. 4, pp. 494–591, Mar. 2023, doi: 10.1561/2200000101.

Downloads

Published

2026-09-30

How to Cite

Hadi Hasan Hadi. (2026). Market Regime-Aware Explainability for AI-Driven Financial Decisions: A Counterfactual and Uncertainty-Based Framework. Journal of Al-Qadisiyah for Computer Science and Mathematics, 18(3), Comp 421–448. https://doi.org/10.29304/jqcsm.2026.18.32907

Issue

Section

Computer Articles