AUTHOR=Antwi Albert , Kammies Emelia Thembile , Chaka Lyson , Arasomwan Martins Akugbe TITLE=Forecasting South African grain prices and assessing the non-linear impact of inflation and rainfall using a dynamic Bayesian generalized additive model JOURNAL=Frontiers in Applied Mathematics and Statistics VOLUME=Volume 11 - 2025 YEAR=2025 URL=https://www.frontiersin.org/journals/applied-mathematics-and-statistics/articles/10.3389/fams.2025.1582609 DOI=10.3389/fams.2025.1582609 ISSN=2297-4687 ABSTRACT=IntroductionAccurate price forecasts and the evaluation of some of the factors that affect the prices of grains are crucial for proper planning and food security. Various methods have been designed to model and forecast grain prices and other time-stamped data. However, due to some inherent limitations, some of these models do not produce accurate forecasts or are not easily interpretable. Although dynamic Bayesian generalized additive models (GAMs) offer potential to overcome some of these problems, they do not explicitly model local trends. This may lead to biased fixed effects estimates and forecasts, thus highlighting a significant gap in literature.MethodsTo address this, we propose the use of random intercepts to capture localized trends within the dynamic Bayesian GAM framework to forecast South African wheat and maize prices. Furthermore, we examine the complex underlying relationships of the prices with inflation and rainfall.ResultsEvidence from the study suggests that the proposed method is able to adequately capture the dynamic localized trends consistent with the underlying local trends in the prices. It was observed that the estimated localized variations are significant, which led to improved and efficient fixed-effect parameter estimates. This led to better posterior predictions and forecasts. A comparison to the static trend Bayesian GAMs and the autoregressive integrated moving average (ARMA) models indicates a general superiority of the proposed approach for the posterior predictions and long-term posterior forecasts and has potential for short-term forecasts. The static trend Bayesian GAMs were found to generally outperform the ARMA models in long-term posterior forecasts and also have potential for short-term forecasts. However, for 1-step ahead posterior forecasts, the ARMA models consistently outperformed all the Bayesian models. The study also unveiled a significant direct nonlinear impact of inflation on wheat and maize prices. Although the impacts of rainfall on wheat and maize prices are indirect and nonlinear, only the impact on maize prices is significant.DiscussionThe improved efficiency and forecasts of our proposed method suggest that researchers and practitioners may consider the approach when modelling and forecasting long-term prices of grains, other agricultural commodities, speculative assets and general single-subject time series data exhibiting non-stationarity.