1 Introduction

As a prominent cereal producer in Africa, Nigeria plays a crucial role in cultivating diverse cereals, including maize, rice, sorghum, and millet [1, 2]. However, the nation grapples with significant challenges in meeting the food demands of its population, which exceeds 210 million individuals. Over the years, global and Nigerian populations have experienced substantial growth, rising from 5.29 billion and 95.21 million in 1990 to 7.89 billion and 213.4 million in 2021, respectively [3]. In addition, the confluence of climate change, escalating food demand, and high global fertilizer prices have contributed to a pronounced food shortage. Various factors characterize this shortage, including rapid urbanization, instability in cultivated cereal cropland areas, depleted soil fertility, and environmental degradation [4,5,6]. Addressing the escalating food needs of the global population necessitates the utilization of high-yielding cereal crop varieties, exemplified by the green revolution [7,8,9]. Moreover, the Nigerian government is confronted with additional challenges posed by events such as the shocks of COVID-19, the Ukraine-Russia war, and the activities of bandits, Boko Haram, and Niger Delta militants [10]. Despite a notable decrease in per capita cereal food supply in Nigeria from 143.2 kg in 2011 to 137.9 kg in 2020, the government remains committed to enhancing cereal food production to meet the expanding population's needs. The primary factors influencing the production and consumption patterns of cereal crops in Nigeria are the demand for food, farm inputs, the rapid growth of the population, and changes in income [11,12,13]. A concentrated effort to augment the output of green cereals holds the potential of sustainable enhancement for global food security [14, 15].

The current body of scholarly work on cereal production and its implications for future food security has predominantly examined the relationship between cereal crop production, environmental variables, and climate change in various continents, regions and countries. Nevertheless, the results have proven inconclusive and inconsistent. For example, Attiaoui and Boufateh [16], Chandio, Jiang [17], Chandio, Akram [18], Kumar, Sahu [19], and Pickson, He [20] show a negative impact of climate change on cereal production. However, the impact of climate change on agricultural production in Nigeria has yet to be evident due to the Nigerian government's implementation of several institutional and programmatic reforms and innovations. These measures, which include the encouragement of both local and large-scale irrigation systems, hold promise for mitigating the impact of climate change on agricultural productivity. This could be achieved by decreasing the adverse effects of climate change on animal feed and water availability in the country [21].

On the other hand, studies conducted by Emenekwe, Onyeneke [2], Koondhar, Udemba [22], Pickson, He [20], Sui and Lv [23], and Zwane, Udimal [24] highlight the positive impact of climate on cereal production. Koondhar, Aziz [25] and Chandio, Akram [18] established a unidirectional Granger causation relationship between cereal production and CO2 emissions. Further, Rehman, Ma [26] showed an insignificant impact of climate change on cereal production. Numerous scholarly investigations have been conducted to explore the collective impact of climatic and non-climatic variables on cereal output. However, there has been a significant dearth of scholarly focus on developing nations within the African continent, a gap that could have serious implications for these nations' food security [27, 28]. Furthermore, little attention is given to non-climatic factors within countries and regions, and numerous studies have shown varying effects on the quantity and quality of cereal food productivity [1, 29,30,31]. Methodologically, prior studies have utilized time series models such as the Autoregression Distributed Lag–ARDL and the Vector Autoregression–VEC, as well as panel data models including the Dynamic Ordinary Least Square-DOLS, Fully Modified Ordinary Least Square–FMOLS, and Pooled Mean Group–PMG to estimate the link between selected variables for different countries. Table 1 summarizes previous studies on the impact of climatic and non-climatic factors on cereal production, clearly showing the research gap in the existing literature.

Table 1 Summary of literature on cereal production.

Thus, this study contributes to the literature in several ways. First, motivated by the inclusive findings of the existing literature, this study aims to incorporate the effects of non-climatic factors on cereal production. Specifically, it examines the long-run and short–run nexus between the cereal cropland area, fertilizer, the food production index, the rural population, and cereal food production and provides insights into enhancing cereal food output in Nigeria, which would serve as a reference to policymakers for policy formulation related to feeding the growing population of Nigeria. Second, the findings of this study could assist Nigeria in reducing its food imports while enhancing local production and improving its trade balance. Third, the findings can guide decision-makers in diversifying portfolios for sustainable cereal production, and it serves as a reference for other African and emerging nations facing similar challenges. Lastly, the study applies the novel dynamic ARDL simulation (DYARDLS), which is sparsely used in cereal production for food security literature. The DYARDLS method aligns the dynamic structure and enables long-term predictions of the impact of explanatory variables on the dependent variable. It also provides a graphical user interface for exploring counterfactual changes while holding other factors constant, following the ceteris paribus principle [32, 33].

The remaining parts of this study are organized as follows: Section two presents the data and methodology used in this study, including model specification and various estimation techniques. In section three, we discuss our results. The last section of this paper offers the conclusion of the study and policy suggestions for our findings.

2 Data and methodology

2.1 Data

The selected dataset specifically focuses on Nigeria, covering 1980–2021. We used data accessibility for all suggested factors as a yardstick for selecting the 41 years. The data sources include the World Development Indicators of the World Bank and the Food and Agriculture Organization Statistics (FAOSTAT). The annual time-series data used in the model and the data source information are shown in Table 2. Prior to applying a natural logarithm, the variables in the dataset were measured as follows: cereal food production (CFP) was expressed in metric tons, representing the productive capacity of cereal crops; cropland (LCFP) was measured in hectares, indicating the harvested area; fertilizer usage (FERT) was reported in kilograms per hectare of arable land, reflecting the quantity of plant nutrients used per unit of arable land; the food production index (2014–2016 = 100) covered edible food crops and provided a measure of their nutritional content; and rural population (RPOP) represented the total population in rural areas, calculated by subtracting the urban population from the total population. Figure 1 shows the trends of all the analysis variables and depicts that all the variables were unceasingly growing. However, the increasing trend in cereal cropland areas, fertilizer usage, and the rural population experienced frequent episodes of inconsistency.

Table 2 Explanation and sources of data.
Fig. 1
figure 1

Trend of the study variables

2.2 Model specification

To study the relationship between CFP, LCFP, FERT, FPI, and RPOP. The study employs the autoregressive distribution lag (ARDL) model. The ARDL bounding test method was introduced by Pesaran, Shin [41] to check the short- and long-run equilibrium while also checking the existence of cointegration among the selected time series. Compared to a simple cointegration approach, the ARDL method is superior due to its adaptable stationary characteristics for mutual, first difference, and level cointegration analyses [42]. Its efficient and consistent results can be derived from small sample sizes [43, 44] while estimating short-run and long-run coefficients and the impact of endogenous explanatory variables [45]. The economic function of our study is shown in Eq. (1) as follows:

$${\text{CFP}}_{\text{t}}=\text{f}({\text{LCFP}}_{\text{t}},{\text{FERT}}_{\text{t}},{\text{FPI}}_{\text{t}},{\text{RPOP}}_{\text{t}})$$
(1)

\(CFP\) stands for cereal food production, \(LCFP\) stands cropland, \(FERT\) stands for fertilizer usage, \(FPI\) represents the food production index, and \(RPOP\) stands for the rural population. Equation (2) is specified afterward, applying a linear relationship between the study variables.

$${\text{CFP}}_{{\text{t}}} = { }\alpha + {\text{LCFP}}_{{\text{t}}} + {\text{FERT}}_{{\text{t}}} + {\text{FPI}}_{{\text{t}}} + {\text{RPOP}}_{{\text{t}}} + {\text{U}}_{{\text{t}}}$$
(2)

We transformed Eq. (2) into a log-linear form, the natural logarithm is applied, as illustrated in Eq. (3), to resolve the issue of heteroscedasticity, where all the variables and symbols remain the same as in Eq. (2):

$${\text{LnCFP}}_{\text{t}}={\upbeta }_{0}+{{\upbeta }_{1}\text{LnLCFP}}_{\text{t}}+{\upbeta }_{2}{\text{LnLCFP}}_{\text{t}}+{\upbeta }_{3}{\text{LnFERT}}_{\text{t}}+{\upbeta }_{4}{\text{LnRPOP}}_{\text{t}}+{\upmu }_{\text{t}}$$
(3)

\(CFP, LCFP, FERT, and RPOP\) hold the same meaning as in Eqs. (1 & 2). The \(ln\) signifies the logarithmic form, while \(t\) represents time and \(\upmu\) is the random error term. The coefficients of the regressors are depicted by \({\beta }_{\text{1,2},3, and 4}\).

2.3 Methodology

2.3.1 Stationary test

The initial step of this study was to detect the stationary characteristics of the variables at the level, first difference, or both. This was accomplished by utilizing the Augmented Dickey-Fuller (ADF) test proposed by Dickey and Fuller [46] and the Phillips-Perron (PP) test proposed by Phillips and Perron [47]. The null hypothesis for both ADF and PP unit root tests is the presence of a non-stationary unit root at the level. In contrast, the alternative hypothesis suggests a stationary unit root absence. The t-statistics are the basis for both unit root tests, with the ADF and PP unit roots depicted in Eqs. (4 & 5):

$$\Delta Z_{t} = { }\phi_{0} + \phi_{1} Z_{t - 1} + \mathop \sum \limits_{j - k}^{p} d_{j} \Delta Z_{t - 1} + \varepsilon_{l}$$
(4)

where ∆ stands for the initial difference operator; \(\phi_{0}\) signifies constant; \({Z}_{t}\) stands a for time series; p is the optimal number of lags for the \(CFP\); and \({\varepsilon }_{l}\) is the untainted white noise error term. The cumulative distribution of ADF statistics was created using the ADF unit root test. The following equation is for the PP unit root:

$$\Delta Z_{t} = { }\phi + p{*}Z_{t - 1} + \varepsilon_{l}$$
(5)

where \({Z}_{t}\) stands for time series; ɸ is the noise for the hypothesis; p and \({\varepsilon }_{l}\) have the same meaning in Eq. (4).

2.3.2 ARDL bounds testing method

Pesaran, Shin [41] introduced the ARDL model, which was utilized to investigate the relationships between \(\text{CFP},\) \(\text{LCFP}\), \(\text{FERT}\), \(\text{FPI}\), and \(\text{RPOP}\) in the long-run. The formula for the model is shown in Eq. (6):

$$\Delta {\text{LnCFP}}_{{\text{t}}} = \,{ }\beta_{0} + { }\beta_{1} \mathop \sum \limits_{{{\text{i}} - 1}}^{{\text{k}}} \Delta {\text{LnCFP}}_{{{\text{t}} - 1}} + \beta_{2} \mathop \sum \limits_{{{\text{i}} - 1}}^{{\text{k}}} \Delta {\text{LnLCFP}}_{{{\text{t}} - 1}} + \beta_{3} \mathop \sum \limits_{{{\text{i}} - 1}}^{{\text{k}}} \Delta {\text{LnFERT}}_{{{\text{t}} - 1}} + { }\beta_{4} \mathop \sum \limits_{{{\text{i}} - 1}}^{{\text{k}}} \Delta {\text{LnFPI}}_{{{\text{t}} - 1}} + \beta_{5} \mathop \sum \limits_{{{\text{i}} - 1}}^{{\text{k}}} \Delta {\text{LnRPOP}}_{{{\text{t}} - 1}} + { }\beta_{6} {\text{LnCFP}}_{{{\text{t}} - 1}} + \beta_{7} {\text{LnLCFP}}_{{{\text{t}} - 1}} + \beta_{8} {\text{LnFERT}}_{{{\text{t}} - 1}} + \beta_{9} {\text{LnFPI}}_{{{\text{t}} - 1}} + \beta_{10} {\text{LnRPOP}}_{{{\text{t}} - 1}} + \,\varepsilon_{{\text{t}}}$$
(6)

where t is the time period; \({\beta }_{\text{1,2},\text{3,4}, and 5}\) are the short-run coefficients; \({\beta }_{\text{6,7},\text{8,9}, and 10}\) stand for the long-run coefficients; \({\beta }_{0}\) is a constant term; Σ is the error correction dynamics. Equation (6) has two parts; the first part represents the short-run connotation, while the second part signifies the long-run connotation. The grouping of appraisals of the lagged level of the data can be used to evaluate its significance [41]. An F test examines the association between \(CFP\), \(LCFP\), \(FERT,\) and \(RPOP\) in the long run. If the F test value exceeds the upper critical boundary, the assumption of no cointegration among variables is rejected. In cases where the F test value falls within the range of the lower and upper critical boundaries, the results remain inconclusive. Acceptance of the assumption of no cointegration among variables occurs when the F test value falls below the lower critical boundary. Equation (7) can also be utilized in long-term estimation modeling to determine the long-term coefficient if a long-term relationship exists between the variables under examination.

$$\Delta LnCFP_{t} = \lambda_{0} + \lambda_{1} \,\,\sum\nolimits_{(i = 1)}^{k} {\Delta LnCFP_{(t - 1)} } + \lambda_{2} \,\,\sum\nolimits_{(i = 1)}^{k} {\Delta LnLCFP_{(2t - 1)} } + \lambda_{3} \,\,\sum\nolimits_{(i = 1)}^{k} {\Delta LnFERT_{(t - 1)} } + \lambda_{4} \,\,\sum\nolimits_{(i = 1)}^{k} {\Delta LnFPI_{(t - 1)} } + \lambda_{5} \,\sum\nolimits_{(i = 1)}^{k} {\Delta LnRPOP_{(t - 1)} } + \,\varepsilon_{t}$$
(7)

If a long-term relationship existed between study variables, short-term dynamics were estimated. The estimated model can be expressed as follows in the short term:

$$\Delta {\text{LnCFP}}_{{\text{t}}} = \gamma_{0} + \gamma_{1} \mathop \sum \limits_{{{\text{i}} = 1}}^{{\text{k}}} \Delta {\text{LnCFP}}_{{{\text{t}} - 1}} + \gamma_{2} \mathop \sum \limits_{{{\text{i}} = 1}}^{{\text{k}}} \Delta {\text{LnLCFP}}_{{2{\text{t}} - 1}} + \gamma_{3} \mathop \sum \limits_{{{\text{i}} = 1}}^{{\text{k}}} \Delta {\text{LnFERT}}_{{{\text{t}} - 1}} + \gamma_{4} \mathop \sum \limits_{{{\text{i}} = 1}}^{{\text{k}}} \Delta {\text{LnFPI}}_{{{\text{t}} - 1}} + \gamma_{5} \mathop \sum \limits_{{{\text{i}} = 1}}^{{\text{k}}} \Delta {\text{LnRPOP}}_{{{\text{t}} - 1}} + { }\eta {\text{ECT}}_{{{\text{t}} - 1}} + \varepsilon_{{\text{t}}}$$
(8)

The estimated model can be simplified to include the error correction term (ECT) coefficient and adjustment speed, which are opposite to the long-term equilibrium.

2.3.3 The dynamic ARDL simulations model

ARDL is known for providing robust and consistent estimates. However, recent advancements in empirical research have introduced methods to enhance and extend the robustness of the ARDL model. One such innovative approach is the novel dynamic ARDL Simulation (DYARDLS) method introduced by Jordan and Philips [32]. To elucidate this novel method, let us briefly overview the issue it aims to address. While the ARDL model is relatively straightforward, it possesses a complex dynamic structure due to its flexibility in accommodating various lags, first differences, and lagged differences of independent or dependent variables. This complexity inadvertently leads to challenges in interpreting the effects of independent variables [33, 48]. To tackle this issue, Jordan and Philips [32] introduced the novel DYARDLS approach, simplifying the intricate process required to assess the significance of model parameters. It presents intuitive counterfactual scenarios that make comprehending and interpreting ARDL model estimates easier. A noteworthy aspect of this technique is its ability to estimate, simulate, and provide graphical representations illustrating the impact of a counterfactual change in one explanatory variable at a specified time while holding other variables constant. Thus, our DYARDLS model is put forward in the following equation as follows:

$$\Delta {\text{lnCFP}}_{\text{t}}=\,{\upgamma }_{0}+{\upbeta }_{0}{\text{lnCFP}}_{\text{t}-1}+{\upbeta }_{1}{\text{lnLCFP}}_{\text{t}}+{\upbeta }_{1}{\Delta \text{lnLCFP}}_{\text{t}-1}+{\upbeta }_{2}{\text{lnFERT}}_{\text{t}}+{\upbeta }_{3}{\Delta \text{lnFERT}}_{\text{t}-1}+{\upbeta }_{3}{\text{lnFPI}}_{\text{t}}+{\upbeta }_{3}{\Delta \text{lnFPI}}_{\text{t}-1}+{\upbeta }_{4}{\text{lnRPOP}}_{\text{t}}+{\upbeta }_{4}{\Delta \text{lnRPOP}}_{\text{t}-1}+{\upvarepsilon }_{\text{t}}$$
(9)

3 Results and discussion

3.1 Descriptive statistics of study variables

Table 3 presents the descriptive statistics for study variables, including standard deviation, minimum, maximum, median, and mean values. The calculations also include Skewness, Kurtosis, and Jarque–Bera. The value of CFP ranges from 30.65 × 106 to 7.79 × 106, with an average value of 20.96 × 106. FERT varies from 20.97 to 4.15, with a mean value of 10.01. The value of FPI varies from 106.46 to 23.77, with a mean of 64.72. RPOP has an average value of 79.2 × 106, which varies between 1.00 × 108 and 56.92 × 106. LCFP varies from 19.41 × 106 to 4.85 × 106, with a mean value of 15.42 × 106. Except for FERT, all parameters exhibited a negative skewness. Moreover, none of the parameters exhibited negative excess kurtosis. The results of the Jarque–Bera normality test indicate that all parameters have a normal distribution. The absence of correlation between the variables was examined, and the corresponding results are presented in Supplementary file 1 Appendix A1. As Gujarati [49] highlights, multicollinearity is said to be present when the correlation coefficient exceeds 0.8.

Table 3 A summary statistics of the study variables

3.2 Unit root test results

Two unit root tests were used to check the stationarity of variables: Dickey and Fuller [46] and Phillips and Perron [47] unit root tests. Neither test showed any variables integrated by I(2). Table 4 shows the results of the unit root tests, which shows that nearly all the variables are stationary at the first difference I(1), while only RPOP appears to have stationarity at level I(0) alone. As the variables are stationary at level I(0) and I(1), the basic ARDL model estimate can be examined in the same way as by other authors [25, 50,51,52,53,54].

Table 4 Unit root tests

The study also conducted the Zivot and Andrews [55] unit root test, which considers structural breaks in the data and the results is depicted in Table 4. The optimal lag length selection is one of the requirements for estimating the novel DYARDLS model. The results from Table 5 show that our novel DYARDLS model is based on a lag length of 2.

Table 5 Optimal lag length selection

3.3 ARDL bounds test for cointegration results

The ARDL bounds test result is displayed in Table 6, showing that the F-statistics value for \({\text{H}}_{\text{CFP}}(\text{CFP}/\text{FERT},\text{ LCFP},\text{ FPI},\text{ RPOP})\) is 5.454. This F-statistics value was evaluated with the value of the upper critical boundary and the standard significant threshold. The table demonstrates that the F-statistic value is greater than the value of the upper critical boundary at a 1% significance level. Therefore, this F-statistic supports the cointegration of the variables and rejects the null hypothesis. The upper and lower boundary's critical values are assessed considerably, indicating that cointegration is operating concurrently within regressors to fix values. In their earlier study, Koondhar, Aziz [25] found a cointegration between CFP, CO2 emissions, and LCFP, which is consistent with our results. Other authors like Rehman, Ozturk [52], Khan, Koondhar [56], Samson and Abdulwahab [57], and Sarkodie, Ntiamoah [58] also investigated the ARDL bounds test to find the cointegration nexus between their study variables. These results are supported by the Pesaran, Shin [41] table, and the corresponding p-values were less than p < 0.01. Thus, we conclude that our model has a long-run (cointegrating) relationship among the variables under analysis.

Table 6 Bounds testing

3.4 Dynamic ARDL simulation for long-run and short-run estimations

Table 7 presents the results of the relationship between cereal production, cropland area, fertilizer usage, the food production index, and the rural population using novel DYARDLS. In addition, we estimated the OLS, FMOLS, and DOLS to show the consistency of our model; the results are provided in Supplementary file 1 Appendix A2. Moreover, the result of the novel DYARDLS method is presented in Figs. 25. It shows the dynamic simulation plots generated for each independent variable after 5000 simulations across 15 time points with 10 units ± shocks to generate counterfactual change in the dependent variable.

Table 7 Dynamic ARDL simulation long- and short-run estimations
Fig. 2
figure 2

Cereal food production (lnCFP) and cereal cropland (lnLCFP)

The result in Table 7 demonstrates a significant and positive correlation between \(\text{CFP}\) and \(\text{LCFP}\) in the long run. The coefficient of 0.505, significant at the 1% level, indicates that a 1% increase in LCFP leads to a corresponding 0.505% increase in CFP. This positive and statistically significant relationship holds even in the short run, where a 1% increase in \(\text{LCFP}\) results in a 0.252% increase in \(\text{CFP}\). Furthermore, as indicated in Fig. 2, the outcomes of applying a 10% positive and negative shock to LCFP on CFP. From Fig. 2a, we observe that a + 10% shock in predicted LCFP leads to an increase in CFP in the long run, while a -10% shock in predicted LCFP exacerbates the decline in CFP (see Fig. 2b). Both the results from ARDL and novel DYARDLS are similar. These findings highlight the significance of the cereal cropland area in Nigeria and align with a well-established trend where expanding the area dedicated to grain crop production boosts overall productivity. Additionally, our study aligns with previous research, such as the work conducted by Yu, Xiang [59], which demonstrated the substantial impact of cropland area on agricultural productivity in Argentina, Brazil, and Nigeria. Another study by Khan, Koondhar [60] reported a significant correlation between cropland area and crop productivity concerning agricultural product exports in Pakistan.

In both the short-run and long-run, FERT has an insignificant positive effect on cereal food production, with a coefficient of 0.018 and 0.009, respectively. This indicates that a 1% increase in FERT could increase cereal output by either 0.018% in the long-run or by 0.009% in the short-run. Although \(\text{FERT}\) does not exhibit a noteworthy impact on \(\text{CFP}\), the positive impact of \(\text{FERT}\) on \(CFP\) for both short and long-run is possible. This shows that Nigeria possesses significant potential in the consumption and utilization of chemical and organic fertilizers. This might be due to the fact the average fertilizer usage in Nigeria is 20 kg/ha, which is lower than that of certain African countries, such as South Africa and Egypt [61]. Figure 3 indicates the impact of ± 10 shocks in predicted FERT on CFP. Figure 3a shows that CFP would increase steadily following a + 10 shock from FERT. Figure 3b indicates that CFP would steadily decrease following a -10 shock from FERT. The effects of ± 10 shocks on predicted FERT in the short and long run, are almost the same. Gul, Xiumin [28] report a positive relationship between fertilizer consumption and agricultural productivity for rice and Chandio, Jiang [39] for wheat. On the other hand, some studies reported that cereal production is harmed due to intensive fertilizer application, which usually results in CO2 emissions due to the overuse of chemical applications and non-renewable energy-consuming agro-based technology [4, 62].

Fig. 3
figure 3

Cereal food production (lnCFP) and fertilizer consumption (lnFERT)

Additionally, the FPI has an unfavorable relationship with CFP in the long and short run, with coefficients of −0.248 and −1.058, respectively. At a 1% significance level, a percentage decrease in FPI results in a depletion of CFP by 0.248 and 1.058 in the long and short run. Furthermore, Fig. 4a shows that CFP would experience a consistent decline following a + 10 shock from the FPI in both the short-run and long-run. This decrease in CFP would alleviate the situation by around 17% to 1% in the long run. On the other hand, Fig. 4b shows that in the short-run, CFP would experience a consistent increase following a − 10 shock from the FPI. The effects of positive and negative shocks from the FPI would diminish as time passed. Studies conducted in Pakistan and Ghana by Koondhar, Aziz [25] and Linquist, Groenigen [63], respectively, reveal that the FPI significantly affects the output of the cereal crop and the economic development of these countries.

Fig. 4
figure 4

Cereal food production (lnCFP) and food production index (lnFPI)

The significance of the RPOP in food production lies in their role as the primary workforce engaged in farming activities, making them essential contributors to the overall food supply chain. The result in Table 7 shows a positive and significant relationship between the \(RPOP\) and \(CFP\) in the long run, with coefficients of 0.018 and a p-value of 0.000. This shows that cereal productivity increased by 0.018%, with a percentage change in the RPOP. Similarly, the RPOP has a positive and statistically significant short-term relationship with CFP, with a coefficient of 0.088 and a p-value of 0.000. This shows that a percentage increase in RPOP boosts CFP by 0.088%. RPOP is positively associated with CFP in Nigeria because agriculture, including cereal cultivation, is a primary source of livelihood and employment in rural areas, where most of the population resides [64, 65]. As mentioned earlier, the RPOP is an integral part of the food supply chain; the more significant the rural labor force, the higher the potential for increased agricultural productivity [66]. In contrast, prior studies diverge from this phenomenon and indicate a negative relationship between RPOP and agricultural production [11]. Figure 5 is based on the 10% positive and negative shocks of RPOP on cereal food production. From Fig. 5a, a 10% shock from the RPOP would significantly improve CFP from -38% to 2%. Similarly, a 10% negative shock from the RPOP would reduce CFP (see Fig. 5b). However, the effect of shock from the RPOP is more significant in the short run than in the long-run.

Fig. 5
figure 5

Cereal food production (lnCFP) and rural population (lnRPOP)

Overall, the system aligns towards the outcomes, with a speed of 0.50% towards long-term equilibrium. In other words, the ECT progression varies around the equilibrium path in a fading manner by 50% per year to the long-run equilibrium. The interpretation of our result follows Rehman, Ma [53], who reported a similar result for their \(ECT (-1)\). Moreover, the model is supported by the R2 \((0.78)\) and root MSE and is aligned with previous studies [60, 67, 68].

3.5 Diagnostic tests

Table 8 presents the results of the ARDL diagnostic tests. The results show that the Breusch-Godfrey LM test with four lags fails to reject the null hypothesis of no serial correlation at a 5% significance level. This confirms that the residuals of the estimated ARDL (1,0,1,0,0) model are free from autocorrelation. Additionally, the table presents evidence that the null hypotheses pertaining to homoskedasticity and normal distribution cannot be rejected at a significance level of 5%. This suggests that the residuals exhibit homoskedasticity. Figure 6a and b further confirm that the residuals estimated based on the ARDL (1,0,1,0,0) model are normally distributed.

Table 8 Diagnostic tests
Fig. 6
figure 6

Normality distribution test

Figure 7 plays a pivotal role in our study, allowing us to examine the accuracy, suitability, and consistency of the model's short and long-run coefficients. We validated these coefficients through the cumulative sum (CUSUM) and cumulative sum of squares (CUSUMSQ). In both plots, the significance threshold of 5% was met as the values fell between the upper and lower bounds, ultimately rejecting the null hypothesis. These results further solidify the ARDL long-run relationship between \(\text{CFP}\), \(\text{LCFP}\), \(\text{FERT},\) \(\text{FDI}\), and the \(\text{RPOP}\), which other scholars have already corroborated through the CUSUM and CUSUMSQ tests assessing the model's stability, goodness, and fitness [69,70,71].

Fig. 7
figure 7

Cumulative sum test using OLS CUSUM plot for parameter stability

4 Conclusion

Cereal foods such as maize, rice, sorghum, millet, and wheat are essential for Nigerians. However, rapid urbanization, population pressure, and high fertilizer costs substantially impact cereal crop productivity. Thus, this study examines ways to enhance cereal food output by focusing on fertilizer usage, farm labor, and cereal cropland area. The time-series data from 1980 to 2021 were used to estimate the novel DYARDLS method and explore the long-run and short-run relationships between the selected variables. Unit root tests were conducted to validate the stationarity of the variables. Additionally, the time series data showed no evidence of structural breaks. The cointegration test result indicated long-term relationships among the study variables with a significance level of 1%.

The estimated results showed that in the long run, increasing cropland by 1% leads to a 0.51% increase in cereal food output, and a 1% growth in the rural population results in a 0.018% increase in cereal production. The food production index decreases cereal production in both the long- and short-run. Moreover, fertilizer usage positively affects cereal food production, indicating that it could improve productivity by 0.018% and 0.009% in both the long and short term. A short-term increase of 1% in cereal cropland areas and farm labor would boost 0.25% and 0.088% in cereal crop output. When subjected to a 10% positive and negative shock from each regressor to the dependent variable, the impulse responses of each regressor were discovered to be significantly positive and negative. Furthermore, various diagnostic and robustness tests confirmed that the model was well-fitted and exhibited typical characteristics.

This study has come up with some policy recommendations that the Nigerian government should consider to increase cereal food production sustainably and achieve food security. Firstly, efforts must be made to optimize cropland utilization through land management practices, including land consolidation, improved irrigation systems, and sustainable farming techniques. Secondly, initiatives should be undertaken to improve the efficiency and affordability of fertilizer usage, such as subsidizing fertilizer costs for smallholder farmers and promoting organic fertilizers. Moreover, it is essential to educate farmers about the environmental effects of excessive use of chemicals and to encourage them to use agricultural biomass as a bioenergy source to reduce farm costs and promote a cleaner environment. Third, it is crucial to continuously monitor and enhance the food production index, ensuring that it accurately reflects the population's nutritional requirements and dietary preferences. Fourth, providing adequate rural infrastructure would help reduce rural–urban migration and increase farm labor and productivity. Finally, capacity-building and improving the resources of small-scale cereal farmers in rural areas would lead to increased cereal crop output, thereby promoting food security and rural development in Nigeria.

Upcoming studies should focus on the impact of these variables and other related variables on agricultural production and export. Our study relies solely on four variables influencing cereal production in Nigeria, excluding several other crucial variables. The omission of these variables is attributed to data unavailability issues. It is important to note that technological advancement also plays a significant role in agricultural productivity. Thus, more studies are needed to fill this literature gap and provide policymakers and stakeholders with evidence-based interventions for sustainable cereal production in Africa.