Introduction

Food inflation is arguably one of the most concerning phenomena, a catalyst driving the macroeconomic forces in any developing country in the world, and Bangladesh is no exception. Currently, in this age of globalization, where economies are interconnected under the same sky, the rising price of common consumer food is a global issue. Since its inception in 1971, Bangladesh has taken small steps to fight poverty and raise its living standards despite minimal international support. Due to a lack of technology, inadequate mass production, and a shortage of agricultural resources, coupled with natural disasters, a new state had to build everything brick by brick to fight its way out of low-income status. As a result, towards the end of 1980, Bangladesh had started to face the pressure of inflation1.

Bangladesh experienced a period of moderate inflation in the 1990 s and early 2000 s, averaging less than 4%. However, inflation rose sharply to a two-digit level in 2007-08, reaching a high of 12.28%. This was primarily driven by a significant surge in food inflation, which was 16.69% in 2007-08, and was particularly severe for rural households. After a brief decline, inflation surged again in 2010-11, reaching 10.89% with food inflation at 14.09%2. In the latest Food Security Update of June 13, Bangladesh is on the “Red List” by the food price inflation tracker for having a double-digit food inflation rate of over 10% for two consecutive years3.

Food inflation has historically accounted for the majority of inflation in Bangladesh since people’s consumption of food makes up a significant portion of their overall consumption basket4. In recent times, the outbreak of COVID-19 and the subsequent Russia-Ukraine war have significantly increased inflation, especially food inflation, posing challenges to macroeconomic stability in Bangladesh5.

Acknowledging unprecedented inflation in food prices as one of the biggest hindrances in the path of economic growth and development, this research dives into understanding the explanatory factors causing it. For cogent policy suggestions towards curbing inflationary pressure, it is imperative to review food price inflation from various aspects.

In a study by Brown and Kshirsagar6, in which they modeled the impact of weather disturbances on local food affordability, food prices from 554 local markets in 51 countries were examined from 2008 and 2012, and almost 20% of local market prices were affected by domestic weather disturbances. A study focusing on five large countries in the region, namely Bangladesh, India, Nepal, Pakistan, and Sri Lanka, suggests that there is likely to be a significant negative impact on food production and prices in all South Asian countries due to changes in agricultural productivity induced by climate change7.

Melo-Velandia et al.8 estimated a non-stationary extreme value model for Colombian food prices, and the findings suggest that perishable foods are more exposed to extreme weather conditions compared to processed foods. In fact, an extremely low precipitation level only explains high prices in perishable foods. The risk of high prices for perishable foods is significantly higher for low rainfall levels (dry seasons) compared to high rainfall levels (rainy seasons).

Intergovernmental Panel on Climate Change (IPCC) reports that the average air temperature at the end of the 21 st century will increase by 4.0 (\(^{\circ }\)C) from current levels, according to the fossil energy intensive scenario, and as a result, agricultural production will be affected by global warming through changes in yields and market prices9.

Interestingly, Lee10 found that while weather shocks temporarily raise consumer prices, especially for fresh food, their effect on core prices is marginal. Among various types of weather shocks, precipitation has a greater impact on prices compared to temperature, especially during summer. A study11, using dynamic panel estimation across 34 OECD economies from 1985-2010, reveals precipitation has significant nonlinear effects on food CPI inflation. Both very low and very high precipitation levels increase food CPI inflation. Interestingly, temperature shows no additional explanatory power for food CPI inflation beyond what precipitation explains.

On the contrary, Chowdhury et al.12 found from the NARDL evidence and time frequency wavelet approaches that the relationship between energy and food prices is characterized by its nonlinear and asymmetric nature. In the long term, both increases and decreases in energy prices influence food prices. Notably, an escalation in energy prices exerts a more significant and enduring impact on food prices compared to a reduction. Furthermore, energy prices serve as a leading indicator for wheat and corn prices, preceding their movements by a substantial 16 months.

A study specifically examined the impact of temperature variations on rice productivity, the most common staple food in Bangladesh, using parametric and nonparametric methods: K-means clustering, wavelet coherence analysis, and regression analysis. It reveals that temperature variability has a significant impact on rice production across seasons and regions, directly affecting the supply and potentially the price of rice13Alam et al.14 analyzed long-term climate trends and their implications for rice yield, concluding that climate variability accounts for a substantial portion of crop yield variability, with maximum temperature and rainfall having a significant impact on rice yields by using linear regression model. Using the dynamic computable general equilibrium (CGE) model a study15 examined the effects of climate change by taking into account the changes in temperature and precipitation over time and found that the impacts of climate change on rice sectors were intense, increasing prices by 5.82% and 8.11%, reducing output by −3.08% and −3.7% collectively in 2030 and 2050 in Bangladesh.

The availability and affordability of various forms of energy play a vital role in determining the general price level of food in Bangladesh, both in the short and long term. Oil prices significantly impact food costs, with agricultural food prices rising in response to any oil price shock. In fact, oil price fluctuations account for 64.17% of the variation in food prices16. This strong link means that oil price inflation not only jeopardizes energy security but also poses a threat to food security, highlighting the critical need to diversify energy sources within the agricultural sector of South Asian economies including Bangladesh. Alauddin et al.17 employed the NARDL model and it revealed that the change in oil prices asymmetrically impacts food price inflation only in the short run. A policy brief18 highlights that increases in international petrol prices often lead to upward adjustments in domestic fuel costs, with diesel’s volatility having a major impact on both food and non-food inflation in Bangladesh. The rise in diesel prices, following the Russia-Ukraine War, notably increased consumer spending by an estimated 13.19% on non-food items and 17.4% on food items. While long-term impacts are less clear-cut, the initial fuel price increases tend to persist over time.

Research objectives

Accurate food price index forecasting is critical for various stakeholders, including food producers, consumers, and policymakers, enabling informed decision-making, risk management, and optimal resource allocation. Food price indices are inherently complex, exhibiting non-linear relationships, volatility, and strong temporal dependencies influenced by a multitude of factors such as supply-demand dynamics, geopolitical events, weather conditions, and economic indicators. Traditional linear forecasting models often fall short in capturing these intricate patterns. Despite numerous investigations of the impacts of miscellaneous factors on food prices or food inflation, these have been studied in the past; predictive analysis of food prices at the domestic level using machine learning methods combining both climate and energy indicators is still scarce.

The primary objectives of this study are:

  • To explore the factors behind the general food price level by utilizing multiple machine learning and time series predictive models.

  • To understand the forces/features impacting the historical changes in food price inflation in Bangladesh using XAI (SHAP) for better policy interventions.

  • To establish a comparative analysis among the best-performing models with a view to finding the ideal model and providing suggestions for superior forecast accuracy.

  • To demystify the delayed effects on current data, incorporate established knowledge from agricultural and non-agricultural markets, the duality of energy costs, and weather shocks to strengthen the bridge between policy implications and interventions in economic literature.

This paper emphasizes a Time-Delay Artificial Neural Network (TDANN) model19,20 specifically a Nonlinear Autoregressive with Exogenous Inputs (NARX)-like architecture, and a deep learning model, Long Short-Term Memory (LSTM) networks21, to address the challenges of food price index prediction by leveraging their capacity for nonlinear mapping and sequential data processing. Additionally, another standard ML model, Prophet, has been developed, utilizing the same data to compare its performance with that of the TDANN models.

Hypotheses for the study

In a recent study by Rana22, it was found that rising climate risks have become the biggest obstacle to attaining the Sustainable Development Goals (SDGs) in South Asia. Risks related to extreme heat, water scarcity, and urban heat islands disrupt critical systems, such as agriculture, energy, and public health, which are essential for maintaining the food production and supply chain. The study also suggests that taking adaptive measures to mitigate the impacts of extreme heat is paramount. Erratic land surface temperature and heating degrees can both positively and negatively impact the state of food security and sustainable agriculture, which is associated with the second goal (Zero Hunger) of the SDGs23. A recent paper also highlights the importance of renewable energy consumption for environmental management and sustainability24. The studies aided in having confidence in variable selection for sharpening the research focus and policy implications.

Previous literature has provided strong justification for taking a nonlinear machine learning approach to model the chosen variables of this study and dissect the ambiguous effects of lags among the internal variables to explain temporal dependencies. In recent studies, Machine Learning (ML) techniques have been producing promising results in modeling time series data, specifically in forecasting food prices, outperforming traditional models25,26. The diverse modeling suite allows for comprehensive prediction and factor exploration, establishing robust benchmarks for forecasting accuracy.

Bangladesh’s persistent struggle for food self-sufficiency, highlighted by its placement on the World Bank’s Red List for consecutive years due to food inflation exceeding 10%, underscores a severe, multifaceted crisis. This escalating cost, driven by structural, local, and global forces, is severely impacting low-income households and hindering national economic progress. While extensive research exists on food inflation, a significant gap remains in studies that provide comparative analyses and link key external drivers directly to domestic policy levers. To address this, this study proposes a new, data-driven investigation. First, a domestic-level Bangladesh model is sought that uniquely combines the effects of climate variables (capturing weather shocks) and the Energy Price Index (representing input cost volatility) on the Food Price Index. Second, the research offers a rigorous comparative analysis of four advanced forecasting models, all evaluated on the same monthly data spanning July 2010 to March 2025, that present elements to clarify the temporal effects. Finally, and most critically, the core contribution lies in the application of Explainable AI (XAI), specifically SHAP (SHapley Additive exPlanations), to decode the models. This analysis moves beyond raw prediction by providing actionable, quantitative insights into which forces (features) historically impact food price inflation, directly supporting better, evidence-based policy interventions. The research culminates in a comparative analysis to isolate the ideal predictive model, providing concrete suggestions for achieving superior and reliable forecast accuracy in the long term.

So, this paper aims to hypothesize whether the non-linear research approach using machine learning models produces better results than the traditional linear approach in detecting the volatile movements of food inflation. The author will also inspect whether the comparative analysis among the proposed models yields similar results or not. Additionally, this study seeks to identify which models better explain the underlying dynamics of the food industry by delving deep into the impacts of agricultural, non-agricultural, and climate risk features or factors.

Fig. 1
figure 1

Key features and distributions of the timeseries dataset (July 2010 - March 2025) | Source: World Development Indicators − DataBank, Our World in Data, and Copernicus Climate Data Store [2025].

Fig. 2
figure 2

Pearson correlation matrix of original 5 features from the final dataset.

Fig. 3
figure 3

Histograms of the timeseries inputs and output with density curves.

Fig. 4
figure 4

Illustration of the normalized time series along with its corresponding lagged features. Subfigures (a) and (b) highlight distinct characteristics of the data from two analytical perspectives: the temporal correlation structure and the representation of the selected lagged features used in the models.

Fig. 5
figure 5

Visualization of SARIMAX model performance: (a) ACF and PACF Plots, (b) Time series forecast with confidence intervals and (c) corresponding residual analysis.

Fig. 6
figure 6

Neural network architecture with 8 nodes in the hidden layer.

Fig. 7
figure 7

Neural network architecture with 6 nodes in the first hidden layer and 4 nodes in the second hidden layer.

Fig. 8
figure 8

Neural network architecture with 6 nodes in the hidden layer.

Fig. 9
figure 9

Neural network architecture with 8 nodes in the first hidden layer and 14 nodes in the second hidden layer.

Fig. 10
figure 10

Density plot manifesting the distribution of trained weights for various neural network models. This visualization provides insight into how architecture choices influence weight value ranges, which is a critical factor in model regularization.

Table 1 Data description with source.
Table 2 Descriptive statistics.
Table 3 Sensitivity analysis of input lag lengths on TDANN prediction performance. The table reports RMSE and \(R^{2}\) for ANN models with varying hidden-layer structures and input lags.

Methods

Data sources and preprocessing

For statistical analyses and modeling of the neural networks, five time series variables are selected based on previous literature, in line with the research objectives. Among these variables, three are weather factors representing climate indicators termed as temperature anomalies by month, monthly average surface temperatures, and monthly precipitation. To account for the price volatility of electricity, natural gas, coal, fuel, and miscellaneous liquid resources, the energy price index is considered a quintessential input factor, while the food price index is the output of the neural network models (Table 1). As the focus is on building predictive models on the price level of food items at the country level, the food price index is regarded an ideal indicator rather than considering the consumer price index. Descriptive statistics are shown in Table 2, composed of exploratory data analysis (EDA) elements such as standard deviation, mean, median, range, etc.

All input variables, including output, are collected from highly reliable and authentic secondary sources. Every input and output data are seasonal in nature, spanning from July 2010 to March 2025, having 177 entries in total, and were sourced from World Bank Data Indicators, Our World in Data repositories and Copernicus Climate Data Store (CDS). The final data set for modeling and evaluation was created by cleanly merging and labeling them for convenience (Fig. 1).

Then, a correlation analysis is performed to see the underlying linear relationships among the multiple variables within a dataset. The correlation coefficient shows the strength of the linear association between two variables. In this preprocessing stage, the correlation matrix is visualized with the cor and corrplot functions of R, with the range between +1 and −131. Any score nearing +1 means a positive linear relationship, and any score nearing −1 means a negative linear relationship (Fig. 2). Although multicollinearity is not an issue for the robustness and overparameterization of the ANN models, correlation analysis is valuable for a complete EDA picture. Histograms with density curves showed that variables were not normally distributed (Fig. 3).

However, further processing was necessary. Min-max normalization, also known as scaling to a range, a data preprocessing technique, was used to transform the variables to a specific range, typically between 0 and 1. The preProcess function within the caret package was employed32. It’s one of the simplest and most common ways to normalize data. Many machine learning algorithms, like neural networks, are sensitive to the scale of input features. If the ranges of features differ significantly from each other, the algorithm might give more weight to features with a greater spread, leading to biased results or slower convergence. Normalization ensures that all the features are leveled to the same range and can contribute fairly.

The entire data analysis process, from data pre-processing to model evaluation, including feature importance, is carried out using the statistical software R, version 4.4.333 and Python, version 3.13.5.

Fig. 11
figure 11

The fit and predictive performance of the ANN [8] with the normalized Food Price Index data, illustrating the model’s accuracy on unseen future price trends.

Fig. 12
figure 12

The fit and predictive performance of the ANN [6, 4] with the normalized Food Price Index data, illustrating the model’s accuracy on unseen future price trends.

Fig. 13
figure 13

The fit and predictive performance of the ANN [6] with the normalized Food Price Index data, illustrating the model’s accuracy on unseen future price trends.

Fig. 14
figure 14

The fit and predictive performance of the ANN [8, 14] with the normalized Food Price Index data, illustrating the model’s accuracy on unseen future price trends.

Fig. 15
figure 15

The plot presents a comparative analysis of the TDANN models, showing that model ANN [6] achieved the highest accuracy, outperforming all other models.

Fig. 16
figure 16

SHAP summary plot ranks features by importance, showing their contribution to the model’s predictions. The magnitude and color of the SHAP values indicate the strength and direction of a feature’s impact.

SARIMAX: a baseline framework

The Seasonal Autoregressive Integrated Moving Average with Exogenous Regressors (SARIMAX) model is a powerful time series forecasting technique that significantly extends the basic ARIMA model’s capabilities. It’s formally denoted as \(\text {SARIMAX}(p, d, q)(P, D, Q)_m\), where the non-seasonal components (p, d, q) handle the Autoregressive, Differencing (Integration order d for non-stationarity), and Moving Average aspects, respectively. Simultaneously, the dedicated Seasonal structure (P, D, Q) captures cyclical patterns over a cycle length m, addressing Seasonal Autoregressive, Seasonal Differencing, and Seasonal Moving Average components. Crucially, the model’s inclusion of exogenous regressors allows it to incorporate and quantify the influence of other independent variables on the forecast, providing a comprehensive framework for complex time series analysis34.

The general form of the \(\text {SARIMAX}(p, d, q)(P, D, Q)_m\) model is:

$$\begin{aligned} \Phi _P(B^m) \phi _p(B) (1-B)^d (1-B^m)^D y_t = \Theta _Q(B^m) \theta _q(B) \epsilon _t + \sum _{i=1}^k \beta _i x_{i,t} \end{aligned}$$
(1)

Where:

  • \(\phi _p(B)\) and \(\Phi _P(B^m)\) are the non-seasonal and seasonal AR polynomials.

  • \(\theta _q(B)\) and \(\Theta _Q(B^m)\) are the non-seasonal and seasonal MA polynomials.

  • \((1-B)^d\) and \((1-B^m)^D\) apply the non-seasonal and seasonal differencing to make the series stationary.

  • \(\epsilon _t\) is the white noise error term (residuals).

  • \(\sum _{i=1}^k \beta _i x_{i,t}\) is the linear combination of k exogenous regressors \(x_{i,t}\) with corresponding coefficients \(\beta _i\).

Artificial Neural Network (ANN)

An Artificial Neural Network (ANN) model draws its fundamental inspiration from the biological neural networks of the human brain. The core idea is to create a computational system that learns and processes information in a manner analogous to how a real human brain operates by learning from neural synapses. The historical concept dates back to the 1940 s with prototype models such as the McCulloch-Pitts neuron, pioneering the groundwork of neural network models popular in academic research and science35. The Perceptron in the late 1950 s was a significant step that could learn simple patterns, but the real revolutionary invention emerged with the development of the backpropagation algorithm in the 1980 s, as it introduced the method of training multi-layered networks to achieve precision in computational accuracy. At the core of any ANN, the blueprint is derived as the interconnected nodes segmented into different layers, receive information as input, and produce output as final results.

ANN models are potent tools to explore pattern recognition, classification, and regression analysis, adept at building complex and especially non-linear relationships within data of any category. In general, an ANN comprises three major layers of neurons, or more technically, nodes. Primarily, nodes are placed in three main layers: input, hidden, and output functions, with associated weights by the optimization phase of the modeling. This study used the Resilient Backpropagation (RPROP) algorithm36, which is generally faster and more robust than traditional backpropagation because it uses only the sign of the gradient to determine the weight update, rather than the magnitude. This makes it less sensitive to the learning rate hyperparameter and helps avoid issues like slow convergence or getting stuck in local minima37. Neurons work by computing a weighted sum of their inputs, adding a bias term for each layer, and passing through an activation function. Mathematically, the output \(y_j\) of a neuron j can be expressed as:

$$\begin{aligned} y_j = \alpha \left( \sum _{i=1}^{n} w_{ji} x_i + b_j\right) \end{aligned}$$
(2)

where \(x_i\) are the inputs from the previous layer, \(w_{ji}\) are the weights connecting input i to neuron j, \(b_j\) is the bias for neuron j, and \(\alpha (\cdot )\) is the activation function38.

Table 4 Results of 40 Combinations of Hyperparameters from Grid Search with Expanding Window Cross-Validation.
Table 5 Neural network hyperparameter optimization.
Table 6 Global feature importance with marginal impact.
Table 7 Prophet parameter configuration.

Time-delay architecture for time series forecasting

Feature selection

The selection of appropriate lag values is susceptible to the model fit and the model’s overall performance. Consequently, the number of lags in the input data determines the total number of input features for an ML model like TDANN. Using fewer lags reduces the number of parameters the model has to learn. This strategy makes it less prone to overfitting, where the model learns noise or specific patterns from the training data that don’t generalize to new data.

In Fig. 4a, the cross-correlation analysis examined temporal dependencies between the Food Price Index and its predictors. The Food Price Index showed strong autocorrelation at lag 3, supporting its inclusion as a lagged input. Monthly Average Surface Temperatures (\(^{\circ }\)C) did not exhibit statistically significant cross-correlations, suggesting limited direct short-term influence. The Energy Price Index displayed strong correlations at lags 0, 1, 2 and 3, reflecting both current and immediate past effects. Temperature Anomalies by Month (\(^{\circ }\)C) showed moderate correlation at lags 0, 1, 2, 3 and 4, while Monthly Precipitation was negatively correlated at lags 1 and 2, suggesting that reduced recent precipitation is associated with higher food prices. Overall, these results support the inclusion of all predictors and the Food Price Index at lag 3 for modeling. The inclusion of 3-month lagged predictors was designed to capture the economic persistence of the Food Price Index, ensuring the model internalizes the autoregressive properties of the series similar to classical econometric frameworks.

Table 8 LSTM hyperparameter optimization.
Table 9 Evaluation metrics for the proposed models.
Table 10 SARIMAX predictions on test data with 95% confidence bounds.

To validate the selection of the temporal lag, a comprehensive sensitivity analysis was performed by testing lags of 1, 3, 6, 12, and 18 months across multiple neural network architectures (Table 3). While the results indicate that a 1-month lag may produce low training errors in some instances, this configuration was intentionally excluded to mitigate the risk of overfitting and to ensure the models capture meaningful temporal dependencies rather than short-term noise. Consequently, the analysis demonstrates that the 3-month lag provides the most robust predictive precision, specifically within the NN [8] and NN [6] architectures, yielding the lower verified Root Mean Square Error (RMSE) and strong coefficient of determination (\(R^2\)). Error rates (RMSE) significantly increase as the horizon extends to 6, 12, or 18 months, reaching a peak error of 17.138. These findings confirm that a 3-month lag provides the optimal balance for capturing the delayed impacts of climate shocks and energy price volatility on food inflation in Bangladesh.

Fig. 17
figure 17

The plot ranks features by their global importance based on their absolute SHAP values, showing how each feature contributes to the model’s predictions where a higher value indicates a stronger impact.

Fig. 18
figure 18

Overall visualization of SHAP analysis, featuring (a) Dependence Chart positioned above (b) and (c) two different Interaction Plots.

Fig. 19
figure 19

Prophet forecast in blue with the upper and lower \(\hat{y}\) values over time (ds). The black points are observed data and the transparent blue area around the prediction line on the plot represents the 80% confidence interval.

Fig. 20
figure 20

The decomposed components of Food Price Index time series: the trend, the holidays, the yearly, and the extra_regressors_additive.

Fig. 21
figure 21

Model performance visualization showing (a) bootstrap-based prediction intervals for the ANN [6] model and (b) comparative accuracy of ANN [6] and Prophet against the denormalized Food Price Index (FPI).

Fig. 22
figure 22

Training loss curve for the LSTM model showing convergence behavior over 50 epochs. The loss (MSE) consistently decreases and stabilizes after approximately 10 epochs, indicating successful optimization. No separate validation curve is shown since the model was trained solely on the training dataset, with final performance evaluated on the test set.

Fig. 23
figure 23

Food Price Index Forecast (July 2022 – March 2025). A comparison of actual Index values against predictions generated by an LSTM neural network (purple dashed line). The shaded region represents the prediction uncertainty band.

The study employed a mixed lag structure: some variables were included at the current time point (t), and others, including the Food Price Index, were incorporated with a time lag of three months (\(t-3\)). This approach serves as a form of feature engineering, creating new features from the existing raw data formats. Most recent information not only keeps the model simple by avoiding overfitting but also enhances computational efficiency by training the model faster than a model with a higher lag. Results from this study demonstrate that a lag of 3 holds sufficient predictive power, enabling strong performance without the need for a more complex model.

Data normalization

ANN is highly sensitive to the scale or range of input data, as extremely scattered or volatile data can dominate the learning process, leading to slower convergence. That is why it is best practice to scale or normalize the data of each variable within a range during the preprocessing stage. Using min-max scaling, the study can ensure that all features contribute proportionally to the network’s learning process and help in stabilizing the training.

$$\begin{aligned} x_{\text {normalized}} = \frac{x - x_{\text {min}}}{x_{\text {max}}- x_{\text {min}}} \end{aligned}$$
(3)

where x is the original value, \(x_{\text {min}}\) is the minimum value of the feature, and \(x_{\text {max}}\) is the maximum value of the feature39.

The data set with the lagged features was scaled within 0 and 1, using the preprocess function of the caret package with the range method and the normalized data was made ready for modeling (Fig. 4b).

Table 11 TDANN-based point predictions of food price index.
Table 12 Prophet forecast values with prediction intervals.
Table 13 LSTM output: point predictions and 95% confidence intervals.

For time series forecasting, the inherent temporal dependencies of the data must be explicitly captured. The major drawback of a general ANN is that it cannot process the intrinsic temporal dependencies of the time series data. Regardless of the number of layers or inputs, ANN takes the data of features as each datapoint is independent of time. Hence, A Time-Delay ANN (often conceptualized as a NAR(X) network) is ideally suited for this purpose20. This architecture incorporates past observations of the target variable and potentially other relevant exogenous variables as inputs to predict future values.

The “Time-Delay” aspect refers to the inclusion of historical data points as features. It is a popular method of feature engineering, the creation of new features out of existing variables, widely used in machine learning practice and other scientific research domains.

For instance, to predict the food price index at time t, the model considers prices at \(t-1, t-2, \ldots , t-k\), where k/m represents the number of time lags, allowing the network to learn how past price movements influence future ones. The general form of such a model can be represented as:

$$\begin{aligned} Y_t = f(Y_{t-1}, Y_{t-2}, \ldots , Y_{t-k}, E_{t-1}, E_{t-2}, \ldots , E_{t-m}) \end{aligned}$$
(4)

where \(Y_t\) is the food price index at time t, \(Y_{t-i}\) are past output values, \(E_{t-j}\) are past values of exogenous variables, and \(f(\cdot )\) is the non-linear mapping function learned by the ANN. The mathematical equation can be rewritten incorporating the selected target output and the exogenous inputs along with their lagged components for this study.

$$\begin{aligned} \begin{aligned} FPI_t = f(FPI_{t-3}, MAST_t, EPI_t, TAM_t, MP_t, MAST_{t-3}, EPI_{t-3},&\\ TAM_{t-3}, MP_{t-3}) \end{aligned} \end{aligned}$$
(5)

Here is a breakdown of the variables used in the equation:

  • \(FPI_t\): Predicted Food Price Index at the current time (t).

  • \(FPI_{t-3}\): Food Price Index from three time periods earlier (\(t-3\)).

  • \(MAST_t\): Monthly Average Surface Temperatures at time t.

  • \(EPI_t\): Energy Price Index at time t.

  • \(TAM_t\): Temperature Anomalies by Month at time t.

  • \(MP_t\): Monthly Precipitation at time t.

  • \(MAST_{t-3}\): Monthly Average Surface Temperatures from three time periods earlier (\(t-3\)).

  • \(EPI_{t-3}\): Energy Price Index from three time periods earlier (\(t-3\)).

  • \(TAM_{t-3}\): Temperature Anomalies by Month from three time periods earlier (\(t-3\)).

  • \(MP_{t-3}\): Monthly Precipitation from three time periods earlier (\(t-3\)).

In this equation, f represents the non-linear function computed by the ANN, which takes the set of nine input variables to predict the output variable, \(FPI_t\). This structure enables the model to capture autocorrelation and other dynamic relationships within the target series.

Activation function

Hidden layers: logistic (sigmoid) activation

Next, the choice of activation function is critical for introducing non-linearity and determining the output range of neurons. Among the conventional activation functions for ANN, this study employed the sigmoid function40,41, which can be defined as:

$$\begin{aligned} S(x) = \frac{1}{1 + e^{-x}} \end{aligned}$$
(6)

S(x) represents the output of the sigmoid function, which always falls between 0 and 1. It’s commonly used to map any real-valued number into a value that can be interpreted as a probability while x is the input variable to the function. It can be any real number from \(-\infty\) to \(+\infty\) and e is Euler’s number, an irrational and transcendental number that serves as the base of the natural logarithm. Its approximate value is 2.71828. The output of the sigmoid function is bounded between 0 and 1. This characteristic is beneficial for hidden layers as it helps to compress the input values into a small, manageable range, preventing the vanishing gradient problem to some extent in earlier layers and allowing the network to learn complex, non-linear relationships.

Table 14 ANN [6] Forecast Points with Bootstrap Prediction Intervals.

Output layer: linear activation

Though the sigmoid function is fine for the hidden layer, it is not appropriate for the output layer. The prediction values of the output layer will be constrained within bounded scores, like the normalized data, and as a result, the model might fail to accurately predict the scores, limiting the forecast ability of the model even after denormalization. A linear activation function is used for the output layer. A linear activation function simply passes the weighted sum of inputs directly as the output:

$$\begin{aligned} l(x) = x \end{aligned}$$
(7)

After combining the inputs with the initial normalized data, the linear output layer produces prediction values in the 0–1 range, which later can be turned back to its original scale for practical interpretation.

Prophet

Facebook’s core Data Science team developed the Prophet model, a highly intuitive time series analysis model for forecasting. It is a fruitful model for time series data exhibiting strong seasonal effects (like daily, weekly, or yearly patterns) and has historical data with missing values or outliers. The model’s customizable nature makes it convenient for analysts without deep expertise in time series forecasting. A decomposable time series model forms the footing of the Prophet model, comprising three main components: trend, seasonality, and holidays. Prophet follows a simple additive regression approach to model these components42.

The trend component measures non-periodic changes in the time series, and Prophet has two types of trend models: linear and logistic. The trend follows as a piecewise linear or logistic function, capturing abrupt changes in the growth rate known as changepoints, which can be manually specified. The Prophet model is well suited to capture the complexity of yearly, monthly, and daily seasonality in food prices, as price fluctuations in Bangladesh are directly linked to crop cycles, harvesting methods, and festivals. Prophet utilizes the Fourier series to model the seasonality of time series by smoothing the seasonal curve, letting the model grasp complex seasonal patterns without having to set any functions or hold assumptions.

The holiday component of the model captures the irregularities in time as a separate one-time shock apart from fixed seasonal intervals. The general level of food price is moderately sensitive to holidays in Bangladesh, as the supply and demand of food items changes according to public consumption. For example, during Eid every year, the demand for meat and chicken soars higher than at any other time of the year, or the price of sweets gets higher around Independence Day or Victory Day for celebration. For each holiday in the data, a dummy variable is devised, which inserts 1 for the holiday and 0 otherwise.

The full model for forecasting the Food Price Index, based on the Prophet framework43,44, can be expressed as:

$$\begin{aligned} FPI(t) = g(t) + s(t) + h(t) + \sum _{i=1}^{n} \beta _i x_i(t) + \epsilon _t \end{aligned}$$
(8)

The equation can be rewritten as:

$$\begin{aligned} \begin{aligned} FPI_t = g(t) + s(t) + h(t)&+ \beta _1 EPI_t + \beta _2 TAM_t + \beta _3 MP_t + \epsilon _t \end{aligned} \end{aligned}$$
(9)

where

  • \(FPI_t\): The target output, the Food Price Index at time t.

  • g(t): The linear trend of the series.

  • s(t): The seasonal effects, such as monthly or yearly patterns.

  • h(t): The component for the impact of predefined holidays or events.

  • \(\beta _1, \beta _2, \beta _3\): The coefficients for the external regressors at time t.

  • \(EPI_t, TAM_t, MP_t\): The external regressor variables included at time t.

  • \(\epsilon _t\): The error term of the model.

This paper incorporated external regressors for a robust Prophet model in order to conduct a rigorous predictive analysis of the food price index. The external regressors represent the linear influence of external events. In Fig. 2, the Pearson Correlation Matrix confirmed a strong multicollinearity between the lagged values of two external regressors: monthly average surface temperatures and monthly precipitation (r=0.74). Both variables were sharing the same predictive power. The one with the lower correlation with FPI (r=0.01) was dropped from the model to remove redundancy. The MAST at lag 3 did not provide any new information to the Prophet model.

LSTM theoretical framework

The Long Short-Term Memory (LSTM) network, a specialized form of Recurrent Neural Network, serves as a powerful non-linear alternative to TDANN for modeling complex multivariate time series45. This model can automatically learn features such as trends and seasonality in time series data without the need for manual differencing or seasonal decomposition. To leverage the available variables: the target \(\text {FPI}_t\) (Food Price Index) and the four exogenous variables (\(\text {MAST}\), \(\text {EPI}\), \(\text {TAM}\), and \(\text {MP}\)), the model is configured as an \(\text {LSTMX}\) (LSTM with Exogenous Regressors). Data preprocessing requires transforming the time series into overlapping sequences of fixed length (the lookback window), resulting in a feature matrix where each input vector \(\textbf{x}_t\) contains all five variables.

Core LSTM gates and state update

The core LSTM cell dynamically regulates information flow using three gates (\(\sigma\) is the sigmoid activation function and \(\tanh\) is the hyperbolic tangent). The Forget Gate (\(f_t\)) decides what to discard from the previous Cell State (\(C_{t-1}\)), while the Input Gate (\(i_t\)) and Candidate Cell Value (\(\tilde{C}_t\)) decide what new information to store45,46.

$$\begin{aligned} f_t= & \sigma (W_f \cdot [\textbf{h}_{t-1}, \textbf{x}_t] + b_f) \end{aligned}$$
(10)
$$\begin{aligned} i_t= & \sigma (W_i \cdot [\textbf{h}_{t-1}, \textbf{x}_t] + b_i) \end{aligned}$$
(11)
$$\begin{aligned} \tilde{C}_t= & \tanh (W_C \cdot [\textbf{h}_{t-1}, \textbf{x}_t] + b_C) \end{aligned}$$
(12)

The Cell State (\(C_t\)), or long-term memory, is then updated:

$$\begin{aligned} C_t = f_t \odot C_{t-1} + i_t \odot \tilde{C}_t \end{aligned}$$
(13)

Finally, the Output Gate (\(o_t\)) determines what information from the cell state is exposed as the Hidden State (\(\textbf{h}_t\)), which is used for the prediction layer.

$$\begin{aligned} o_t= & \sigma (W_o \cdot [\textbf{h}_{t-1}, \textbf{x}_t] + b_o) \end{aligned}$$
(14)
$$\begin{aligned} \textbf{h}_t= & o_t \odot \tanh (C_t) \end{aligned}$$
(15)

Forecasting the food price index

The LSTM learns a complex non-linear function G that maps the sequence of inputs to the future Food Price Index \(\hat{FPI}_{t+\Delta t}\):

$$\begin{aligned} \hat{FPI}_{t+\Delta t} = G(\underbrace{FPI_{t-L}, \dots , FPI_{t}}_{\text {Lagged Target}}, \underbrace{\textbf{x}_{t-L}, \dots , \textbf{x}_{t+\Delta t}}_{\text {Multivariate Features}}) \end{aligned}$$
(16)

The input vector \(\textbf{x}_t\) at each time step t combines the features:

$$\begin{aligned} \textbf{x}_t = [FPI_t, \text {MAST}_t, \text {EPI}_t, \text {TAM}_t, \text {MP}_t] \end{aligned}$$
(17)

By training on these multivariate input sequences, the LSTM learns a complex function that maps the historical co-evolution of the variables to the future \(\hat{FPI}_{t+\Delta t}\), providing a flexible and robust framework for forecasting under the influence of both temporal and external factors.

Evaluation metrics

The performances of all the ANN models and the Prophet are evaluated using multiple statistical techniques: Root Mean Square Error (RMSE), R-squared (\(R^2\)), and Mean Absolute Error (MAE).

Root Mean Square Error (RMSE)

RMSE is a measure of the average magnitude of the errors between predicted values and actual values. Because the errors are squared before being averaged, RMSE gives a higher weight to large errors, making it useful when significant errors are particularly undesirable. It is expressed in the same units as the dependent variable, which makes it easy to interpret.

The formula for RMSE is:

$$\begin{aligned} RMSE = \sqrt{\frac{1}{n}\sum _{i=1}^{n}(y_{i} - \hat{y}_{i})^{2}} \end{aligned}$$
(18)

In this formula, n is the number of data points, \(y_i\) is the actual value, and \(\hat{y}_i\) is the predicted value.

R-squared (\(R^2\))

R-squared, or the coefficient of determination, is a statistical measure that represents the proportion of the variance in the dependent variable that is predictable from the independent variable(s) in a regression model. Provides an indication of how well the model fits the observed data, with values ranging from 0 to 1. A higher value (closer to 1) means that the model predictions more accurately explain the observed data.

The formula for R-squared is:

$$\begin{aligned} R^{2} = 1 - \frac{\sum _{i=1}^{n}(y_{i} - \hat{y}_{i})^{2}}{\sum _{i=1}^{n}(y_{i} - \bar{y})^{2}} \end{aligned}$$
(19)

Here, \(y_i\) is the actual value, \(\hat{y}_i\) is the predicted value, \(\bar{y}\) is the mean of the actual values, and n is the number of data points.

Mean Absolute Error (MAE)

MAE measures the average magnitude of the errors in a set of predictions, without considering their direction. It is the average of the absolute differences between the predicted and actual values. Unlike RMSE, MAE gives all errors equal weight, making it less sensitive to outliers. It is often preferred for its straightforward interpretability and robustness to extreme values.

The formula for MAE is:

$$\begin{aligned} MAE = \frac{1}{n}\sum _{i=1}^{n}\left| y_{i} - \hat{y}_{i} \right| \end{aligned}$$
(20)

In this formula, n is the number of data points, \(y_i\) is the actual value, and \(\hat{y}_i\) is the predicted value.

Results

SARIMAX

This specific SARIMAX model was built in R using the Arima function, with the orders for both seasonal and non-seasonal lags automatically determined by the auto.arima function. However, the order of the seasonal MA was manually set to improve the model as the AIC values were not good determinants of a good fit. The author ultimately selected the final model’s orders (0, 0, 2) and seasonal orders (0, 0, 3) based on further analysis, such as ACF/PACF inspection and domain expertise (Fig. 5a), and then used this specific model to generate the forecast set on the future test data. The selected model is the best alternative among multiple architectures with different parameters.

In Fig. 5b, actual values (Food Price Index) are shown by a solid black line, demonstrating an overall upward trend over the period shown, peaking near the end of the data. Predicted values are represented by a dashed blue line, which generally follows the trend of the actual data but with less volatility. A shaded light blue area surrounding the predicted line represents the confidence interval (95%), showing the range of uncertainty for the SARIMAX forecast. The plot covers a period from April, 2022 to March, 2025. Visually, the SARIMAX model captures the general direction, but the actual Food Price Index experienced higher peaks and troughs than predicted, especially in the later part of the test set where the actual line moves outside the shaded confidence band.

The accompanying residual diagnostic plots (shown in 5c) for the ARIMA (0,0,2) (0,0,3) [12] model reveal the following: The residuals appear to be relatively centered around zero and show no clear pattern or increasing variance, suggesting the model captures the underlying structure well. However, there are a few significant spikes (around 2016 and 2017). The Autocorrelation Function (ACF) plot shows that several significant spikes remain outside the dashed blue confidence bounds. This indicates that the residuals are autocorrelated, meaning there is still predictable information (pattern) left in the errors that the model failed to capture. The histogram of the residuals shows a distribution that is normal (bell-shaped curve), which is a favorable characteristic. While the model follows the general trend and the residuals are normally distributed, the significant autocorrelation in the residuals (ACF plot) suggests that the chosen SARIMAX (0,0,2) (0,0,3) [12] may not be the optimal fit and could be improved by adjusting the model orders to account for the remaining structure in the errors.

The residual patterns are complex or do change over time; this calls for the necessity of trying different model fits to capture the full dynamics of FPI, and a non-linear approach might be suitable for capturing the complex relationships of FPI including external variables.

Modeling the neural networks

The study effectively prevented data leakage through methodical application of two time-series-specific preprocessing techniques: Chronological Splitting and Training-Set-Based Normalization. First, the study generated the final feature set, where predictors were based on the past 3-month lagged values. The study then divided this feature set into training (80%) and testing (20%) subsets strictly based on time sequence. The training data contained observations that occurred entirely before the observations in the test data. This technique prevented look-ahead bias by ensuring the model’s training only utilized historical information relative to the forecast period. The study fit the Min-Max scaler (a transformation process) only on the training data. This involved calculating the minimum and maximum values for each feature solely from the training set. These scaling parameters were then applied consistently to both the training set and the future test set. This prevented test-set contamination, as the scaling of the training data was not influenced by the statistical properties (like the future range) of the test data. By adhering to these steps, the study respected the temporal dependency of the data, ensuring the subsequent model was built on a foundation that accurately simulated real-world forecasting.

A grid search was conducted to find the optimal hyperparameters for the expected neural network (NN) model using expanding window cross-validation (CV). Forty hyperparameter combinations were systematically iterated through R codes. For each combination, R trained and evaluated the TDANN model across five expanding data folds (where the training set grows over time), calculating the Root Mean Squared Error (RMSE) for each fold. Finally, the RMSE across the folds was averaged to assess the model’s performance, and a range of confidence intervals for the mean RMSE of each combination was calculated (Table 4).

The author adhered to applying the parsimony principle by selecting a simpler or more stable model if its performance is statistically equivalent to the one with the lowest error. The study made a trade-off between model performance and model complexity/stability for better forecasting accuracy. The selection criteria for the final modeling were not just based on the minimum average RMSE but also on a more robust, statistically backed approach to prevent overfitting/underfitting and improve real-world forecasting accuracy.

After having the normalized data in training and testing, 80% and 20%, respectively, the study initiated configuring the hyperparameters of the neural networks utilizing R’s neuralnet package37. Four NN architectures are built with distinct key configurations, and each of the neural networks is run through five repetitions, keeping the same activation functions (sigmoid and linear) for both the hidden and the output layers, with the intention of finding the most accurate models with the lowest possible error (Table 5). The formula (‘Food.Price.Index’ \(\tilde{~}\).) tells R to model the Food Price Index as a linear function of all the other external and lagged variables present in the dataset. The threshold parameter of the neuralnet function specifies the stopping criterion of the training algorithm, implying that further training beyond this point would not bring about much improvement. The value 0.01 was set as an adjusted threshold to stop training when the partial derivative of the error function with respect to the weights falls below this point. The lower the threshold, the better the accuracy with more training time. The Lifesign parameter is for monitoring the overall progress to inspect whether the models are converging or having a decreasing error rate. Each of the NNs was designed with different combinations of hidden layers and nodes after iterating through exhaustive hyperparameter tuning or optimization. Finally, the selected architectures: NN [8], NN [6, 4], NN [6], and NN [8, 14], are taken further to fit the training data. Simultaneously, the study has only taken the particular repetition out of 5, revealing lower error with the best fit for each model, and these models are employed to predict the values on the test data. Selected neural network architectures are portrayed in Figs. 6,7,8,9 with the customizable ggplot function of the ggplot2 package in R, an elegant and powerful visualization tool47.

A central tendency of the weight distribution in a neural network is desirable, as it promotes symmetry breaking, prevents vanishing gradients, and is a sign of regularization. A weight distribution centered around zero implies that each neuron starts with a unique set of weights, allowing neurons to learn different features without giving one feature more significance over the other. This is crucial for unbiased influences of features on the output. Initializing weights with a central tendency of zero and a small variance keeps the gradients within a stable range, ensuring that the network can learn effectively. Meanwhile, central tendency also regularizes to restrain large weights to prevent the model from overfitting. The density curves in Fig. 10 demonstrate that the four models have weights centered around zero, insinuating that the proper regularization methods work as intended, leading to a more generalized model that performs well on unseen data. It also serves as a stabilizing mechanism during regime transitions. By preventing explosive gradients, this constraint ensures that the model identifies stable underlying signals rather than overfitting to transient volatility or structural shocks.

For the convenient analysis of the Food Price Index, the final models were designated as follows: ANN [8] (from NN [8] at rep = 2), ANN [6, 4] (from NN [6, 4] at rep = 1), ANN [6] (from NN [6] at rep = 1), and ANN [8, 14] (from NN [8, 14] at rep = 4). In the visual representations of the performances of each model on the observed data, it is seen that out of the four neural networks, ANN [6] is projecting the predictions closest to the unseen test series (Figs. 11,12,13,14,15).

Feature importance

Inspired by the cooperative game theory concept, SHAP (SHapley Additive exPlanations) is a powerful and widely utilized method to explain the intricate predictions of machine learning models based on Shapley values48. The core idea is grasped from game theory to understand the contributions of each feature in predicting the output in a model. In this study, features (e.g., Energy Price Index, Monthly Precipitation) are the players of the normalized dataset. For each specific datapoint, the ANN’s prediction is the game, and the payout is the difference between the model’s prediction and the average prediction across the entire dataset (or a specified baseline). To enunciate it more elaborately, SHAP values are calculated by determining the difference between the predicted values with and without the addition of each feature for all combinations, and taking the average. Thus, it becomes feasible to understand which feature has contributed to what extent or how much in influencing output (prediction) significantly, regardless of whether the influence is positive or negative49,50.

Artificial Neural Networks are often referred to as ”black-box” models due to their architectural mystery: non-linear nature, and weight distribution process, making their predictions problematic to interpret. Trust in black-box model predictions can be built by the explainability provided through SHAP51. SHAP helps to demystify the underlying operations of models by showcasing local and global Interpretability. Every prediction by the model can be explained by the SHAP, which indicates how much each feature contributed to pushing the model’s output from the average baseline to the final predicted value. Simultaneously, by aggregating the SHAP values across the entire dataset of predictions, the holistic picture of the feature importance is obtained.

The author has employed the DALEX (moDel Agnostic Language for Exploration and eXplanation) package, based on Kernel SHAP algorithm, which is designed to be a central toolkit for explaining the behavior of any predictive model, regardless of its underlying algorithm52. DALEX::explain created a model wrapper, which is then passed to predict_parts(type = ”shap”) to compute SHAP values for the features. The study proceeded with the NN [6] as its first repetition generated the best predictions at the lowest error, and calculated SHAP values for test data observations.

A SHAP summary plot (Fig. 16) is created to reveal the individual impact of each feature, colored in accordance with its scaled value and ranked in order of importance, demonstrating the overall behavior of the artificial neural network model. The Global Feature Importance is represented with the bar plot (Fig. 17) depicting the mean absolute SHAP value for each input in the test set. From both of these essential figures, it is crystal clear that the Food Price Index at lag 3, the Monthly Precipitation at lag 3, and Energy Price Index are the greatest contributors with higher scores in predicting the Food Price Index, whereas Monthly Precipitation, Monthly Average Surface Temperatures at lag 3, and Monthly Average Surface Temperatures are moderately strong contributors. Temperature Anomalies by Month is almost insignificant but relevant (Table 6).

From both the SHAP Summary and the Global Feature Importance plots, it is evident that the Food Price Index at lag 3 is the most influential feature, and the Monthly Precipitation at Lag 3 is the second most influential feature in contributing to the prediction of the Food Price Index.

The GFI (Mean Absolute SHAP Value) shows the global view of feature strength regardless of direction. It does not tell whether the Energy Price Index makes food prices go up or down. It just tells us that energy prices move the needle a lot. The SHAP summary plot, in beeswarm style (Fig. 16), is the gold standard for model interpretation since it combines the local details (the relationship and direction) with a global view on a single chart. The FPI_lag3, as the strongest feature, pushes the food price prediction up (higher inflation) where the SHAP value is greater than 0, and vice versa. So, here the relationship is positive. On the contrary, MP_lag3 has a wide spread, which indicates why it is the second strongest, but the colors are mixed, with purple and yellow dots overlapping in the middle and sides. The relationship is nonlinear or complex. It’s not as simple as “More rain = Lower prices.” It might depend on when rain happens or how precipitation mediates other variables.

The study delved deep into understanding the complex relationship between the strongest features of the TDANN. The study analyzes the SHAP Dependence Chart and SHAP Interaction plots and how they interact with each other in the pragmatic forecasting of food inflation.

The dashed line in Fig. 18a, which is increasing at diminishing returns, in the dependence plot shows the average marginal effect of the FPI_lag3 value on the Food Price Index prediction. The dependence plot confirms the price autocorrelation of the Food Price Index; the high FPI_lag3 strongly pushes the price up, while the low FPI_lag3 pulls the prices down. Here, prior monthly precipitation is only significant as a modifier for prior food prices. The effect of MP_lag3 has always been consistent in modifying the increasing prior price impact on future prices, but it does so negligibly.

It testifies in favor of the prior prices’ overwhelmingly dominant effect on the future price, which is obvious since food inflation does not change erratically. Low FPI_lag3 (near 1.0) values result in a strong negative contribution of SHAP (down to −0.2), meaning a low prior FPI pulls the current prediction down. High FPI_lag3 (near 1.7) values result in a strong positive contribution (up to +0.25), meaning a high prior FPI pushes the current prediction up.

In the graph, there are some irregular gaps between the effects of prior monthly precipitation, mostly colored in black and purple. But at a higher prior FPI (after 1.6), some of the effects of MP_lag3 are in orange/yellow, indicating that at very high prior FPI, the prior precipitation is functioning actively beyond just as a modifier.

This intriguing point leads the study to an interaction plot to understand prior precipitation with more scrutiny (Fig. 18b). The average marginal effect of MP_lag3 is represented by a U-shaped dashed line. During expected weather patterns under normal conditions, when the feature value of MP_lag3 is between 0.2 and 0.4, it allows the prior FPI to have its persistence (autocorrelation) dominate without interference. But during extreme weather shocks, when the feature value of the prior MP is very low or very high (below 0.2 or above 0.4), it introduces volatility and uncertainty into the food supply. Blessed with 1,294 rivers, according to the Ministry of Water Resources, Bangladesh is an agriculturally rich economy. Severe floods or rain can hamper the regular supply of agricultural production and destroy valuable harvests. On the contrary, harsh droughts can also stall the normal growth of crops, rice, and vegetables. In mid-year, having a natural state of humidity is crucial, as April-July is the peak season for rice harvesting. A significant lack of water can severely impact the plant at nearly every stage of its life cycle, leading to massive yield reductions.

Such an effect creates challenging circumstances for policymakers to quantify the uncertainty of weather shocks and damage control. These two extreme weather shocks break the regular pattern of the current FPI. The model learns that when the weather is extreme, the FPI history may be a less stable predictor, but in specific regimes (high MP_lag3), that extreme weather starts to contribute a larger positive influence, potentially signaling upcoming supply issues that drive prices up.

In Fig. 18c, the second interaction plot reveals that the predictive importance of the past FPI value (FPI_lag3) is not constant; it is strongly conditional on the current Energy Price Index. As the feature value of the energy price index increases (moving from 1.0 to 1.7), the SHAP value for FPI_lag3 generally increases (moving from −0.2 to 0.2). The relationship is clearly non-linear and exponential. The positive impact accelerates significantly when the Energy Price Index is above 1.4. In simpler terms, FPI_lag3 contributes positively to the prediction when the Energy Price Index is simultaneously high. If the Energy Price Index is high but FPI_lag3 is low (blue points in the right cluster), the positive impact is dampened. The policy implication is that policymakers must focus on keeping current energy costs low to effectively combat future food inflation. The model shows that high past food prices only become a severe inflationary problem if current energy costs are also high, meaning energy acts as an inflation amplifier. If energy costs are low, they act as a price damper, giving businesses less reason to raise prices beyond their operational needs, thus offsetting the memory of high historical food costs. If the costs to run farms, maintain arable lands, and acquire agricultural inputs (gas, coal, fuel), factories, and trucks are low, businesses can’t justify passing on previous high food prices. Low energy acts as a damper on inflation.

Modern agriculture is heavily mechanized, meaning energy prices dictate marginal costs of production for farmers and distributors. High diesel prices increase the cost of running tractors, mixing harvesters, machinery, and irrigation pumps. Some specific food groups require fuel for instant trucking/shipping and electricity for cold storage or refrigeration, for instance, shrimp. High energy prices at the macro level directly cause the operational costs of firms to be high at the micro level. On the other hand, the indirect cost is of equal significance. High energy prices hit the farmers twice. The production of nitrogen-based fertilizers is extremely energy-intensive. When energy prices rise, fertilizer prices almost invariably follow. As a result, the baseline (break-even) price for crops rises before they are even planted. High fuel and fertilizer costs squeeze margins to zero or negative, but low fuel and fertilizer costs create a profit margin buffer.

While the TDANN is stationarity-agnostic, the SHAP analysis confirms that the model’s internal logic respects economic fundamentals. The dominance of lagged FPI values highlights the model’s capture of persistence, while the non-linear interaction effects reflect the model’s ability to navigate shifting economic regimes without the need for manual structural break adjustments.

Forecasting with prophet

In contrast, the Prophet model is built with the prophet function of the prophet package in R53. This function requires that the data be in a dataframe format with two specific columns: one for the time or date and another for the target time series variable. The time object in the dataframe is transformed into the Date class. Similar to neural networks, the same split into a training set and a test set is used to construct the model and validate its prediction accuracy for consistency. A crucial step before modeling is to relabel the date column as ds and the Food Price Index as y because the built-in Prophet algorithm only recognizes the time/date variable as ds and the target variable as y.

The model’s form was fixed by choosing linear growth and explicitly including yearly and monthly seasonality. The parameter tuning focused on prior scales: the seasonality prior scale and changepoint prior scale were both maintained at the default value of 1, indicating a moderate, neutral allowance for the data to define the strength of seasonality and the flexibility of the overall trend. Conversely, the regressor prior scale was strategically increased to 2, signifying a strong weight in the predictive power of the external regressors (energy, temperature, and precipitation). This highly specified model was ultimately selected because it offered the best quantitative performance (lowest RMSE) on the holdout test data, leading to the necessary rejection of alternative specifications, such as the model fit on scaled data, which yielded inferior results. Manually setting the changepoint prior scale and seasonality prior scale helps control the flexibility of the trend and adjust the strength of the seasonality, allowing the model to fit larger seasonal fluctuations smoothly. For the holiday argument, a custom holiday dataset was extracted from Python’s holidays library54, since R does not have holiday data for Bangladesh. The yearly seasonality argument was set to TRUE to explicitly tell the model to account for recurring monthly and yearly patterns. Then, external regressors are added using their exact column names in the Prophet configuration to account for the external influences on the food price index. Table 7 shows model parameters used for tuning to improve the predictive performance. After fitting the model with training data, the Prophet model is used to predict the values of the Food Price Index on unseen data over a time frame spanning April 2022 to March 2025 (Fig. 19).

The prophet_plot_components function visualized the decomposed components of the Food Price Index time series (Fig. 20). The Food Price Index time series shows an upward trend between April 2022 and March 2025, growing moderately in a linear direction. The day of the year curve shows that the Food Price Index time series reached its lowest point between April and June and then gradually rose to a higher peak between July and October. The spikes in the holiday curve at one-year intervals identified recurring events that cause a predictable and significant change in the data. Hence, the model has successfully quantified the positive impact of annual holidays in predicting FPI, a critical part of a well-performing Prophet model. Also, the model has captured the effects of the additive extra regressors provided, improving prediction accuracy by stabilizing the impact on the time series, regardless of the trend’s magnitude.

The upward trend of the Prophet forecasts aligns well with the economic reality of Bangladesh, capturing the observed trend of the Food Price Index. Major structural drivers contribute to this steady rise in food inflation. The positive spikes in the holiday component are dominated by major festivals such as Eid ul-Fitr (End of Ramadan) and Eid ul-Azha (Festival of Sacrifice). Major premium goods such as beef, chicken, milk, sugar, and vermicelli (for shemai) may experience a massive surge in price due to the heightened demand during and before both of these festivals. Specifically, Eid-ul-Adha creates massive demand and price spikes for livestock (cattle, goats, and oxen). High consumer demand, coupled with temporary supply chain disruptions as many workers and professionals return home for the holidays, creates inflationary bottlenecks for the festive foods. The yearly seasonality component represents the fluctuations in prices resulting from agricultural cycles and climate conditions during the summer and rainy seasons. April to June is the peak harvesting season of the year for major staple crops: rice Boro, lentils, wheat, and mazie55. The prices fall to their lowest (seasonality score below −50) because fresh supply saturates the market, easing market pressure by meeting consumer demand sufficiently. On the contrary, heavy rainfall and monsoon flooding (typically June to August) disrupt vegetable production (including onion and potato) and transportation, leading to a shortage and price hike, which explains why the curve rises after June.

The extra regressors’ additive component conveys the key findings about the non-seasonal aspects of the energy prices, precipitation, and temperature anomalies data in the model. The external shocks represented by the upward slope from these combined factors suggest that cost-push inflation is a major driver of the FPI forecast. Bangladesh, being a major importer of energy resources, has recently experienced the highly volatile global prices of oil and fuel that are pressuring the rising expense of domestic production and transportation costs for food, contributing to the FPI directly. The weather variables (temperature anomalies by month and monthly precipitation) are proxies for climate risks and supply shocks. Abnormally dry seasons can hurt the Boro and Aman production, while excessive rainfall or floods can severely damage the expected arable land, leading to the destruction of crops. It can occur in the short term, but a massive surge in FPI spikes for the specific groups. The findings of extra regressors align with the insights of SHAP interaction analysis in the feature importance section of TDANN. A visualization displays the ANN [6] model’s performance (Fig. 21a) alongside a direct accuracy comparison between the ANN [6] and Prophet models against the denormalized Food Price Index (Fig. 21b).

Implementation details of the LSTM

Building on robust time-series methodology, the study effectively handled data processing for the LSTM model by strictly adhering to two preprocessing techniques. First, the feature set, structured with a sequence length of 3 time steps (corresponding to 3-month lagged values), was subjected to Chronological Splitting, using a train ratio of 0.8 (80% training, 20% test). This ensured all training observations occurred temporally before all test observations, thus preventing look-ahead bias critical for accurate forecasting simulation. Subsequently, for scaling, the MinMaxScaler with a feature range of (0, 1) was initialized and fitted exclusively to the training data in Python, which calculated the scaling parameters based only on the historical data’s range. These same parameters were then consistently used to transform both the training and test sets, effectively preventing test-set contamination. The resulting scaled features were used to train an LSTM network for 50 Epochs with a Batch Size of 32, predicting Food Price Index (Table 8). The optimized hyperparameters were determined through manual tuning. Finally, all Prediction results were inverted using inverse transform to return the forecasts to their original units.

The learning curve shows that the model stabilizes after 10 epochs and achieves successful optimization (Fig. 22).

While the Long Short-Term Memory (LSTM) model successfully captures the general upward trend of food prices over the 33-month period, it exhibits a consistent negative bias, underestimating the peak values observed in the actual data (blue). Actual prices frequently hover near the upper boundary of the \(95\%\) confidence interval in Fig. 23. The behavior of LSTM’s prediction is similar to that of the SARIMAX.

For activation functions, the standard Keras LSTM defaults were utilized: the sigmoid activation governed the recurrent gates, while the hyperbolic tangent (tanh) was used for cell state updates, which are crucial for preventing the vanishing gradient problem. The final output layer for the regression task used a linear activation. All training runs employed the Adam optimizer with its efficient, adaptive learning rate mechanism, using the default Keras settings. Most importantly, the research involved extensive hyperparameter tuning far beyond a single configuration. This tuning systematically evaluated different combinations of units (8, 16, 48, 64, 120, etc.) and tested a broad spectrum of epochs (ranging from 30 to 500). Then the study compared performance using both 32 and 64 batch sizes. The reported model represents the configuration that achieved the best performance metrics as determined by this thorough tuning process.

The final Long Short-Term Memory (LSTM) network employed a streamlined stacked architecture with two recurrent layers of 64 and 32 units, respectively, achieving the lowest overall error metrics among all tested configurations. This parsimonious structure, derived from a robust hyperparameter tuning process, proved superior to more complex models (those with higher neuron counts), which were consistently underfitting on the test set. The model utilized a lookback window of 3 months and a minor dropout rate of 0.01 for regularization, while recurrent dropout was set to zero. The network was trained for 50 epochs using the Adam optimizer (with default Keras parameters) with a batch size of 32. Notably, attempts to use higher epoch counts, more aggressive learning rates, or larger batch sizes similarly failed to produce a more stable or better-performing model. It confirms the optimality of the finalized, simple configuration, effectively balancing complexity and predictive power for the non-linear dynamics of the food inflation data.

Model evaluation

This study analyzed four differently configured artificial neural network models in order to find the most accurate predictive model that can support optimal decision making. In a comparison among the four ANN models, the study found that ANN [8] and ANN [6] perform better than the other two, with RMSE = 7.10, MAE = 5.50, and RMSE = 4.17, MAE = 3.4, respectively, for each of these models, provided that the scores are comparatively lower (Table 9). This testifies to the fact that simpler models are better at learning the selected data compared to models with a higher number of layers and neurons. With a simple model architecture, fewer neurons, and fewer layers, the model is allowed to learn the dominant patterns (actual signals) because it does not need to learn every insignificant fluctuation that might mislead. The larger model cannot simply learn the general rule of inflation, as it creates unnecessarily complex and wiggly boundaries to fit the specific noise over the training data. When the complex models see new data or test data, those overly complicated parameters fail to forecast properly, leading to failure. The case also lies in the data selection. Time series data often relies on the autoregressive nature of the model for accurate forecasting. Simple models with only one layer of hidden neurons ensure that the model captures the lagged effect properly. Also, the data should have higher frequencies for more complex neural networks, though the collected data is sufficient for the research objectives. The loss landscape (the terrain the algorithm navigates to find the lowest error) becomes significantly more complex and challenging with two layers.

That is why, additionally, a deep network, LSTM, is built in this study, which is excellent at extracting high-level abstractions from raw data in the short term (like recognizing a sequence from the past). Adding a second layer of 14 neurons likely amplifies the noise rather than extracting a deeper economic truth. Economic relationships shift over time with regime changes, so simpler models that capture fundamental, robust trends generally outperform complex ones that rely on intricate, temporary correlations. Also, the RMSE and MAE values of both ANN [8] and ANN [6] on the training set are lower than those of the other two: ANN [6, 4] and ANN [8, 14]. To ensure the total integrity of this research, another time series model, Prophet, which is based on a completely different architectural arrangement, is analyzed to compare its predictive performance with that of the neural networks. The study finds Prophet has proven to be not so competitive against all four ANN models in terms of the error measures with RMSE = 11.82 and MAE = 9.88, which are relatively high error margins. On the contrary, it is also necessary to evaluate how much of the movements of the FPI are explained by the inputs in each of these models, in other words, the goodness of fit. Looking at the values of Rsquared, it can be seen in Table 9 that of these five models, ANN [6] is the outstanding fit in determining the predictions with scores of 0.93, respectively, indicating that external inputs or features can explain 93% variance in the Food Price Index. Considering ANN [6] as the best model of all TDANNs, the performances of both ANN [6] and Prophet are visualized on a clean plot against the denormalized FPI series for better readability and rendition (Fig. 21).

Furthermore, in order to find the best alternative to the TDANN models, the study also built an LSTM model, a sequential timeseries architecture, which has shown promising results. With RMSE: 4.23 and MAE: 3.47, the LSTM model has demonstrated a relatively low error magnitude in relation to the predicted values, which is an acceptable level of error. Prediction points across all models studied in this paper are reported in an organized manner along with their respective intervals in Tables 10,11,12,13,14.

In comparison of the models devised, this study finds that the TDANN, specifically, the ANN [6], transcended the LSTM in both error metrics and model fit. The result aligns with a study that used deep learning models to forecast Consumer Price Index Inflation of Food and Beverages, Fuel and Light, and Headline in India, which suggests that Long Short-Term Memory (LSTM) may not achieve the expected success in forecasting food inflation56. Similar to this study, in a comparative investigation between time series and machine learning models for forecasting agricultural prices26, have found that ML techniques, perform better in most cases by using accuracy measures such as Root Mean Square Error (RMSE) and Mean Absolute Error (MAE). A study on India showed that a simple ANN model with the backpropagation algorithm is highly capable of forecasting the future values of the monthly Consumer Food Price Index57. In line with this study, results from a paper show that deep learning models, particularly Long Short-Term Memory (LSTM), outperform ARIMA in capturing complex temporal patterns, achieving superior accuracy across various error metrics58.

A paper compared the deep-learning nonlinear recurrent neural network represented by the LSTM to the linear ARIMAX model in egg price forecasting in Germany and found that the ARIMAX predictions consistently underperform compared to the LSTM25. In contrast to the poor performance of the \(\text {SARIMAX}\) in my study, Yadav59 found that after employing a convolutional neural network (CNN) and long short-term memory (LSTM), the ARIMA with exogenous variables (ARIMAX) model performed best in capturing the influence of external variables on wheat prices.

Discussion

Predicting food inflation is a technically challenging task due to its complex computational mechanism that is subject to historical subtleties, policy interventions, and governance. In the past, various mathematical and statistical models have been devised with the aim of achieving better precision and robust analysis in the research domain of forecasting food prices. However, developing models that employ a nonlinear approach with neural networks is novel in the field of economic research, which is evolving rapidly with the development of AI standards. This paper addresses the understanding of the general price of food, an area of great interest to economic policymakers and researchers, employing both nonlinear and linear approaches to add new findings in this area and achieve satisfactory results. Besides the advantage of handling nonlinear dynamics and robustness to structural breaks, unlike the classic linear models multicollinearity is not an issue when it comes to selecting features. However, due to their notoriety of being “black boxes”, it is difficult to understand how they arrive at a particular forecast. Overfitting can be a problem, resulting in inaccurate predictions, which is why proper regularization is necessary, such as training the model with multiple repetitions or tweaking parameters and keeping simpler architectures. The temporal dependencies of the time series were addressed by including lagged features, which also contributed to improving the prediction accuracy. The best two TDANN models discussed in this paper have successfully acknowledged the pitfalls and satisfactorily produced predictions that yield deviations of less than 6% in RMSE and MAE.

This paper’s findings align with results from similar previous studies that analyzed monthly economic data, supporting the conclusion that the feedforward artificial neural network with backpropagation modeling, which does not assume linearity, excels at solving complex problems and outperforms traditional econometric models in forecasting accuracy60,61,62.

On the contrary, the study introduced Facebook’s Prophet, a popular forecasting method in business research, to showcase whether the piecewise linear or the non-linear approach is better at predicting the movement of a highly sensitive price index. Prophet is popular for its user-friendly service that decomposes the predictions or forecasts into their distinct components, allowing users to clearly see the contribution of each component, a huge advantage for communicating results to a non-technical audience or for a research paper where interpretability is key. It is also efficient at handling outliers or missing data, common problems in real-world datasets like the food price index. Nevertheless, Prophet is vulnerable to highly volatile data subject to frequent fluctuations not based on the trend and seasonality assumptions, and too many additional regressors can cause overfitting.

LSTM models are computationally intense and complex compared to simpler traditional RNNs or feed-forward networks. This leads to slower training. They are inherently sequential, meaning they process data step by step. Also, having a large number of hyperparameters makes the LSTM sensitive to subtle changes, which is why tuning the model is challenging and time-consuming. Furthermore, LSTMs are often considered black-box models. It is difficult to interpret the role of the cell state and the gates to understand why the model made a specific prediction. Still, the model built for this study is devised according to industry practice and is functionally sound for forecasting Food Price Index.

Therefore, this study has strategically selected the features that are associated with changes in the Food Price Index and equipped the model smoothly, having very low error margins in every benchmark.

Though the models perform proficiently by every metric, solid predictive modeling is not a panacea for time series analysis of all food prices. TDANN and LSTM are very acceptable in predicting or forecasting future price trends of economic data, but in a rational world, the turn of both domestic and global events can shape the trend, nullifying predictions. Shocks from regional war in some part of the world to political tension within a community can shift the prices of agricultural and manufactured foods, and edible items abruptly. Hence, predictive analysis of a price index should not be held absolute, given there are only a limited number of external inputs considered. A study by Kirikkaleli and Darbaz63 explored the causality and relationships between U.S. food prices, energy prices, economic policy uncertainty, and the value of the U.S. dollar and found that the dollar price negatively affects the food price index at both high and low volatility periods, implying a significant positive relationship between the energy price index and the food price index. Moreover, the study stated that energy is a long-run and permanent cause of the food price index. Weinberg and Bakker64 utilized a domestic-level measure of food prices rather than the world market price and found a positive and significant relationship between food prices and outbreaks of social unrest and conflict across several countries. A study by MacLachlan et al.65 used the optimal and kitchen-sink SARIMAX forecasting models and offered strong evidence that changes in food-at-home CPI significantly correlate to prior changes in core CPI and the money supply.

Thus, the author recommends the inclusion of exchange rate, money supply, and social unrest in any future studies of food inflation or food price indices in the context of Bangladesh.

The future scope of research is very broad in that data of different frequencies with other features or variables can be incorporated with different models to strengthen forecasting literature. Demographic data, which is not considered in this research, can be an essential component for analyzing and forecasting a Food Price Index because consumer behavior, which is driven by demographic characteristics, directly impacts the demand side of food markets. Especially, the price of food items is very susceptible to the location of a population in Bangladesh, since urban consumers are the net consumers relying on a complicated supply chain, exposed to price fluctuations, whereas the rural population generally has easier access to food they grow. Simultaneously, factors affecting the food economy from various aspects of the global supply chain, food security, natural disasters, urbanization, industrialization, and land use can be taken into consideration for further research. Researchers can also utilize other machine learning models like MLP, XGBoost, and VARMAX, which are prevalent in the forecasting discipline and can rival ANN and Prophet, illuminating new findings.

A study predicting food price inflation points to a decline in the production of most food crops, especially rice and wheat, in South Asia by 2050 due to climate change66. The results from the environmental Global Trade Analysis Project model indicate that the unfavorable increased heat impacts on agricultural productivity (crop, land, and labor) will reduce food production and create upward pressure on food prices in Nepal, Pakistan, Bangladesh, and Sri Lanka, mirroring the findings of the non-linear models discussed in this study. It will lead to a reduction in household food consumption, posing a threat to regional food security. An investigation67 used the Dynamic Common Correlated technique and found that climate change reduces food availability and increases the risk of food insecurity in South Asia. Another study identified changes in fuel prices, money supply, and fertilizer prices as key drivers of food inflation in Sri Lanka68, a striking similarity to the learnings of the macroeconomic oscillations of Bangladesh. Likewise, one significant paper found that real and nominal frictions, as well as structural shocks, have become more pronounced, and inflation is now driven more by cost-push and demand shocks in India69, a neighboring country of Bangladesh, in the aftermath of the COVID-19 pandemic and the Russia-Ukraine war. All the changes taking place in different parts of South Asia collectively attest to the delayed effects on historical food prices in Bangladesh. From these latest studies centered on South Asian countries, the author can infer that the factors affecting the food prices in these countries work homogenously, like how they work for Bangladesh.

Policy implications

The policy implications are based on the SHAP dependence and interaction analysis, the decomposed Prophet components, and the rising inflation trend captured by the TDANN and LSTM models, all informed by author’s economics knowledge.

  • Invest in flood control infrastructure (e.g., improved drainage, protective embankments) for high precipitation regimes and irrigation expansion/drought-resistant crops for low precipitation regimes, especially during the critical April-July rice harvesting season.

  • Adjust the size and location of national grain reserves (rice and wheat) based on the prior precipitation reading. Boost reserves when MP_lag3 is in the extreme zones to prepare for market uncertainty and potential supply shortfalls that drive prices up.

  • Subsidize or develop weather-indexed crop insurance linked directly to the critical MP_lag3 thresholds. It will help stabilize farmers’ income and reduce overall supply risk.

  • Deploy food reserves or import tariffs only when the model indicates that extreme delayed precipitation or rainfall is leading to a strong positive influence on current FPI (signaling acute supply issues), focusing market intervention precisely when the weather shock breaks the normal pattern.

  • Maintain transparent communication during extreme weather events to manage public and market expectations.

  • Embed the Energy Price Index and Lagged Food Price Index interaction directly into national budget planning and trade decisions to mitigate inflation risk before it materializes. When prior food inflation is already high, the government should proactively hedge a greater portion of its projected energy and key agricultural input imports (like fertilizer, which is energy-intensive). This guarantees a lower cost base for the EPI component of the supply chain, ensuring that even if global energy prices spike, the domestic inflation amplifier is disarmed.

  • Not letting the businesses justify raising prices based on past inflationary pressure by strategically stabilizing or subsidizing energy costs when the risk of high food prices is present.

  • Adopt a dual-approach strategy that combines proactive short-term supply management with long-term structural support. The Trading Corporation of Bangladesh (TCB) should use predictive models to build up stocks of high-demand goods (sugar, oil, and dairy) months in advance. They should then sell these goods through Open Market Sales (OMS) two weeks before festivals to keep prices from going up too much when demand is high.

  • Policy should focus on reducing the baseline cost of production by lowering import duties on animal feed and providing low-interest financing for modern livestock farming, ensuring price stability in beef and poultry markets year-round.

The implications outlined here are formulated for policymakers, researchers, and relevant public agencies overseeing food security, agricultural and irrigation planning, climate-risk management, and the administration of grain reserves and trade interventions.

Conclusion

This study was initiated to address the historical rise in food inflation at an alarming rate, as reported by the World Bank, and to explore multiple facets impacting food prices, which are concerning Bangladesh’s economy. Secondary data from highly prestigious sources comprising five time series variables with 177 entries for each are processed for building econometric and machine learning models. The author has satisfactorily established SARIMAX, TDANN, Prophet, and LSTM models to fill the identified research gap in food inflation prediction. The model performances reflect the true integrity of the data selection and robustness in judgment.

Although SARIMAX is one of the classic time series linear models in the forecasting domain, given the complex interactions between historical data on climate factors, energy prices, and food prices, it was not a good fit compared to the non-linear models. This finding supports the paper’s hypothesis that a non-linear approach is superior to the traditional linear approach, as non-linear research using machine learning models yields better results in detecting the volatile movements of food inflation.

Though ANN [6] and LSTM came out as the choice models compared to the others, the evaluation metrics for ANN [8] also show highly significant results, making it equally relevant and best alternative. This testifies in favor of the artificial neural networks’ efficiency in capturing the underlying intricacy within the inputs and the target.

While LSTM models are often preferred for sequence or time-series data due to their ability to capture long-term dependencies, the TDANN in this comparison performed better according to the specific evaluation metrics. This could suggest that the dataset did not have strong, long-term sequential patterns that would significantly benefit the LSTM architecture, or perhaps the TDANN was better tuned. Besides, LSTM is a deep learning model demanding large timeseries data with higher frequencies (daily, hourly, etc.) for operating complex analysis. Though it has received moderately lower errors in predictions, the Rsquared value (0.83) suggests, this may not be the best model for the chosen data, a finding identified as a limitation of this study. The underperformance of the LSTM suggests that monthly food inflation in this context may be characterized by ‘short memory’ dynamics. While analysis attributed LSTM results to noise amplification, it is also highly probable that the economic drivers of monthly inflation are dominated by immediate, short-term shocks rather than long-term dependencies. Consequently, the complex gated mechanisms of the LSTM, designed to capture long-range temporal patterns, may be less effective than simpler models when the data lacks significant long-term memory.

The author suggests preferring TDANN over LSTM to forecast food prices considering weather shocks and energy market volatility to mitigate the rising food inflation and to support policy interventions. Backed by a strong \(\text {R}^2\) value, the TDANN prediction points are close to the actual values, efficiently capturing the future data trend and accurately modeling its spikes and drops.

In addition to the insights from these two models, Prophet has provided valuable information on how holidays temporarily influence the prices of essential goods. Prophet components analysis sheds light on the passive influence of supply shocks on prior agricultural vulnerability, as cost-push inflation drives prices up. It directly makes the findings in SHAP analysis more credible.

Therefore, this paper has met all the stated objectives, followed by hypothesized research questions with evidence-based assertions.

The final verdict on both ANN [6] and LSTM: Are these models strong enough for policy interventions?

Major shocks typically move prices by 10% to 30% (a jump of 12–35 points). ANN [6] and LSTM’s error is only 3.4% (4 points). The predictions will successfully catch the big wave even if the exact height is slightly off. The model successfully identifies extreme deviation events within a 3.6% margin of error. The models serve as a dependable warning system. Because the models’ errors are significantly smaller than the magnitude of true structural shocks, both architectures can reliably distinguish genuine crisis events from normal market fluctuations (1–3%). The model prioritizes responsiveness to shocks over smoothing, ensuring we don’t miss a crisis event.

So, within the context of shock detection and short-term monitoring, the evidence supports the use of TDANN and LSTM models as reliable tools to inform timely policy interventions.

Monthly data, sufficient for conventional time-series techniques and moderately parameterized neural networks, limits the effectiveness of deeper sequential architectures, such as LSTMs. With relatively few observations, highly complex models may fail to fully exploit their representational capacity, potentially leading to unstable generalization or limited gains over simpler alternatives. Access to higher-frequency data, such as weekly or daily food price series at the district and regional level, would likely enable the extraction of other temporal patterns and more reliable training of deep learning models. In addition, although the proposed methodological framework is broadly transferable, the estimated importance and policy implications should be interpreted with caution when extending the findings to other economies, as differences in agricultural structures, subsidy mechanisms, market integration, and climate conditions may alter them.

The global supply chain of energy markets is highly dynamic subject to uncertain global events like war, pandemic, exchange rate, tariffs, etc. As highly demanding natural resources such as oil, gas, and electricity experience drastic changes in price and production, these fluctuations can directly trigger domestic production cost, which lead to disrupting stable food inflation. On top of that, extreme weather events that function beyond human control, such as floods and drought are proven to be impacting the prices forward in time. Therefore, major evaluations of existing environmental policies are essential, and evidence-based policy recommendations will aid in monitoring the Food Price Index going forward.

This research addresses the critical gap in food inflation literature by providing a multifaceted investigation with deep interpretability for policy design, categorized into three core contributions. First, methodologically, the study rigorously compares traditional linear econometric and generalized additive frameworks (SARIMAX and Prophet) against advanced non-linear machine learning and deep learning architectures, including TDANN and LSTM. By evaluating these models on the same monthly dataset, the research validates the hypothesis that non-linear models are better equipped to capture the complex, volatile movements of food inflation that traditional approaches often fail to detect. Second, the empirical contribution for Bangladesh involves the development of a unique domestic-level model that integrates the synergistic effects of climate variables and the Energy Price Index on the Food Price Index. Utilizing a specialized dataset, this study captures regional market dynamics and vulnerabilities specific to a nation consistently highlighted on the World Bank’s inflation Red List. Finally, the policy contribution through XAI lies in the application of SHAP to decode the best one among the TDANN models. Moving beyond “black-box” predictions, this analysis transforms complex forecasts into actionable, quantitative insights regarding the specific drivers of weather shocks and energy market volatility that have historically impacted food price inflation. This technique leveraged feature importance to translate high-accuracy forecasts into specific and targeted policy implications for managing weather shocks and risks in Bangladesh’s agricultural input and energy markets.

This paper has established ML models based on empirical results, following the mathematical theories of time-series forecasting, with the notion of contributing to the existing macroeconomic literature that will serve the readership of policy analysts, economists, academic researchers, and government stakeholders.