A comprehensive macroeconomic evaluation across eight Sub-Saharan African nations demonstrates that incorporating inflation regimes into reinforcement learning algorithms can reduce large predictive mistakes relative to baseline persistence, yet it fails to consistently outperform simpler combination benchmarks. In an investigation analyzing historical macroeconomic panel records from Côte d’Ivoire, Ghana, Kenya, Nigeria, Senegal, Tanzania, Uganda, and South Africa, researchers tested whether hidden Markov states could guide a Q-learning rule to optimally blend multiple inflation forecasts. When evaluated using historical data versions strictly recorded before each forecast date, the adaptive regime-learning framework achieved a root mean squared error of 5.98 percentage points compared to 6.37 for a two-year-lag persistence benchmark. However, this apparent advantage in penalizing large discrepancies did not translate into lower typical error, as the method produced a mean absolute error of 3.78 percentage points versus 3.70 for persistence. Furthermore, equal weighting of candidate models delivered an even lower root mean squared error of 5.89, highlighting the persistent challenge complex weighting rules face when competing against elementary statistical baselines.
Macroeconomic forecasting across developing and emerging economies frequently confronts volatile structural shifts, sparse historical time series, and delayed data publication schedules that complicate model estimation. The study explicitly separated two core evaluation challenges: time-varying relationships between macroeconomic indicators and inflation, and the retroactive revision or late reporting of published series. When economic statistics are downloaded years after reference periods, retrospective evaluations risk using information that was unavailable to forecasters at the actual origin date. To address these vulnerabilities, the researchers designed two distinct empirical tracks, contrasting a strictly dated historical data experiment with an expansive retrospective panel containing 440 country-year records spanning 1970 to 2024 across the eight selected economies, evaluating whether algorithmic adaptation genuinely adds value under realistic informational constraints.
The primary nested rolling-origin evaluation restricted all information inputs to historical World Development Indicators releases available on January 1 of each forecast origin from 2018 through 2024. Under this design, the core input vector incorporated the second and third annual lags of consumer price index inflation and gross domestic product growth alongside country-specific indicators. The candidate forecasting pool comprised five distinct specifications: two-year-lag persistence, ridge regression with a penalty parameter of 10, Elastic Net regularized with equal L1 and L2 penalties, a 200-tree Random Forest, and histogram gradient boosting limited to seven leaves. Candidate hyperparameter settings remained completely fixed across iterations, ensuring that nested optimization isolated the behavior of the combination mechanism rather than conflating learning dynamics with continuous architectural adjustments of the underlying estimators.
To capture shifts in macroeconomic environments, the investigators fitted country-specific two-state Gaussian hidden Markov models using continuous historical inflation series ending no later than two years prior to the forecast origin. The latent state characterized by the larger estimated mean was designated as the higher-inflation regime, providing an objective statistical categorization rather than an arbitrary administrative crisis threshold. Filtered regime probabilities were updated through the forward algorithm using observations available at the historical cutoff, assigning a higher-state binary flag whenever the filtered probability met or exceeded 0.5. The learning rule’s state space combined this binary regime flag with an indicator identifying which candidate model had achieved the lowest absolute forecast error in that country’s most recently evaluated historical period. This interaction generated twelve operational states in the nested historical setup, providing discrete environmental contexts across which a shared Q-learning table accumulated performance scores for candidate models through negative absolute error rewards.
Rather than committing exclusively to the single candidate model with the highest accumulated score, the system converted Q-values into non-negative combination weights through a softmax function governed by a temperature parameter. In the nested historical grid search, the optimization process repeatedly selected a temperature of 1, a learning rate of 0.15, and a discount factor of 0.3 across all seven annual forecast origins. Because the future-value parameter was positive, the Q-learning updates incorporated potential downstream model performance patterns across successive yearly transitions, though the authors emphasized that forecast selection cannot influence actual macroeconomic inflation paths. A crucial structural feature of this architecture is that Q-learning scored candidate models individually based on their independent errors, whereas the final prediction took the form of a convex linear combination blending all candidate forecasts. As a result, the algorithmic scoring mechanism did not directly minimize the loss function of the blended composite forecast itself.
A rigorous examination of predictive accuracy revealed that performance gains were highly fragile and concentrated within specific metrics and geographic settings. In the nested historical experiment, regime learning lowered root mean squared error by 0.39 percentage points, or 6.1 percent, relative to two-year-lag persistence, but this reduction was accompanied by a 2.2 percent increase in mean absolute error. When compared against an identical learning rule stripped of the regime input, which yielded a root mean squared error of 6.08 and a mean absolute error of 3.93, regime learning showed only a modest reduction of 0.09 percentage points in squared error. Simpler fixed-weight combinations calibrated on historical errors achieved a mean absolute error of 3.62, outperforming the adaptive rule. Meanwhile, external autumn projections from the International Monetary Fund World Economic Outlook recorded a root mean squared error of 4.72 and a mean absolute error of 2.48, demonstrating the superior performance achievable when incorporating broad institutional data sets beyond a compact panel of lagged annual variables.
Disaggregating results by national economy showed marked divergence in model efficacy across Sub-Saharan Africa, demonstrating that pooled regional averages masked opposing local outcomes. Under the nested historical framework, regime learning lowered root mean squared error relative to persistence in Côte d’Ivoire, Ghana, Senegal, and Uganda, but produced higher errors in Kenya, Nigeria, Tanzania, and South Africa. The overall pooled squared-error advantage was heavily driven by a tiny subset of influential observations characterized by severe volatility. When researchers performed sensitivity checks by excluding Ghana from the sample, the pooled root mean squared error comparison reversed, leaving persistence ahead at 3.77 percentage points versus 3.88 for regime learning. Removing the three largest persistence errors similarly reversed the ranking to 3.58 for persistence against 3.88 for the learning rule, while excluding the five largest errors widened the baseline advantage to 3.10 versus 3.32, confirming that the apparent aggregate gain stemmed from mitigating a few massive errors rather than generalized precision.
Statistical significance tests further undermined claims of definitive superiority, revealing wide uncertainty intervals that spanned zero across multiple resampling designs. Percentile intervals constructed from 5,000 whole-year cluster resamples, which preserved cross-country correlations within shared calendar years, generated a 95 percent confidence interval for the root mean squared error difference between regime learning and persistence of minus 1.66 to positive 0.93 percentage points. A circular two-year block resampling procedure yielded a similarly broad interval ranging from minus 1.73 to positive 1.30. Paired predictive accuracy tests following the Diebold-Mariano framework with Harvey, Leybourne, and Newbold small-sample corrections produced a squared-loss p-value of 0.595 and an absolute-loss p-value of 0.867 across seven annual cross-sections. After applying Holm adjustments across fourteen formal model comparisons, none of the differences rejected the null hypothesis of equal predictive accuracy at the conventional five percent significance level.
The empirical investigation also uncovered critical data sparsity constraints that restricted the operational scope of regime classification. Across the 51 common test cases evaluated under the nested historical protocol, only two instances received the higher-inflation regime flag. This severe imbalance meant that the test period provided virtually no empirical evidence regarding how the learned weights perform during sustained high-inflation episodes. The authors conducted an extensive stability audit testing three distinct starting configurations for the Gaussian hidden Markov models, altering initial means from quartile distributions to extreme percentiles and adjusting initial transition probabilities between 0.6 and 0.9 across 500 estimation iterations. Although all 432 attempted fits converged successfully to identical binary state classifications, verifying numerical robustness, the underlying data structure essentially forced the algorithm to function within a single observed low-to-moderate inflation state throughout the entire test period.
Complementary findings from the wider-data retrospective evaluation highlighted the vulnerability of annual lagged predictors to sudden institutional and economic policy shocks. In that analysis, which evaluated 56 country-year outcomes across fixed and expanding windows using eight macroeconomic predictors, regime-learning models suffered massive late-period forecast failures in Nigeria. During 2023, the fixed-parameter regime model projected Nigerian inflation at 12.44 percent against an observed outcome of 24.66 percent, and in 2024 it forecast 22.12 percent against an actual rate of 33.24 percent, generating large underpredictions of 12.22 and 11.12 percentage points.
Evaluating training stochasticity across five random initialization seeds further demonstrated that algorithmic performance varied noticeably without delivering consistent gains across all criteria. While all five seeds yielded lower root mean squared error than persistence in the historical evaluation, ranging from 5.98 to 6.33 percentage points, only a single seed produced a lower mean absolute error, and the regime rule outperformed its matched no-regime counterpart in only three of the five seeds. The authors concluded that while reinforcement learning combined with regime detection offers an innovative conceptual approach to adaptive model weighting, it currently lacks the empirical reliability and statistical precision required for operational deployment by central banks or macroeconomic planning agencies. Rigorous benchmarking demonstrated that simple equal weighting and historical persistence remain robust, highly transparent, and demanding baselines that adaptive forecasting systems must convincingly beat across independent samples before justifying operational adoption.
Subject of Research: Adaptive machine learning and regime switching for macroeconomic inflation forecasting in Sub-Saharan Africa
Article Title: Regime learning for inflation forecast combination in Sub-Saharan Africa
Article References: Osei-Anim, R., Quartey, J. A., Banahene, S., & Asuamah, O. Y. (2026). Regime learning for inflation forecast combination in Sub-Saharan Africa. Discover Informatics, 1(1), Article 47. https://doi.org/10.1007/s44564-026-00049-4
Image Credits: AI Generated
DOI: 10.1007/s44564-026-00049-4
Keywords: Inflation forecasting, Sub-Saharan Africa, Reinforcement learning, Hidden Markov models, Forecast combination, Macroeconomic modeling, Consumer price index, Persistence benchmark, Equal weighting, Model averaging, Q-learning, Rolling-origin evaluation, Root mean squared error, Mean absolute error, Economic panel data, Diebold-Mariano test
News Source: Denise Maddox. (November 26, 2026). Regime Learning Cuts Large African Inflation Errors but Trails Simple Benchmarks. Scienmag.



