1 Introduction

The assessment of groundwater levels in aquifers plays an essential role in groundwater resource management, and changes in their levels could inform determination of groundwater volume in aquifers. In arid regions, where the surface water resources are limited (Akbarzadeh et al. 2016; Bajany et al. 2021), groundwater resources are seen as a reliable supply for various water demands (Ghafari et al. 2020). Forecasting groundwater level allows water managers to assess groundwater resources to balance supply and demand in water resources management (El Bilali et al. 2021; Sattari et al. 2018; Sheikhipour et al. 2018).

A time series of groundwater levels provides information for the sustainable management of groundwater. Groundwater levels could be forecasted by usingdata-driven methods or a conceptual approach. Recently, data-driven methods have been demonstrated to perform well in modeling groundwater levels (Adiat et al. 2020; Kouziokas et al. 2018; Mirzavand and Ghazavi 2015. Physical and numerical models, stochastic, analytical, and soft computational techniques are used to forecast groundwater levels. Numerical and Artificial Intelligence (AI) methods have also been widely used to simulate groundwater levels over time (Chitsazan et al. 2013; Jalalkamali et al. 2010; Sreenivasulu et al. 2012). Some studies have compared the performance of various groundwater forecasting models (Ankita et al. 2021; Mirarabi et al. 2019; Malekzadeh et al. 2019).

Support Vector Machines (SVM) was suggested to forecast groundwater levels as it has the advantage in reducing computational complexity, susceptibility to overfitting, and the experimental nature of other artificial intelligence methods (Sujay Raghavendra and Deka 2015). In optimizing the parameters for SVM, most of the studies use the trial and error approach. Behzad et al. (2009) observe that Support Vector Machines (SVM) show better performance and consistency in training than the Artificial Neural Networks (ANN) in predicting groundwater levels. However, they apply a time-consuming trial and error method to optimize SVM parameters. Mukherjee and Ramachandran (2018) forecasted groundwater levels using SVR, ANN, and linear regression models with satellite parameters for Terrestrial Water Storage (TWS) and meteorological variables based on the GRACE satellite data. A trial-and-error approach was also used in this study to optimize parameters in the SVR method. These studies show that the Support Vector Regression (SVR) enjoys superiority over other intelligent black-box models in groundwater forecasting (Guzman et al. 2019). Liu et al. (2021) studied using the SVM model, data absorption (DA), and trial and error method to optimize SVM parameters predicted groundwater level changes. The results show that adding Gravity Recovery and Climate Experiment GRACE data as a variable can improve the performance of SVM. The SVM-DA model performed relatively better than SVM on most stations.

El Bilali et al. (2021) compared four models of machine learning: Support Vector Regression, k- Nearest Neighbor (k-NN), Random Forest (RF), and Artificial Neural Network (ANN) in predicting the groundwater level of the Tanubart aquifer in Morocco. The SVR model showed the best forecast accuracy with the smallest forecast error in one of the piezometers. Rahbar et al. (2022) compared SVR, ANFIS, and ANN models for Daily Karst Spring Discharge Prediction in Chaharmahal and Bakhtiari province. The results showed that the SVR performed better than other models in all stages. However, all the studies have used the trial-and-error method for optimizing SVR parameters. In contrast, the generalized capability of SVR relies heavily upon the optimal values of three learning parameters including the penalty factor (C), the kernel parameter (γ), and the permissible error (ε). These parameters are interdependent and a change in one parameter affects the other linked parameters (Deka 2014). The optimization of SVR parameters through trial and error is challenging and is limited in effectively decreasing errors in groundwater forecasts. Thus, a more robust optimization that considers the interdependence of parameters of SVR is required for better forecasting of groundwater levels.

One of the most powerful tools for representing a complex system is Bayesian Networks (BN). Since the BN can address uncertainty in the relationship between forecasting variables, its application in forecasting hydrologic processes has been growing recently (Aguilera et al. 2011). Yang et al. (2015) successfully implementated a Bayesian approach in water resources and environmental research. Farmani et al. (2009) used an integrated approach based on a Bayesian networks model and an Evolutionary Multi-Objective Optimization (EMO) to manage groundwater pollution in Copenhagen, Denmark. They observe that the method assists water managers in assessing the cost and benefit consequences of alternative measures and determining the best decisions under uncertain conditions. Moghaddam et al. (2019) forecasted groundwater level in the Birjand plain using BN, groundwater simulation model (MODFLOW), and ANN using 13 piezometer observations over 12 years. The results show that BN models produce better results compared to ANN and simulation models (MODFLOW). The BN model was also used to qualitatively predict an aquifer’s parameters (Ammar et al. 2009; Hantush and Chaudhary 2013). These studies show a growing number of applications of BN in forecasting groundwater.

Aquifers are important in supplying water for multiple needs, and the assessment of groundwater levels is critical to using and adequately managing water resources. The Support Vector Machine (SVM), Bayesian Networks (BN), and Support Vector Regression (SVR) have been identified as appropriate and efficient tools for forecasting groundwater levels, according to recent studies. The penalty factor (C), the kernel parameter (γ), and the permissible error (ε) are three learning parameters on which the critical capability of SVR firmly depends on these interdependently-allied parameters (Deka 2014). Therefore, the PSO algorithm was used to optimize SVR parameters for the first time in groundwater level prediction in this study. Moreover, RBF was used as a kernel performance due to its accuracy, efficiency, and excellent performance compared to the other kernel functions. The main objective of this study is to develop the SVR-PSO hybrid model and compare it with recent data-driven models (SVR and BN Models). Furthermore, the developed models for groundwater level forecast were examined through well-oriented and aquifer-oriented approaches.

2 Material and Methods

2.1 Method

In this study, all scenarios of modeling were performed under two approaches (aquifer-oriented and well-oriented). In the first approach (aquifer-oriented), the total volume of the aquifer is assessed by applying the Thiessen method (using a weighted average of the water level at 35 observation wells). Then, the total volume of the aquifer was forecasted in various modeling scenarios in this approach. In the second approach (well-oriented), these 35 observation wells were separately modeled (trained and tested). Then the aquifer hydrograph was derived using trained and tested values of the water level of the wells. This hydrograph was compared to the observed aquifer’s hydrograph, and the forecasting accuracy was examined. The second approach is distributed forecasting of groundwater levels in which changes in groundwater levels could be assessed in distributed wells. The SVR and SVR-PSO were programmed in MATLAB (2018). In both approaches, the groundwater level was forecasted through the three models (SVR, BN, and SVR-PSO), and their results were compared.

The results of the models were evaluated using monthly data from 35 observation wells in Zanjan plain, Iran, from 2004 to 2017. Data from 129 months were used for the training period (2004 to 2014) and 23 months for the testing period (2015 to 2017). The input variables of forecasting were precipitation, exploitation of groundwater (Discharge), temperature, evaporation, and groundwater level in the current month, and output was the groundwater level model in the next month. Different scenarios were used to assess the impacts of various inputs in simulation. For all models, five different scenarios were evaluated using input data. In the first scenario, all 5 input parameters were used for prediction. In the second scenario the evaporation parameter was removed due to it’s less importance than other parameters. In the third scenario, both evaporation and temperature were eliminated. In the next scenario, two parameters of discharge and groundwater level in this month were used for forecasting, and in the last scenario, the only groundwater level in the month was used for forecasting (Table 1). After modeling and conducting a verification test, the results obtained from the best scenarios in each model were compared. Finally, the results of the approaches were compared and analyzed. Figure 1 displays the models’ procedure, the number of scenarios, and methods.

Table 1 Different scenarios of input parameters to SVR-PSO, SVR, and BN models
Fig. 1
figure 1

Flowchart of the research procedure

2.1.1 Support Vector Regression (SVR) Model

The Support Vector Machine (SVM) is a supervised learning model developed by Vapnik in 1995 (Vapnik 2013). This model has been broadly used for classification and regression purposes (Hosseini and Mahjouri 2014; Mirarabi et al. 2019; Panahi et al. 2020). The SVM was first developed for classification and later expanded for regression analysis (Safavi and Esmikhani 2013). The objective of the Support Vector Regression (SVR) is to train the function F(x) for the training patterns x in which the trained values fall into the thickness curve (ε) to have the least error in the test (Smola and Schölkopf 2004). The minimization of structural risk in SVR is superior to conventional empirical risk minimization used in neural networks or classical statistical methods (Dai et al. 2012). Moreover, it cannot fall in local minimum error like neural networks because SVR can achieve the desired results with a small amount of data. As a matter of fact, adding unnecessary variables would create a more complex model than is required. Moreover, the complex model is susceptible to overfitting of training data. Therefore, SVR is a more authentic approach for regression with little-size datasets (Karimipour et al. 2019; Wu et al. 2008).

Given the dataset (\({x}_{n}.{y}_{n}\)), where \({x}_{n}\) and \({y}_{n}\) denoting independent and dependent variables respectively, and n = 1,2,3, …, N, in which N is considered to be the total number of input and output data pairs, the linear regression function can be written as follows (Elbisy 2015):

$$f\left(x\right)=\sum_{n=1}^{N}{w}_{n}{\varphi }_{n}\left(x\right)+b$$
(1)

The value of \({\varphi }_{n}\left(x\right)\) in Eq. (1) displays the features of input functions and \({w}_{n}\) and b are coefficients determined by minimizing Eq. (2) using Eq. (3) as constraints (Elbisy 2015):

$$P\left(f\left(x\right)\right)=\frac{C}{N}\sum_{n=1}^{N}{l}_{\varepsilon }\left({Y}_{n}.f\left({x}_{n}\right)\right)+\frac{{\parallel w\parallel }^{2}}{2}$$
(2)
$${l}_{\varepsilon }\left({Y}_{n}.f\left({x}_{n}\right)\right)=\left\{\begin{array}{c}0 if \left|{Y}_{n}.f\left({x}_{n}\right)\right|\le \varepsilon \\ \left|{Y}_{n}.f\left({x}_{n}\right)\right|-\varepsilon otherwise\end{array}\right.$$
(3)

In Eq. (3), \({l}_{\varepsilon }\left({Y}_{n}.f\left({x}_{n}\right)\right)\) is the insensitive loss function, and C is the regulator constant defined by the user, which determines the exchange curve between the smoothing model and experimental risk. The \(\varepsilon\) is permissible tolerance between observed and computed values. The \(\frac{{\parallel w\parallel }^{2}}{2}\) is a smoothing component. By introducing the slack variables \(\xi\) and \({\xi }^{*}\) in Eq. (3), the general form of optimization equation is formulated as follows (Elbisy 2015):

$$\begin{aligned}&\mathrm{min}\begin{Bmatrix}\varphi \left(w.b.\xi .{\xi }^{*}\right)=\frac{{\parallel w\parallel }^{2}}{2}+C\sum_{n=1}^{N}\left(\xi +{\xi }^{*}\right)\end{Bmatrix}\\ &s.t:\begin{cases}{Y}_{i}-w.\varphi \left(x\right)-b\le \varepsilon +{\xi }_{i}.{\xi }_{i}\ge 0\\ w.\varphi \left(x\right)-{Y}_{i}+b\le \varepsilon +{{\xi }_{i}}^{*}.{{\xi }_{i}}^{*}\ge 0\end{cases}\end{aligned}$$
(4)

To solve the above optimization model, a Lagrangian form of equations can be used. Based on the Lagrangian form, the regression equation can be written as Eq. (5) (Elbisy 2015).

$$f\left(x\right)=\sum_{n=1}^{N}({a}_{i} . {{a}_{i}}^{*})+K({x}_{i}.x)+bs.t: 0\le {{a}_{i}}^{*}\le C 0\le {a}_{i}\le C$$
(5)

In which \(K\left({x}_{i}.x\right)\) is the kernel equation that can be used to solve the problem in N-dimensional space (Eq. (6)) (Elbisy 2015; Suryanarayana et al. 2014).

$$\begin{aligned}K\left({x}_{i}.x\right)&=\mathrm{exp}\left(\frac{{\parallel {x}_{i}-x\parallel }^{2}}{2{\gamma }^{2}}\right) &RBF\\K\left({x}_{i}.x\right)&= {x}_{i}.x &\mathrm{linear }\\ K\left({x}_{i}.x\right)&={(1+{x}_{i}.x ) }^{q}&\mathrm{polynomial}\end{aligned}$$
(6)

The radial basis function (RBF) kernel was used in this study since Several studies reported that the RBF kernel equation produces the best results compared to other existing kernels such as linear, polynomial, and sigmoid (Al-Fugara et al. 2020; Jin et al. 2021; Rajaee et al. 2019). Three numbers assigned to parameters ε و C. γ obtained by trial and error method and 27 states were evaluated as the total permutations for parameters\(\varepsilon \left(0.1 . 0.01 . 0.001\right). C\left(10 . 100 . 1000\right). \gamma (1 . 0.1 . 0.01)\). The best model corresponds to the least RMSE error in the test.

2.1.2 The Development of (SVR-PSO) Model

Although the SVR model is superior to artificial intelligence and statistic models, the parameters of the model require optimization to have desired results (Xiong and Xu 2006). In this study, the PSO optimization algorithm was applied to minimize RMSE in the test phase and determine the desired SVR parameters, and the SVR-PSO hybrid model was developed (Fig. 2). The performance of the SVR-PSO hybrid model was evaluated using RMSE.

Fig. 2
figure 2

Flowchart of GWL forecast using PSO-SVR hybrid model

The Particle Swarm Optimization (PSO) algorithm is an evolutionary computation technique (Kennedy and Eberhart 1995). This technique is based on the flock of birds (considered to be particles), with each bird searching for least distance in the search-space solutions, seeking food considered to be the best solution. Firstly, particles are positioned in the search space of the N-dimensional problem. The objective function in each particle’s current position could be estimated by each of these particles, demonstrating a potential solution. Then, particles repeatedly fly in the swarm to search for the best solution. The pbest and gbest are the best positions obtained by the particle and swarm, respectively. The next position of each particle is updated by gbest and pbest, seeking the most desired performance (Poli et al. 2007). This algorithm is commonly used in optimization problems due to its simplicity and excellent capability (Li et al. 2018; Patil et al. 2019; Shourian et al. 2008). The procedure of forecasting groundwater levels using SVR-PSO is as follows:

  1. 1.

    Setting the first value for iteration i = 0, and dividing the dataset (152 data) into two groups; training and testing (129 samples for the training period and 23 samples for the testing period).

  2. 2.

    Normalizing the entire datasets (training and testing data) at the interval of [0,1] using Eq. (7) to enhance the ability of the model for identification of inputs and outputs relationship (Zounemat-Kermani et al. 2016):

    $${X}_{ik}=\frac{{x}_{ik}-{X}_{ik}^{min}}{{X}_{ik}^{max}-{X}_{ik}^{min}}$$
    (7)

    where \({X}_{ik}\)، \({x}_{ik}\)، \({X}_{ik}^{max}\) and \({X}_{ik}^{min}\) are the normalized value, the main value, the maximum and minimum values of variable k in the dataset, respectively.

  3. 3.

    Randomly determining the position and velocity of each particle and also learning parameters (inertia weight and the maximum number of iterations) in PSO.

  4. 4.

    Computing the SVR value function (RMSE Test) for each particle in its current position.

  5. 5.

    Computing the current performance value for each particle and evaluating its improvement compared to prior pbest (update pbest, otherwise pbest remains unchanged).

  6. 6.

    Comparing new pbest values with gbest value, update the gbest if the new pbest presenting a better value than gbest value, otherwise gbest remains unchanged.

  7. 7.

    Computing and updating the velocity and position of the particle, respectively.

  8. 8.

    Adding a number to iteration (i = i + 1).

  9. 9.

    If the iterative termination criterion is not satisfactory, go to step 5; otherwise, gbest presents the best-optimized parameter of SVR (Hasanipanah et al. 2017).

Modeling by SVR-PSO hybrid model was similar to SVR model except that the parameters \(\varepsilon \mathrm{and} C.\gamma\) were optimized employing the PSO algorithm. The range of optimization for each particle should be determined to optimize in the PSO algorithm and obtain the optimal point. The number of particles and the maximum number of necessary iterations in the SVR-PSO hybrid model were 100 and 1000, respectively. Stopping occurs when there is no significant difference in the rate of optimization between two consecutive iterations. This value is considered by the program at 10^-6. But if the optimization does not reach the desired point, the optimization should be removed from the program after a certain number of iterations to avoid the infinite loop. Most optimizations in this article reached a desired point at around100 repetitions, to ensure this value 1000 repetitions were considered.. Ranges of parameters are: ɛ—(0 to 1); ɣ—(0.0001 to 1), and C—(1 to 1000).

2.1.3 Bayesian Network

Judea Pearl first introduced the BN model in 1988 (Pearl 1988). The foundation of this model is based on the Bayes rule presented by Thomas Bayes in the eighteenth century (Aguilera et al. 2011; Uusitalo 2007). The advantage of this model is its application risk and uncertainty analyses compared to the other data-driven models, which merely give the forecasted values (Aguilera et al. 2011). Laplace developed this theory and the probabilistic logic was determined based on this theory (Farmani et al. 2009). If E and F are assumed events which P(E) ≠ 0 and P(F) ≠ 0, then:

$$\mathrm{P}\left(\mathrm{E}|F\right)=\frac{\mathrm{P}(\mathrm{E})\mathrm{ P}(\mathrm{F}|\mathrm{E}) }{\mathrm{P}(\mathrm{F})}$$
(8)

The BN model provides forward and backward computation for analysis. The effect of each of the input variables on the outputs of the model could be determined by forecasting the targeted variable applying the status of the input variables in combination with having forecasted variable status (Aguilera et al. 2011; Uusitalo 2007). The BN model comprises a series of interconnected nodes that examine both occurrence and non-occurrence for each process. The joint probability distribution of n events, including \({E}_{1}.{E}_{2}.\dots .{E}_{n}\) where P(E) ≠ 0 for \(1\le i\le n\) obtained from Eq. (9) (Roozbahani et al. 2018):

$$\mathrm{P}\left({E}_{i}|F\right)=\frac{\mathrm{P}({\mathrm{E}}_{i})\mathrm{ P}(\mathrm{F}|{\mathrm{E}}_{i}) }{\mathrm{P}(\mathrm{FP}\left({\mathrm{E}}_{1}\right)\mathrm{P}\left(\mathrm{F}|{\mathrm{E}}_{1}\right)+\mathrm{P}\left({\mathrm{E}}_{2}\right)\mathrm{P}\left(\mathrm{F}|{\mathrm{E}}_{2}\right)+\dots +\mathrm{P}({\mathrm{E}}_{n})\mathrm{ P}(\mathrm{F}|{\mathrm{E}}_{n}))}$$
(9)

The GeNie software was used in this study for modeling, training, and validation. The Path Condition (PC) and Necessary Path Condition (NPC) algorithms are the most commonly used in training due to their simplicity.

2.1.4 Performance Criteria for Model

The performance of the developed models is evaluated using statistical indicators such as coefficient of determination (\({R}^{2}\)), Root Mean Square Error (RMSE) (Nossent and Bauwens 2012). RMSE and \({R}^{2}\) used not only to evaluate the accuracy of the models but also to compare them in this study as given in Eqs. (10)–(11) (Krause et al. 2005; Wunsch et al. 2018).

$$RMSE=\sqrt{\frac{1}{n}\sum_{i=1}^{n}{({P}_{i}-{O}_{i})}^{2}}$$
(10)
$${R}^{2}={\left(\frac{\sum_{i=1}^{n}({P}_{i}-\overline{P })({O}_{i}-\overline{O })}{\sqrt{\sum_{i=1}^{n}{({P}_{i}-\overline{P })}^{2}}\sqrt{\sum_{i=1}^{n}{({O}_{i}-\overline{O })}^{2}}}\right)}^{2}$$
(11)

where \({P}_{i}\) indicates the forecasted values, \({O}_{i}\) is the observed values, \(\overline{P }\) indicates mean predicated values, \(\overline{O }\) indicates the mean observed values. The RMSE shows the difference between the observed and the predicted value. The RMSE increases from zero to large positive values as the difference between predicted and observed values increases. A relatively low amount of RMSE and a high amount of \({R}^{2}\) (up to one) indicate an efficient model (Rezaie-Balf et al. 2017).

2.2 Study Area

The aquifer studied is located in Zanjan plain of Iran, at coordinates 48° to 48°60′ E and 36°20′ to 37°N, with an area of approximately 2154 km2. This aquifer is one of the most important water resources for agricultural, industrial, and drinking purposes due to its proper water supply and lack of reliable surface water resources in the region. The annual water consumption is 490 MCM, in which 400 MCM of this amount is supplied from the aquifer.

The geographical location of the Zanjan plain and observation wells are illustrated in Fig. 3. This aquifer is in critical situation facing a 0.54-m annual drop due to overexploitation and recent droughts. The general slope in this plain surface is declining from southeast to northwest. Groundwater levels are between 1,540 and 1,800, dropping from east to west. The average annual temperature in central areas is 11 and in high land is 8 degrees °C. The maximum precipitation of 600 mm occurs in the southwest, and the minimum precipitation of 250 mm is in the northwest.

Fig. 3
figure 3

The geographic location of the Zanjan aquifer

3 Results and Discussion

A lack of a simple relationship between input and output data is one of the error sources in data-driven models. Thus, various combination input variables (different scenarios) should be examined to find the optimal variable for the data-driven models. To have a better groundwater level forecast and determine the optimal input variables, five different scenarios of input variables combination were tested for the BN model. Precipitation, discharge, temperature, evaporation, and groundwater level (GWL) in the current month are five forecasters used to forecast the groundwater level in the next month (NMGWL). Figure 4 shows the BN structure. Five different scenarios of the input data were examined in the forecasting by SVR, and SVR-PSO hybrid models are shown in Table 1.

Figure. 4.
figure 4

BN structure for the groundwater level forecast

3.1 Comparison of the Models in the First Approach (Aquifer-Oriented)

Various scenarios were assessed for the three models in each approach, and the superior scenario was selected based on the least RMSE value. Figure 5 displays the results of the forecasted groundwater hydrograph for the best scenario of the three models for the aquifer-oriented approach in the testing period. The results showed that in the first approach, the error in the SVR model was higher than the BN model. However, SVR optimization parameters and developing SVR-PSO led to a better result, and thus the best outcome was achieved using this model among the three models.

Fig. 5
figure 5

Comparison of observed and forecasted groundwater level during the test period for aquifer-oriented approach

The results of the models for the first approach are presented in Table 2. Due to an excellent coefficient of determination (\({R}^{2}\)) in most models, the RMSE test is used as the criterion for comparison. Table 2 shows that the models were appropriately performed in the training period, and thus examined in the testing period. The second scenario in the SVR-PSO hybrid model using four parameters, precipitation, discharge, temperature, and groundwater level in a month, showed the least RMSE compared to the other scenarios in all three models.

Table 2 Comparison of the performance criteria of SVR-PSO, SVR, and BN models in the aquifer-oriented approach and optimized parameters SVR

Overall, the hybrid SVR-PSO hybrid model can accurately forecast the groundwater level in the aquifer, and the coefficient of determination for all scenarios is higher than 0.8, except scenario 5. The value of coefficients signifies a good correlation between the observed and forecasted groundwater levels. Scenario 2 of the SVR-PSO hybrid model produced the best results having \({R}^{2}\) = 0.873 and RMSE = 0.221 m amongst all models and developed scenarios for the aquifer.

3.2 Comparison of the Models in the Second Approach (Well-Oriented)

After modeling and optimizing its parameters, each well played a key role in deriving the aquifer’s hydrograph in the second approach (well-oriented). In other words, all models were first trained and tested using all observation wells in each scenario, then the particular values of \(C.\gamma\) and \(\varepsilon\) found for each well in the study area. Finally, the hydrograph for the aquifer was derived by the Thiessen method using the forecasted groundwater level.

Table 3 shows the results of the well-oriented approach. The coefficient of determination (\({R}^{2}\)) was used for the training period in all different methods and scenarios, i.e., its value was greater than 0.9. The coefficient of determination (\({R}^{2}\)) in the testing period in all SVR and SVR-PSO hybrid models except scenario 5 was desired. Scenario 2 of the SVR-PSO hybrid model demonstrated the best training and testing RMSE values, which were 0.2024 and 0.2194 m, respectively. Moreover, the BN model displayed the worst results in the well-oriented approach.

Table 3 Comparison of the performance criteria of SVR-PSO, SVR, and BN models in the well-oriented approach

Different scenarios were assessed for the models in a well-oriented approach, and the ideal scenario was selected as a scenario having the least RMSE value among all scenarios of each model. Having compared observed and forecasted groundwater levels in a well-oriented approach (Fig. 6), the superiority of the SVR model over BN was observed. Moreover, forecasted groundwater levels are close to observed values in SVR-PSO hybrid models and forecasted value using the SVR model is better than the BN model. Generally, the SVR and SVR-PSO provide more accurate predictions for the groundwater level in the study case. On the other hand, the BN model estimates groundwater levels higher than actual values. Additionally, the best values were obtained by applying the SVR-PSO hybrid model to forecast groundwater level.

Fig. 6
figure 6

Observed and forecasted groundwater levels in test period for well-oriented approach

Table 4 displays the averaged performance criteria for 35 observation wells for the superior scenarios of the models in a well-oriented approach. The BN method shows the worst results indicating that the performance of the model was not desired for the wells. The accuracy of BN for observation wells declines for wells in which groundwater levels temporally fluctuate (Kardan and Roozbahani 2016; Moghaddam et al. 2019).

Table 4 The average of SVR-PSO, SVR, and BN performance criteria for 35 observation wells in the present study

The superior scenario of the models in a well-oriented approach was selected, and the percentage of best performance criteria for 35 observation wells are compared in Table 5. The superiority of models in the second approach (well-oriented) is defined by the percentage of the best performance criteria for each model in groundwater forecasts. Moreover, the RMSE test values were less in 88.75% of cases of SVR-PSO forecasts compared to the other two models (Table 5). Generally, applying the SVR model shows an accurately proper performance; however, overfitting errors could occur in this model. Thus, using the PSO optimization algorithm and optimizing SVR parameters assist forecast with excellent performance.

Table 5 Percentage of the superiority of SVR-PSO, SVR, and BN models in 35 observed wells

Groundwater level forecast is a critical element in groundwater resource consumption. Determining an appropriate approach with the least inaccuracy in groundwater level forecasting could support better water management. Each well-oriented and aquifer-oriented method enjoys its advantages and disadvantages, which could be used depending on the forecasting purpose. The very low computational complexity is considered one of the benefits of the aquifer-oriented approach compared to the well-oriented method. Moreover, high computations, particularly in large aquifers with numerous observation wells, are a drawback for the well-oriented approach. Reasonably faster modeling and acceptable results obtained in the aquifer-oriented approach is due to not having severe fluctuations in the aquifer’s averaged groundwater level. However, only the general state of the aquifer could be obtained in the aquifer-oriented approach demonstrating its serious disadvantages. Thus, changes in groundwater level cannot be acquired in a distributed manner as obtained in a well-oriented approach. Having compared observed and simulated groundwater levels using aquifer-oriented and well-oriented approaches in the Bayesian model, the results of the aquifer-oriented approach were more accurate than a well-oriented approach. Nonetheless, the correlation and accuracy of the two approaches in the SVR-PSO hybrid model were similar, and scenario 2 in this model yields the best results. Therefore, the first approach is perceived as a proper solution for more precise decision-making and water resources management in the region and similar aquifers.

4 Conclusion

Considering the importance and sensitivity of groundwater levels in water resource management, the accuracy of groundwater level forecasting is critical. Therefore, in this study, the efficiency of various forecasting models is assessed to determine a more accurate groundwater level forecaster. Three BN, SVR, SVR-PSO hybrid models were developed in this study, considering different scenarios for two well-oriented and aquifer-oriented approaches. Monthly groundwater levels in a vital aquifer from 2015 to 2017 (23 months) were forecasted to examine the developed models.

The SVR-PSO hybrid model presented the best performance compared to the developed models. Moreover, the highest correlation was observed between observed and forecasted groundwater levels in the SVR-PSO hybrid model. The results showed that SVR is better at modeling groundwater levels than the BN model. The use of the PSO optimization algorithm hastens finding the optimal parameters of the SVR model, leading to an increase in the speed of modeling and an improvement of the results. The analysis of the results showed that the SVR-PSO hybrid model in both well-oriented and aquifer-oriented approaches could produce better results than the other two models. In the aquifer-oriented approach, the SVR-PSO hybrid model could forecast groundwater level in the next month with RMSE training and testing of 0.188 and 0.266 m, respectively. However, the SVR-PSO hybrid model showed a better performance even in the well-oriented approach than the other two models. Thus, the proposed SVR-PSO hybrid model works better in both well-oriented and aquifer-oriented approaches.

The aquifer’s hydrograph obtained by the SVR-PSO hybrid model displays that this model has a great ability to forecast groundwater levels. The high correlation and low RMSE value indicate that the SVR-PSO hybrid model could be reliably applied for the groundwater forecast. Therefore, forecasting groundwater levels using the SVR-PSO hybrid model in the first approach (aquifer-oriented) can be applied as a forecasting tool for decision support systems used by managers and water resource stakeholders to address water scarcity in similar aquifers.