Forecasting the Consumer Price Index in South Africa using statistical learning models
Loading...
Date
Journal Title
Journal ISSN
Volume Title
Publisher
Abstract
Accurate forecasting of the consumer price index (CPI) is vital for monetary policy, inflation targeting, and economic decision-making in South Africa. This study evaluates the performance of individual and ensemble statistical learning models in improving CPI forecasts. Six models were employed namely, the Random Walk (RW), Seasonal Autoregressive Integrated Moving Average (SARIMA), SARIMA model with exogenous variables (SARIMAX), Random Forest (RF), Gradient Boost (GB), and Multilayer Perceptron (MLP). A two-layer stacking framework was proposed, in which RF and MLP models served as base learners and the GB model acted as the meta-learner, resulting in two hybrid models (RF-GB and MLP-GB) and one stacked ensemble model (MLP-RF-GB). The dataset covered the period\ January 2009 to December 2024 and was further divided into pre-Coronavirus disease (COVID-19) (January 2009 – February 2020) and post-COVID-19 (March 2020 – December 2024) sub-samples to capture structural changes in inflation dynamics that may have happened during the COVID-19 pandemic. Variable selection was conducted using Least Absolute Shrinkage and Selection Operator (LASSO) and mutual information regression, while forecasting accuracy was evaluated using scale-dependent error metrics, namely the Mean Absolute Error (MAE) and Root Mean Squared Error (RMSE). The LASSO method outperformed mutual information regression by identifying three predictors in full period sample and four predictors in both pre- and post-COVID-19 periods. The results indicate that traditional time series models performed strongly at short forecast horizons during the pre-COVID-19 period. In particular, the SARIMAX model achieved the lowest short term errors, with RMSE values of 0.33 and 0.35 and MAE values of 0.30 and 0.31 at the 1- and 3-month horizons, respectively, marginally outperforming SARIMA. In contrast, during the post-COVID-19 period, individual machine learning models demonstrated superiour performance. The Multilayer Perceptron (MLP), Random Forest (RF), and Gradient Boosting (GB) models recorded substantially lower short to medium term forecast errors, with RF achieving RMSE values as low as 0.20–0.33 and MAE values of 0.15–0.22 across the 1- to 6-month horizons, reflecting their ability to capture heightened volatility following the pandemic shock. For the full sample period, encompassing both stable and volatile regimes, the stacked ensemble MLP–RF–GB model delivered the most accurate and consistent forecasts across all horizons. While the MLP model produced the lowest 1-month forecast error (RMSE = 0.30, MAE = 0.22), the MLP–RF–GB model outperformed all competing models at longer horizons, achieving RMSE values of 0.48, 0.54,
0.68, 0.74, and 0.75, and corresponding MAE values of 0.34, 0.38, 0.45, 0.50, and 0.52 for the 3- to 24-month forecasts. These findings highlight the effectiveness of stacking techniques in CPI forecasting and provide strong evidence that ensemble learning models are particularly well suited for environments characterised by structural changes in inflation dynamics, such as those induced by the COVID-19 pandemic.
Description
Thesis (M.Sc. (Statistics)) -- University of Limpopo, 2026
