Copyright © the author(s). This work is licensed under a Creative Commons Attribution 4.0 International License. Improved Oil and Gas Recovery DOI: 10.14800/IOGR.1326 Received October 15, 2024; revised November 18, 2024; accepted December 2, 2024. *Corresponding author: christian.okalla@futo.edu.ng 1 Modelling Annual Natural Gas Demand Forecasting Using Non-Linear Autoregressive with Exogenous Input (NARX) Neural Networks Hussein Mohammed and Christian Emelu Okalla*, Federal University of Technology Owerri, Imo State, Nigeria Abstract Accurate natural gas demand forecasting is critical for ensuring efficient resource allocation, infrastructure planning, and energy security. This study presents the implementation of a NARX artificial neural network (ANN) model using MATLAB (R2022b) to forecast Nigeria’s natural gas demand. The NARX model, known for its capability to handle nonlinear time series data with external inputs, was applied using key variables such as population, GDP per capita, natural gas reserves, and price, with the target output being natural gas demand. The methodology involved data sourcing, cleaning, and normalization, followed by model training with the Levenberg-Marquardt (LM) algorithm in MATLAB, validation, and testing. Three different NARX configurations (NARX-1, NARX-2, and NARX-3) were tested, with sensitivity analyses conducted on the number of time delays and neurons to optimize the model's structure. Performance was evaluated using metrics like mean squared error (MSE) and coefficient of determination (R2), with results indicating that the NARX-1 model with 20 neurons achieved the best performance, boasting an R2 of 0.988. The result showed that natural gas demand in Nigeria has steadily increased over time, with fluctuations in response to global economic crises like the 2008 recession and the COVID-19 pandemic. Sensitivity analyses revealed that the NARX-1 configuration, with 20 neurons, provided the most accurate forecasting results based on its low MSE of 0.003396 and high R2 value of 0.988155, outperforming other models. These findings demonstrate the effectiveness of the NARX model for forecasting natural gas demand, making it a valuable tool for energy planning and decision- making in Nigeria. Introduction Energy plays a crucial role in the progress of societies and global economies, with its significance increasing due to factors such as economic growth, population expansion, and rapid urbanization worldwide (Toren 2023). There is a greater emphasis on energy modelling and forecasting within the energy sectors due to the government’s strict energy production regulations and growing environmental concerns. A reliable and consistent energy supply is crucial for a nation's economic and societal advancement. Therefore, policymakers need to understand the future energy needs to develop a plan for the country's energy provision (Sharma et al. 2021). Predicting energy consumption and demand, considering limitations such as resource availability, fuel costs, capacity needs, and investments, has become essential for managing the rising trend of energy use. mailto:christian.okalla@futo.edu.ng Improved Oil and Gas Recovery 2 Natural gas has long been considered a “cleaner” alternative to traditional fossil fuels like crude oil and coal due to its lower carbon footprint (Mohammad et al. 2021). It is often regarded as a more reliable power generation option compared to renewable sources such as solar and wind, owing to its consistent availability and ability to provide stable power output regardless of weather conditions (Lehner et al. 2023). Given its reliability and accessibility, natural gas is favoured for power generation, urban heating, public transportation, and manufacturing. As the global emphasis on decarbonization and sustainability grows, natural gas is expected to continue playing a significant role as an energy source. It is anticipated to play a pivotal part in the transition from fossil fuels to "green" and renewable energies, contributing significantly to the social and economic progress of nations and aligning with sustainable energy trends (Kuzemko et al. 2020; Zhukovskiy et al. 2021; Zaytsev et al. 2022). The energy shortage in Nigeria has been a longstanding concern for both the government and the populace (Omidih and Omotehinse 2020). Various interventions at the community, state, and national levels have had limited impact on addressing the energy challenges (Endurance et al. 2021). The Federal Government of Nigeria has made efforts to diversify the energy mix to include conventional energy generation, renewable energy technologies (RETs), and nuclear energy (Diemuodeke et al. 2021). However, despite these initiatives, the issue of energy scarcity persists, with demand for electricity outpacing supply (Bassey et al. 2022). The gas sub-sector, including power generation, petrochemicals, cement, and residential applications, has been identified as a critical area capable of driving the country's economic development (Agbonifo 2016). Natural gas is among Nigeria's abundant indigenous energy sources, making it essential to grasp how its demand will change to support rapid economic growth (Ekwueme et al. 2022). Given the growing importance of natural gas in the global energy landscape, there exists an intriguing research opportunity in developing quantitative demand models for this essential energy source (Cai et al. 2021; Liu et al. 2023). Forecasting natural gas demand holds immense importance in Nigeria's energy policy and planning. An inaccurate estimation of natural gas consumption can have significant repercussions, leading to economic losses for end consumers and mismanagement of supplies and infrastructure. This misestimation can result in disruptions in natural gas supply, causing substantial economic costs. For instance, disruptions in natural gas supply have led to losses in productivity in manufacturing industries, with reported losses amounting to billions of dollars (Duhalt 2022). Moreover, the nexus between natural gas consumption and economic growth is non-linear, emphasizing the importance of accurate estimations to ensure sustainable economic development (Sohail et al. 2021). Natural gas demand forecasting is a crucial aspect of energy planning, particularly in an industry marked by risks and uncertainties. It involves utilizing models to analyse historical data and offer insights into future energy demand trends (Petkovic et al. 2021). This process primarily deals with time-series forecasting, focusing on data points sampled at regular intervals (Hurn et al. 2023). The classification of natural gas demand modelling involves criteria such as the forecasting horizon, tools used, data types, and the specific area of application (Hong 2023). The forecasting horizon can range from hourly and daily to monthly, annually, or a combination of these periods. Methods for forecasting natural gas demand include analytical, statistical, artificial intelligence, and hybrid approaches (Manowska et al. 2021). Analytical or physical methods heavily rely on variables influencing natural gas consumption, including weather-related parameters (temperature, humidity, sunshine, wind speed), economic factors (Gross Domestic or National Product, gas prices), and demographic factors (general population, household composition, birth rate). These methods leverage mathematical equations to model interactions between input parameters and natural gas demand (Delcroix et al. 2021). However, due to the inherent non-linear nature of natural gas demand as a time series problem, analytical modelling becomes increasingly challenging (Rahmoune et al. 2021). This complexity has driven the development of new research techniques, such as statistical methods and artificial intelligence methods, as well as hybrid approaches, to address the evolving demands of forecasting in the energy sector. Artificial neural networks (ANNs) are widely used for natural gas demand forecasting, alongside other AI techniques like support vector machines, adaptive neurofuzzy inference systems (ANFIS), long short-term memory (LSTM), and meta-heuristic algorithms such as genetic algorithms and particle swarm optimization Improved Oil and Gas Recovery 3 algorithms (Panapakidis and Dagoumas 2017). ANNs are preferred due to their superior accuracy, especially in handling nonlinear datasets without predefined hypotheses. Understanding ANN architecture, including the combination and activation functions, is essential for effective utilization. Various ANN algorithms, such as multilayer perceptron (MLP), radial basis function neural network (RBF), and general regression neural network (GRNN), are commonly used for energy demand forecasting (Aruta et al. 2022). Dynamic ANNs, including recurrent neural networks like NAR, NARX, and LRN, are also effective in estimating nonlinear input-output correlations in time sequence data (Hassan et al. 2021). In this study, we employ a non-linear autoregressive with exogenous input (NARX) neural network model for natural gas demand forecasting. This model utilizes a multivariate approach incorporating input variables such as population, GDP per capita, average natural gas price, and gas reserves, with data specific to Nigeria. Materials and Method Materials. The implementation of the NARX ANN modelling was conducted using MATLAB (R2022b). MATLAB has various toolboxes specifically designed for neural network modelling, which covers areas such as neural net fitting, clustering, pattern recognition, and time series models. Neural net time series toolbox (in MATLAB) was deployed to address this nonlinear time series problem. Methods. The method employed in this study involves modelling and simulation to achieve the desired objectives. Specifically, the NARX model principle, its implementation strategy, and simulation processes are described in detail. The overall methods can be succinctly summarized through the block diagram provided in Figure 1. Figure 1—Methodology flowchart. The process begins with an explanation of the NARX model and its fundamental equation, followed by data preparation steps like sourcing, cleansing, and normalization to refine the dataset. Then, modelling involves training, validation, and testing, with sensitivity analyses determining the optimal model structure for forecasting based on input variables. ANN NARX Model. The NARX neural network, which stands for Non-linear Autoregressive Exogenous with External input, is a dynamic tool for time series modelling. It distinguishes itself by incorporating external inputs, enabling it to analyse relationships among current and past values of a time series and external data. With its high memory capacity, it effectively captures time-varying patterns in datasets (Alsumaiei 2020). Eq. (1) provides the mathematical representation of the NARX model, predicting the output f(t) based on input parameters x(t) and past values of the series y(t) and x(t). f(t) = f[x(t − 1), … x(t − d), y(t − 1) … . , y(t − d)],....................................................................................(1) The NARX model operates on the principle that the current value of y(t) is influenced by past values of both y(t) and x(t) (Necesito et al. 2022). In this model, inputs are linked to network weights, and adjustments to hidden neurons occur iteratively for different time delays. Network configuration is chosen to minimize mean square error (MSE). The hidden layer includes weight matrices connecting to other layers, each associated with specific NARX Model Description Data Preparation Modelling Sensitivity Analyses Forecasting Improved Oil and Gas Recovery 4 inputs and biases based on weight function rules. The net input, formed by combining the outputs of these weight functions with the bias using the net input function rule, drives the network. The NARX network is trained using MATLAB's Neural Net Time Series Toolbox, employing the hyperbolic tangent sigmoid function for activation in both hidden and output layers. Performance is assessed using metrics like MSE and R2. Successful training is indicated by minimal MSE and a high R2 value, ensuring the model's effectiveness for forecasting. Data Sourcing and Preparation. The dataset utilized in this study includes key inputs such as Nigeria ’s population, GDP per capita, natural gas price, and reserves, with the target output being natural gas consumption demand. Covering the period from 1975 to 2023, the data were obtained from multiple credible sources: population figures from the National Population Commission (NPC), GDP per capita data from the National Bureau of Statistics (NBS), natural gas prices from the Henry Hub Natural Gas Spot Price statistics, natural gas reserves from the Nigerian Upstream Petroleum Regulatory Commission (NUPRC), and natural gas demand metrics from the Nigeria Gas Company (NGC). This comprehensive dataset serves as the foundation for modeling and forecasting natural gas demand in Nigeria. Before training, thorough data cleaning and normalization were conducted to rectify errors and eliminate noisy data points. The specific dataset used for simulation is detailed in Table 1. The simulation dataset comprises forty-nine data points for both the input and target output datasets. Table 1—Simulation data. Year Population, billion GDP Per Capita M$/person NG Reserves TCM NG Price, $/Mmbtu NG Demand, BCM 1975 0.0710 0.442 1.2546 0.43 0.4000 1976 0.0727 0.562 1.24611 0.58 0.6300 1977 0.0746 0.541 1.224 0.79 0.5000 1978 0.0765 0.532 1.203 0.91 0.3800 1979 0.0786 0.668 1.183 1.18 1.3800 1980 0.0807 0.88 1.16114 1.59 1.0702 1981 0.0828 2.188 1.14698 1.98 2.1524 1982 0.0848 1.845 1.38501 2.47 1.4160 1983 0.0868 1.224 1.37 2.59 2.2996 1984 0.0888 0.903 1.355 2.66 2.7471 1985 0.0908 0.882 1.34 2.51 3.0586 1986 0.0929 0.639 2.4 1.94 3.2852 1987 0.0952 0.598 2.407 1.66 3.7015 1988 0.0974 0.55 2.476 1.68 3.7706 1989 0.0998 0.474 2.832 1.7 4.7007 1990 0.1022 0.568 2.84 1.7 3.7100 1991 0.1046 0.503 3.4 1.49 4.7579 1992 0.1071 0.477 3.7162 1.77 4.9007 1993 0.1096 0.27 3.683 2.12 5.0507 1994 0.1121 0.321 3.45 1.92 4.5506 1995 0.1147 0.407 3.474 1.72 5.1906 1996 0.1173 0.46 3.475 2.73 5.4608 Improved Oil and Gas Recovery 5 1997 0.1201 0.479 3.483 2.48 5.8508 1998 0.1229 0.468 3.512 2.09 5.9008 1999 0.1257 0.496 3.512 2.27 6.2109 2000 0.1287 0.565 4.106 4.31 6.7310 2001 0.1317 0.587 4.6327 3.96 6.2109 2002 0.1348 0.734 4.9973 3.36 6.3609 2003 0.1380 0.787 5.055 5.49 8.5112 2004 0.1413 0.993 5.2289 5.89 9.3213 2005 0.1447 1.25 5.1518 8.92 10.3615 2006 0.1483 1.652 5.207 6.72 10.9215 2007 0.1519 1.876 5.292 6.98 10.6015 2008 0.1557 2.228 5.292 8.86 12.2767 2009 0.1597 1.884 5.292 3.95 9.8457 2010 0.1637 2.28 5.1775701 4.39 5.0307 2011 0.1679 2.505 5.1755877 4 5.4008 2012 0.1722 2.728 5.1183801 2.75 14.3070 2013 0.1766 2.977 5.1070518 3.72 15.6932 2014 0.1819 3.201 5.3239875 4.37 18.3704 2015 0.1871 2.68 5.2842779 2.61 18.4446 2016 0.1924 2.145 5.4752043 2.49 18.1679 2017 0.1977 1.942 5.62687 2.96 12.7952 2018 0.2030 2.126 5.6749974 3.16 10.7556 2019 0.2033 2.334 5.626 2.57 12.7050 2020 0.2083 2.075 5.674 2.01 14.3610 2021 0.2134 2.066 5.76 3.85 15.1652 2022 0.2185 2.184 5.832 6.45 15.6425 2023 0.2262 0.211 5.91 2.57 15.9922 The NARX Modelling Technique. The modelling and forecasting of average annual natural gas demand was conducted using the NARX Model. Three distinct NARX configurations, denoted as NARX-1, NARX-2, and NARX-3, were analysed, with the numerical suffix indicating the number of time delays in each configuration. These time delays play a crucial role in measuring dataset autocorrelation, filtering nonlinear data, and aiding in prediction. Moreover, sensitivity analyses were performed on the number of neurons, exploring configurations with 5, 10, 15, and 20 neurons, respectively. The performance of the NARX models was systematically compared, and the most effective model, determined by considering both time delays and the number of neurons, was selected for forecasting. The NARX network was trained using the Levenberg-Marquardt training algorithm, involving multiple iterations and investigations. The dataset was divided into 70% training, 15% validation, and 15% testing data. The network structure for the NARX model, considering a time delay of 1 and 20 neurons, is depicted in Figure 2(a), while the step-ahead predictions (forecasting) are illustrated in Figure 2(b). Figure 2(a) illustrates the structure of the training model, with x(t) representing the input data and y(t) indicating the target (actual data) at 1. The artificial neural network time series model engages in simulation by analyzing the input and target to create a model that generates the modeled target y(t) from the provided output data during training. Implementation of the NARX model involves introducing a time delay, which excludes a certain number of data points from the beginning of the dataset. Specifically, a time delay of 1:1 means one data point was omitted from both the predicted output response (x(t)) Improved Oil and Gas Recovery 6 and the actual response (y(t)) after training. Additionally, the step-ahead prediction of the NARX model incorporates an additional future value, one step ahead, into the predicted output data, accounting for the forecasted value. (a) Open-loop view for training (b)One-step ahead prediction view Figure 2—ANN NARX Neural network. Model Performance Evaluation Metrics. The model's performance was evaluated using several metrics, such as mean squared error (MSE), coefficient of determination (R2), root-mean-square error (RMSE), mean absolute error (MAE), and mean absolute percentage error (MAPE). The formulas for these statistical parameters are as follows: R2 = ∑ (xa,i−xp,i) 2n i=1 ∑ (xp,i−xa,ave) 2n i=1 ,........................................................................................................................................(2) MSE = 1 n ∑ (xp,i − xa,i) 2n i=1 ,...............................................................................................................................(3) RMSE = √ 1 n ∑ (xp,i − xa,i) 2n i=1 ,.........................................................................................................................(4) MAE = 1 n ∑ |(xa,i − xp,i)|n i=1 ,.............................................................................................................................(5) MAPE = 1 n ∑ |(xa,i−xp,i)|n i=1 1 n ∑ xa,i n i=1 ....................................................................................................................................(6) Where n is the number of experimental runs, xp,i is the estimated values, xa,i is the experimental values, xa,ave is the average experimental values. Results and discussions Time Series Data Trends. The trends in the time series data were evaluated by plotting both the input and target output variables against the year. Figure 3 displays the trend of the time series data. In general, the analysis reveals a rising trend in natural gas demand over time, with notable declines in 2010, 2019, and 2020 due to global economic downturns such as the 2008 recession and the COVID-19 pandemic which impacted various economies and led to reduced natural gas prices in 2009. This demand is paralleled by continuous growth in population and natural gas reserves. Additionally, the GDP per capita of Nigeria shows fluctuations over time, with distinct phases of growth and decline, ultimately stabilizing at a relatively constant level. Improved Oil and Gas Recovery 7 Figure 3—Trend of time series data. Modelling Sensitivity Analysis. Sensitivity analyses were conducted to examine time-delays and the number of neurons, aiming to evaluate the parametric sensitivity of the models and understand the relationship between input variables and the target output response. Table 2 provides a summary of the results for the NARX-1 model. The analysis of Table 2 reveals that the optimal number of neurons for the NARX-1 model configuration is twenty. This conclusion is drawn from the more favorable training, validation, and testing mean squared error (MSE) and coefficient of determination (R2) values compared to other neuron sizes. Specifically, in the NARX-1 simulation with twenty neurons, it was observed that the training MSE was lower than that for validation and testing. Table 2—Detailed analysis of NARX-1 configuration to determine the optimal hidden neuron. Hidden Neurons Training Validation Testing MSE R2 MSE R2 MSE R2 5 0.01246 0.95645 0.00205 0.98430 0.05489 0.86708 10 0.03551 0.90439 0.02557 0.86814 0.39930 0.97414 15 0.00012 0.99602 0.01098 0.99600 0.06121 0.94387 20 0.00030 0.99879 0.00624 0.98866 0.00443 0.98624 From Table 3, it is evident that the optimal configuration for NARX-2, based on the training, validation, and testing MSE and R2 values, indicates that the most suitable number of neurons is twenty. This selection is justified by its combination of the lowest MSE and favorable R2 value. Therefore, for NARX-2, it is recommended to utilize twenty neurons to achieve a representative and accurate forecast. 0 0.05 0.1 0.15 0.2 0.25 1970 1980 1990 2000 2010 2020 2030 0 2 4 6 8 10 12 14 16 18 20 P o p u la ti o n , b il li o n P re d ic to rs Year GDP Per Capita M$/person NG Reserves TCM NG Price, $/MMbtu NG Demand, BCM Population, billion Improved Oil and Gas Recovery 8 Table 3—Detailed analysis of NARX-2 configuration to determine the optimal hidden neuron. Hidden Neurons Training Validation Testing MSE R2 MSE R2 MSE R2 5 0.01272 0.95707 0.00546 0.96256 0.03637 0.85711 10 0.00867 0.97535 0.01063 0.96176 0.08585 0.90522 15 0.03552 0.91218 0.01640 0.96999 0.06402 0.95897 20 0.00936 0.97063 0.01877 0.98297 0.06082 0.95263 Table 4 indicates that the NARX-3 model performs best with ten neurons, based on lower MSE values and higher R2 values across training, validation, and testing datasets. However, a comprehensive examination of Tables 2, 3, and 4 demonstrates that the NARX-1 model consistently outperforms others in terms of MSE and R2 values. This specific setup consistently achieves R2 values exceeding 0.99 and MSE consistently below 0.01, indicating exceptional performance. Consequently, the NARX-1 model with twenty neurons is chosen as the optimal configuration for forecasting natural gas demand. Table 4—Detailed analysis of NARX-3 configuration to determine the optimal hidden neuron. Hidden Neurons Training Validation Testing MSE R2 MSE R2 MSE R2 5 0.05716 0.86065 0.10037 0.68184 0.01806 0.98133 10 0.00245 0.99776 0.05905 0.76065 0.01373 0.97828 15 0.00032 0.99960 0.12961 0.73309 0.03558 0.85381 20 0.02158 0.97164 0.02063 0.83458 0.19178 0.61553 As shown in Figure 4, the increase in hidden neurons led to different mean squared errors (MSE) for the training, validation, and testing phases of the NARX network. Notably, the testing MSE appeared significantly larger than that of the training and validation sets, potentially due to the smaller dataset volume allocated for testing. The consistently low testing MSE values, closely aligned with the training MSE, suggest accurate model performance by the NARX network. Specifically, the NARX model with a 1-time delay exhibited the lowest MSE values for both training and validation, highlighting its superior performance. Improved Oil and Gas Recovery 9 (a) NARX-1 (b) NARX-2 (c) NARX-3 Figure 4—Determination of hidden neurons for NARX model using different models. Performance Evaluation of NARX Models. This section evaluates the performance of three NARX models: NARX-1, NARX-2, and NARX-3. Throughout the training process, the entire dataset experienced multiple passes referred to as epochs. An epoch serves as a parameter denoting the number of passes the LM algorithm makes over the complete training dataset. Each epoch involves a series of iterative processes to assess the model's performance, continuing until optimal performance is attained. In Figure 5(a), the dataset underwent 12 epochs, while for Figures 5(b) and 5(c), the datasets underwent 8 and 7 epochs, respectively. 0 0.1 0.2 0.3 0.4 0.5 5 10 15 20 M S E Hidden Neurons Training Validation Testing 0 0.02 0.04 0.06 0.08 0.1 5 10 15 20 M S E Hidden Neurons Training Validation Testing (b) 0 0.02 0.04 0.06 0.08 0.1 5 10 15 20 M S E Hidden Neurons Training Validation Testing Improved Oil and Gas Recovery 10 (a) NARX-1 (b) NARX-2 (c) NARX-3 Figure 5—Determination of the best validation performance for various models. In Figure 5, the validation performance of NARX-1, NARX-2, and NARX-3 models is analyzed. The Mean Squared Error (MSE) decreases across training, validation, and testing datasets with increasing epochs for each model. Notably, the optimal performance for NARX-1 is observed at epoch 8 with an MSE of 6.24 × 10-3, for NARX-2 at epoch 2 with an MSE of 1.134 ×10-2, and for NARX-3 at epoch 3 with an MSE of 3.36 × 10-2. The decreasing trend of MSE curves indicates prevention of overfitting. The time series plots in Figures 6(a) to (c) offer detailed insights into the NARX models in terms of output and target parameters. In Figure 6(a), it is evident that the NARX algorithm effectively trains the dataset, with residual errors from the training, validation, and testing outputs and targets all falling below 10%. This indicates that the NARX-1 model is well-suited for modelling the prediction of natural gas demand. Similarly, the NARX model with a time delay of two, as depicted in Figure 6(b), demonstrates significant potential in predicting both targets and outputs. The training, validation, and testing of the dataset show minimal residual errors, confirming (b) Improved Oil and Gas Recovery 11 the suitability of NARX-2 network configurations for time series modelling of natural gas demand. Figure 6(c) further illustrates that the NARX model with a 3-time delay configuration is also appropriate for predicting natural gas demand, supported by the minimal residual errors observed in the training, validation, and testing outputs and targets. (a) NARX 1 (b)NARX 2 (c) NARX-3 Figure 6—Time series-based prediction of average annual natural gas demand for various models. Pattern Trend Analysis of NARX Models. This section examines a regression analysis comparison between actual data and predicted target output responses for the three NARX models: NARX-1, NARX-2, and NARX-3. Figure 7 illustrates the non-linear fitting of actual data and the predicted output responses of the NARX-1 model. The figure demonstrates the capability of the Levenberg-Marquardt training model to fit the actual data to the predicted target output based on the input variables. Improved Oil and Gas Recovery 12 Figure 7—Comparison of the pattern of actual and predicted average natural gas demand for the NARX-1 model. Observing Figure 7 reveals that the predicted response output from the NARX-1 model closely mirrors the path of the actual data used for training, with minimal deviations. This observation suggests that the model effectively captures the general trend and patterns of the actual data and input variables. The close alignment between the trend lines indicates that the model has successfully predicted the target output values with a high degree of accuracy. Therefore, Figure 7 illustrates that the NARX-1 model, trained by the Levenberg-Marquardt algorithm, has effectively modelled the nonlinear relationship between the variables (including population, GDP per capita, natural gas reserves, and the average annual natural gas price as inputs, and the annual average natural gas demand as the target output). Figure 8 displays the trendline pattern of the NARX-2 model, illustrating the relationship between the actual data and the predicted target output. Trained using the Levenberg-Marquardt algorithm, the model closely aligns its predictions with the actual data, indicating successful pattern recognition and effective capture of the input- output relationship. Figure 8—Comparison of the pattern of actual and predicted average natural demand for the NARX-2 model. 0 2 4 6 8 10 12 14 16 18 20 1975 1985 1995 2005 2015 2025 A v er ag e A n n u al N at u ra l G as D em an d , b cm Year Actual Data NARX-1 Predicted 0 2 4 6 8 10 12 14 16 18 20 1970 1980 1990 2000 2010 2020 2030 A v er a g e A n n u a l N a tu ra l G a s D em a n d , b cm Year Actual Data NARX-2 Predicted Improved Oil and Gas Recovery 13 Figure 9 compares the pattern trendlines of the actual data with the predicted target output of the NARX-3 model, demonstrating its accurate modelling. This highlights the robustness of the NARX-3 model in effectively capturing the input-output relationship. Figure 9—Comparison of the pattern of actual and predicted average natural demand for the NARX-3 model. Table 5 indicates that the NARX-1 model outperforms NARX-2 and NARX-3 across all metrics considered. Notably, NARX-1 demonstrates a lower MSE (0.003396) and a higher R2 (0.988155) compared to the other models. Additionally, NARX-1 exhibits lower RMSE, MAE, and MAPE values. Consequently, NARX-1 is chosen for forecasting, while NARX-3 performs the least. These findings contrast with those of (Ayodele et al. 2021), who found better performance in NARX models with higher time-delays. Table 5—Overall performance summary of the NARX models. Metric NARX-1 NARX-2 NARX-3 MSE 0.003396 0.011074 0.011862 RMSE 0.058271 0.105233 0.108911 MAE 0.025333 0.041191 0.049559 MAPE 0.079376 0.080255 0.145622 R2 0.988155 0.961953 0.961411 Forecasting Performance of NARX Model. The NARX-1 model, identified as the best-performing among the NARX models, was chosen for forecasting average annual natural gas demand. Table 6 presents the forecasted values of future average annual natural gas demand based on the predictions made by the NARX-1 model. Table 6 displays the projected values of average annual natural gas demand over a 10-year period from 2024 to 2033. The forecasted natural gas demand ranges between twelve to eighteen billion cubic meters (bcm) for the specified decade. 0 2 4 6 8 10 12 14 16 18 20 1975 1985 1995 2005 2015 2025 A v er ag e A n n u al N at u ra l G as D em an d , b cm Year Actual Data NARX-3 Predicted Improved Oil and Gas Recovery 14 Table 6—Forecasted average annual natural gas demand. Year Forecast, bcm 2024 12.58929 2025 14.76996 2026 16.95775 2027 14.0357 2028 16.17459 2029 15.83146 2030 16.14099 2031 16.56538 2032 15.34007 2033 17.71746 Table 7 compares the performance of the NARX model in this study with similar studies in the literature, specifically focusing on forecasting energy demand. The NARX-ANN model utilized in this study demonstrates robust predictability, outperforming many other models with an R2 value of 0.988. This underscores the accuracy of the average natural gas demand forecast, with minimized prediction errors. Table 7—Comparison of the performance of the NARX model in this study and literature. Modelling Technique Country Forecasting target Performanc e Reference NARX model Nigeria Average Annual Natural Gas Demand 0.98816 This Study NARX model Malaysia Long term Final Energy Demand per Capita 0.99 Ayodele et al. 2021 NARX model USA Short-Term and Medium-Term Uncertainty for Electrical Load and Wind Speed 0.9964 Jawad et al. 2018 NARX model Nigeria Forecasting Volatility of Nigerian Crude Price 0.986 Gulumbe et al. 2016 NARX model Algeria Forecasting Natural Gas Prices 0.8918 Sahed et al. 2020 Conclusions The study utilized the non-linear autoregressive with external input (NARX) model to forecast the average annual natural gas demand in Nigeria. The NARX-1 configuration demonstrated superior accuracy with an R2 of 0.988, outperforming other configurations. Long-term projections indicated a consistent upward trend in natural gas demand, aligning with expected economic and demographic growth factors. The findings highlight the effectiveness of the NARX model in energy demand forecasting and its potential to inform strategic planning for Nigeria's natural gas sector. Overall, the research provides valuable insights for policymakers, energy planners, and researchers, facilitating informed decision-making and contributing to sustainable development initiatives. Improved Oil and Gas Recovery 15 Conflicting Interest The author(s) declare that they have no conflicting interests. References Agbonifo, P. E. 2016. Natural Gas Distribution Infrastructure and the Quest for Environmental Sustainability in the Niger Delta: The Prospect of Natural Gas Utilization in Nigeria. International Journal of Energy Economics and Policy 6(3): 442-448. Alsumaiei, A. 2020. A Nonlinear Autoregressive Modeling Approach for Forecasting Groundwater Level Fluctuation in Urban Aquifers. Water 12(3): 820. Aruta, G., Ascione, F., Boettcher, O., et al. 2022. Machine Learning to Predict Building Energy Performance in Different Climates. IOP Conference Series Earth and Environmental Science 1078(1): 012137. Ayodele, B. V., Mustapa, S. I., Mohammad, N., et al. 2021. Long-Term Energy Demand in Malaysia as a Function of Energy Supply: A Comparative Analysis of Non-Linear Autoregressive Exogenous Neural Networks and Multiple Non- Linear Regression Models. Energy Strategy Reviews 38(1): 100750. Bassey, C., Oduneka, A., and Ikpe, I. 2022. Electricity Consumption and Industrial Performance in Nigeria. Journal of Economics and Public Finance 8(2): 15-29. Cai, Y., Ma, X., Wu, W., et al. 2021. Forecasting Natural Gas Consumption in the US Power Sector by a Randomly Optimized Fractional Grey System Model. Mathematical Problems in Engineering 2021(1): 1-11. Delcroix, B., Ny, J. L., Bernier, M., et al. 2021. Autoregressive Neural Networks with Exogenous Variables for Indoor Temperature Prediction in Buildings. In Building Simulation 14: 165-178. Tsinghua University Press. Diemuodeke, O., Mulugetta, Y., Njoku, H., et al. 2021. Solar PV Electrification in Nigeria: Current Status and Affordability Analysis. Journal of Power and Energy Engineering 09(5): 1-25. Duhalt, A. 2022. Development of Mexico's Natural Gas Market: A Review of Key Policies from 1995 to 2018. Latin American Policy 13(1): 173-188. Ekwueme, S. T., Izuwa, N. C., Obibuike, U. J., et al. 2022. Development of Sustainable Energy Strategies for Nigeria's Power Sector. Energy Reports 8(1): 512-523. Endurance, O. S., Fasakin, J. O., Basorun, J., et al. 2021. Investigating Conjunctive Household Electric Power Supply in Ado-Ekiti, Nigeria. ARE Journal of Electrical and Electronics Engineering 1(1): 1-12. Gulumbe, S. U., Suleiman, S., Asare, B. K., et al. 2016. Forecasting Volatility of Nigerian Crude Price Using Non-Linear Auto-Regressive with Exogenous (NARX) Inputs Model. Imperial Journal of Interdisciplinary Research 2(5): 434-438. Hassan, M. A., Bailek, N., Bouchouicha, K., et al. 2021. Ultra-Short-Term Exogenous Forecasting of Photovoltaic Power Production Using Genetically Optimized Non-Linear Auto-Regressive Recurrent Neural Networks. Renewable Energy 171(1): 191-209. Hong, Z. 2023. A System Dynamic Model for Natural Gas Safety Supply and Demand Balance Mechanism. Energy Science & Engineering 11(10): 3768-3779. Hurn, S., Martin, V., and Tian, J. 2023. Modeling Multi-Horizon Electricity Demand Forecasts in Australia: A Comparison of Methods. Energy Economics 108(1): 105883. Jawad, M., Ali, S. M., Khan, B., et al. 2018. Genetic Algorithm-Based Non-Linear Auto-Regressive with Exogenous Inputs Neural Network (GA-NARX-NN) Short Term and Medium-Term Uncertainty Modelling and Prediction for Electrical Load and Wind Speed. The Journal of Engineering 2018(8):1-15. Kuzemko, C., Bradshaw, M., Bridge, G., et al. 2020. Covid-19 and the Politics of Sustainable Energy Transitions. Energy Research & Social Science 68: 101685. Lehner, M., Biegger, P., and Medved, A. 2023. Power-to-Gas: The Role of Chemical Storage in an Energy System with High Shares of Renewable Energy. Thermal Science and Engineering 6(1):201-220. Liu, H., Liu, Y., Yang, J., et al. 2023. Forecast of Natural Gas Consumption in Jiangsu Province Based on Combination Forecast. Paper presented at the Second International Conference on Electronic Information Engineering, Big Data, and Computer Technology, Xishuangbanna, China, 6-8 January. Manowska, A., Rybak, A., Dylong, A., et al. 2021. Forecasting of Natural Gas Consumption in Poland Based on ARIMA- LSTM Hybrid Model. Energies 14(24): 8597. Improved Oil and Gas Recovery 16 Mohammad, N., Mohamad Ishak, W. W., Mustapa, S. I., et al. 2021. Natural Gas as a Key Alternative Energy Source in Sustainable Renewable Energy Transition: A Mini Review. Frontiers in Energy Research 9(1): 625023. Necesito, I. V., Velasco, J. M. S., Jung, J., et al. 2022. Predicting COVID-19 Cases in South Korea Using Stringency and Niño Sea Surface Temperature Indices. Frontiers in Public Health 10(1): 871354. Omidih, L. and Omotehinse, S. 2020. Analysis of Factors that Influence the Calorific Value of Mangrove Wood for Electricity Generation Using Split-Split Plot Design. Nigerian Journal of Technology 39(1): 196-202. Panapakidis, I. P., and Dagoumas, A. S. 2017. Day-Ahead Natural Gas Demand Forecasting Based on the Combination of Wavelet Transform and ANFIS/Genetic Algorithm/Neural Network Model. Energy 118(1): 231-245. Petkovic, M., Koch, T., and Zittel, J. 2021. Deep Learning for Spatio-Temporal Supply and Demand Forecasting in Natural Gas Transmission Networks. Energy Science & Engineering 10(6): 1812-1825. Rahmoune, M. B., Hafaifa, A., Kouzou, A., et al. 2021. Gas Turbine Monitoring Using Neural Network Dynamic Nonlinear Autoregressive with External Exogenous Input Modelling. Mathematics and Computers in Simulation 179(1): 23-47. Sahed, A., Mekidiche, M., and Kahoui, H. 2020. Forecasting Natural Gas Prices Using Nonlinear Autoregressive Neural Network. IJ Mathematical Sciences and Computing 5(1): 37-46. Sharma, V., Cali, Ü., Sardana, B., et al. 2021. Data-Driven Short-Term Natural Gas Demand Forecasting with Machine Learning Techniques. Journal of Petroleum Science and Engineering 206(1): 108979. Sohail, H., Li, Z., Murshed, M., et al. 2021. An Analysis of the Asymmetric Effects of Natural Gas Consumption on Economic Growth in Pakistan: A Non-Linear Autoregressive Distributed Lag Approach. Environmental Science and Pollution Research 29(4): 5687-5702. Toren, B. 2023. Comparison of Building Energy Performance in Three Urban Sites Using Field Measurements and Modelling in Kayseri, Turkey. Journal of Physics Conference Series 2600(3): 032007. Zaytsev, A., Dmitriev, N., and Sebbaggala, T. 2022. Economic Aspects of Green Energy Development in the Context of Maintaining Strategic Sustainability and Environmental Conservation. IOP Conference Series Earth and Environmental Science 1111(1): 012080. Zhukovskiy, Y., Batueva, D., Buldysko, A., et al. 2021. Fossil Energy in the Framework of Sustainable Development: Analysis of Prospects and Development of Forecast Scenarios. Energies 14(17): 5268. Hussein Mohammed is a Petroleum Engineer and Data Analyst based in Port Harcourt, Nigeria, and a master’s student in the Department of Petroleum Engineering at the Federal University of Technology, Owerri. He has expertise in subsea engineering, reservoir management, project management, and process safety management. He holds a B.Eng. in Petroleum Engineering from Abubakar Tafawa Balewa University, Bauchi, and has contributed research in enhanced oil recovery and hydraulic fracturing. His professional interests include subsea engineering, reservoir analysis, hydraulic fracturing, and the development of sustainable energy practices. Christian Emelu Okalla, MSPE, MNSE, MCOREN is a Technologist and Researcher at the Department of Petroleum Engineering, Federal University of Technology Owerri. He holds both B.Eng and M.Eng in Petroleum Engineering from the Federal University of Technology Owerri, Imo State, Nigeria. His research interests are in drilling, production, natural gas, reservoir simulation.