**2. Study area, data, and methodology**

### **2.1 Study area**

**Table 1** shows the geographical and some climate characteristics of the study area. The following nine meteorological stations in their respective agro-ecological zones in Nigeria are considered: Calabar, Warri, Ibadan, Makurdi, Lokoja, Ilorin, Yola, Kaduna, and Yelwa.

### **2.2 Data**


Since the NiMet data were supplemented as stated above, the Adapted Caussinus-Mestre Algorithm for homogenizing Networks of Temperature series (ACMANT) was used to check and correct the inhomogeneities in the quality controlled time series. A full scientific description of ACMANT setup could be found in [22]. Several studies included [22, 23], etc. have been effectively used ACMANT in homogenizing series. Good performances of homogenizing climatic series with ACMANT are noted in the result evaluation from these studies.


### **Table 1.**

*Area of study showing the stations, agro-ecological zones and climate characteristics.*

### **2.3 Methodology**

### *2.3.1 Growing season onset and cessation dates*

The determination of onset and cessation dates of growing season was carried out using the methods of [24, 25]. The onset date of growing season was defined by [24] for northern Nigeria as the date when accumulated daily rainfall exceeded 0.5 of the accumulated reference evapotranspiration for the remainder of the season, provided that no dry spell of 5 days or more occurred in the week after that date. The determination of onset date of rains according to [25] was from the first point of maximum positive curvature of the plotted graph of cumulative percentage of pentade rainfall, while cessation was from the last point of maximum negative curvature of the plotted graph of cumulative percentage of pentade rainfall. The method of [25] was initially used to determine the onset dates of growing season, while that of [24] was next used to ensure that no dry spell of 5 days or more occurred in the week after that date.

### *2.3.2 Reference evapotranspiration*

To determine the critical dry spells during each growing season, the daily reference evapotranspiration (ETo) was first computed using the FAO Penman-Monteith Equation [6]. This equation, given below (Eq. (1)), used the abovementioned data with the exception of daily rainfall.

$$ET\_o = \frac{0.408\Delta \left(R\_n - G\right) + \gamma \left(\frac{900}{T + 273}\right) u\_2 \left(e\_s - e\_a\right)}{\Delta + \gamma \left(1 + 0.34u\_2\right)}\tag{1}$$

where T—air temperature at 2 m height (°C), u2—wind speed at 2 m height (ms−1), es—saturation vapour pressure (kPa), ea—actual vapour pressure (kPa), (es – ea) saturation vapour deficit (kPa), Rn—net radiation at the crop surface (MJm−2 day−1), G—soil heat flux density (MJm−2 day−1), Δ—slope vapour pressure curve (kPa °C−1), γ—psychrometric constant (kPa °C−1).

The above equation determines the evapotranspiration (ETo) from the hypothetical grass reference surface. The effect of soil heat flux (G) is ignored for daily calculations [6] as the magnitude of the heat flux in this case is relatively small. The FAO Penman-Monteith method [6] is still used as the sole standard method as could be seen in recent research work on reference evapotranspiration included in [26, 27], etc. However, since the number of requested climatic variables is often not available under limited data conditions [28, 29], other simple ETo equations with less number of requested climatic variables have been used to compute ETo values that are close to the FAO Penman-Monteith method. These methods are the four of the Valiantzas equations, along with the Makkink, Calibrated Hargreaves, Abtew, Jensen-Haise, and Caprio equations and could be used as best alternative ETo estimation methods. These alternative equations could be used across the dry semi-arid and arid zones where water is the most limiting factor to food and fiber production [27].

The maize crop variety used in this study is the 118-day one whose phenology is as follows: 20 days for initial, 32 days for development, 38 days for mid-season, and 28 days for late season growth stages. This is based on the what is stated in [6] that the length of crop development stages provided in their table is indicative of general conditions; the user is therefore strongly encouraged to obtain appropriate local information.

*Critical Dry Spell Prediction in Rain-Fed Maize Crop Using Artificial Neural Network in Nigeria DOI: http://dx.doi.org/10.5772/intechopen.100627*

### *2.3.3 Dry day and critical dry spell definition*

It is usual to use rainfall thresholds higher than zero millimeter to define a dry day in order to account for the measurement errors or very little amounts of rain that are not available for plants or water resources, due to interception and/or direct evaporation [29, 30]. Different precipitation thresholds of 1–10 mm/day but fixed for the whole observation period are considered by most authors in analyzing long dry spells [30–33]. However, since the evaporation varies throughout the year and for different locations, fixed rainfall thresholds are not representative of real ground conditions. The net precipitation that is available for plants can be strongly modulated by atmospheric evaporative demands thereby affecting water stress levels by plants and crops [34–36]. Meteorological data from different approaches such as potential evaporation [37] or the reference evapotranspiration [6] can be used to determine atmospheric evaporative demand. Rivoire et al. [38] emphasized the need to take account of the atmospheric evaporative demand instead of making use of fixed rainfall thresholds for defining a dry day when analyzing dry spells with respect to agricultural impacts in particular. A dry day in this work is therefore taken as the day when the rainfall (RR) is less than the average reference evapotranspiration, ETo [38, 39]. A threshold of ETo is considered to define a dry day when RR–ETo ≦ 0 [38]. A number of these consecutive dry days constitute a spell. The critical dry spells are therefore those that occur at germination/emergence and establishment (initial stage), and close to and during the tasseling and flowering stage (mid-season stage). However, the critical dry spell prediction carried out in this work is for the mid-season stage only. **Figure 1** shows the time series of rainfall and mean reference evapotranspiration against day of the year from around planting date to harvesting date for maize crop for 1973 in Ibadan. Four critical dry spells during the mid-season are indicated. The minimum number of consecutive dry days that constitute a spell in this work is 3 days [40].

### *2.3.4 Artificial neural network (ANN) model*

### *2.3.4.1 Model description*

Artificial neural network (ANN) model was used in this work for the prediction of mid-growing season critical dry spell onset dates and lengths. ANN is a "black box" model of a type that is often used to model high-dimensional nonlinear data. It is a nonstatistical data modeling tool, which is contained in any version of R statistic or Matlab tool box. ANN is a highly interconnected network of machine learning algorithm based on the model of a human neuron. It mimics this model or structure by distributing its computations to small and simple processing units called artificial neurons or nodes [41, 42]. Artificial intelligence (AI) makes it possible for machines to learn from experience, adjust to new inputs, and perform human-like tasks. According to [42], ANN is data-driven, self-adaptive methods since there are few known assumptions about the models for problems under study unlike the traditional model-based methods. ANN model learns from examples and captures subtle functional relationships among the data even if the underlying relationships are unknown or hard to describe. This makes ANN very appropriate for problems whose solutions require knowledge that is not easy to state explicitly but for which there are enough observations [42]. Therefore, they can be treated as one of the multivariate nonlinear nonparametric statistical methods [43, 44]. After learning the data presented to them, ANN can generalize and often correctly infer the unseen part of a population even if the sample data contain noisy information. Since ANNs can compute the value of any continuous function to any desired accuracy as has been shown by [45–47], they are considered as universal functional approximators [42].

**Figure 1.**

*Time series of rainfall (RR in mm) and mean reference evapotranspiration (ETo in mm) from the onset date of growing season, OGS (in days of year) for 118-day maize crop to its harvesting time for 1973 in Ibadan. CDS1(4), CDS2(6), CDS3(9), and CDS4(6) represent the first, second, third, and fourth critical dry spells with lengths 4, 6, 9, and 6 days in brackets, respectively. Mean (1971–2013) reference evapotranspiration for growing season for maize is approximately 3.72 mm.*

ANN is made up of three layers of units, the input, hidden, and output layers. The ANN receives the input signal from the external world in the form of a pattern and image in the form of a vector. Each of the input is then multiplied by its corresponding weights. These weights are the details used by the ANNs to solve a certain problem. The activity of the input layer represents the raw information that is fed into the network, while the activities of each hidden layer are determined by the activities of the input layer and the weights on the connections between the input and the hidden layer. The behavior of the output layer depends on the activity of the hidden layer and the weights between the hidden and the output layers. To train the neural network models, the training parameters for the chosen algorithm must be specified in terms of the inputs, the number of hidden and output layer neurons, and the activation function of each layer [41, 48]. To fulfill these requirements, the correct number of regressor as well as the number of hidden neurons must first be selected but there are no specific rules for these selections [49, 50]. In many applications, the number of neurons for the hidden layer is selected based on trial-and-error method usually starting with small initial network [51]. A sample ANN architecture for first critical dry spell onset date prediction for Ibadan is shown in **Figure 2** having one input layer of nine neurons, two hidden layers—first of nine neurons and second of two neurons—and one output layer of one neuron. The inputs are multiplied by modifiable weights that are crucial parameters of the ANN models for solving a problem. ANN model could be run in R software—in R studio [52]. The neuralnet package (neuralnet) version 1.33 of August 5, 2016 [53] was used in this work. The training of neural networks uses the back-propagation, resilient back-propagation with [54] or without weight backtracking [55], or the modified globally convergent version by [56]. The package allows flexible settings through custom choice of error and activation function and it can combine fast convergence and stability and generally provides good results [55]. Furthermore, the calculation of generalized weights [58] is implemented. In this work, the default neural algorithm was used (i.e., "rprop+"). This refers to the resilient back-propagation with weight backtracking [54]. Amid the pool of the weight-updating process, the resilient back-propagation (RProp algorithm from the "nuerlanet" package in R) was chosen because it can combine fast convergence and stability and generally provides good results.

*Critical Dry Spell Prediction in Rain-Fed Maize Crop Using Artificial Neural Network in Nigeria DOI: http://dx.doi.org/10.5772/intechopen.100627*

**Figure 2.**

*A sample ANN architecture for first critical dry spell onset date prediction for 2008 for Ibadan, Nigeria.*

### *2.3.4.2 Prediction procedure*

The data attributes (predictors) used in the neural network model were maximum, minimum, and mean temperatures (Tmax), (Tmin), and (Tmean), relative humidity at 0600 (RH06) and 1500 (RH15) GMT, wind speed at 2 m level (u2), sunshine hours (n), net radiation (Rn), and reference evapotranspiration (ETo), while the data classes (predictands) were onset dates and lengths of critical dry spells. Net radiation and reference evapotranspiration were computed. In this work, the 43-year data were partitioned into two: 30 years for training and 13 independent years for testing. The test data were kept out of the process of producing the ANN model in order to test its predictive power [14]. This corresponds to approximately 70% (two-thirds) of data for training and 30% (one-third) for testing. Regarding the data partitioning, some authors have used two-thirds of data for training and one-third for validation and testing [57–59]. Dubey [58] used approximately half of one-third of data each for validation and testing. However, Mulualem and Liou [14] who worked on the application of artificial neural networks in forecasting a standardized precipitation evaporative index (SPEI) for the Upper Blue Nile Basin, Ethiopia (using RProp algorithm from the "neuralnet" package in R), partitioned their data into training and test sets. This method was applied in this work. The two independent datasets were chosen in such a way that early, normal, and late onset dates of critical dry spells were reflected in each of them. Likewise, the lowest, normal, and highest lengths of critical dry spells were also reflected in each of them. The neural network architecture consists of one input layer, one or two hidden layers, and one output layer. The input layer (first layer) of neurons consists of the nine attributes (predictors). The hidden layers of neurons are two (the second and third layers) and in few cases one. The hidden layer neurons are generally chosen starting with lower number neurons and varying by trial and error till the configuration that gives minimum root-mean-square error is attained. The output (third or fourth layer) layer consists of one neuron of either onset date or length of critical dry spell. Two hidden layer networks may provide more benefits for some type of problems [60]. Several authors addressed this problem and considered more than one hidden layer (usually two hidden layers) in their network design processes.

A cross-correlation analysis was performed to measure the relationship between the predictors (attributes) and the predictands (classes). Positive and negative relationships were observed, some with weak relationships. Based on the cross-correlations, seven different ANN models shown in **Table 2** below are put forward for each station with a view to measuring their predictive ability by


### **Table 2.**

*Input variables used in the attempt to get suitable models (M1–M7) for the prediction of onset dates and lengths of critical dry spells.*

comparing predicted values with the observed ones. A measure of ANN most suitable model performance on the basis of all statistical measures of the observed and predicted critical dry spell onset dates and lengths for the nine stations are shown in **Tables 3** and **4**. Out of the seven models used with these predictors, Model 1 having nine parameters was noted to be quite suitable for most of the stations, while models 2, 3, and 5 having eight, seven, and five parameters respectively were more suitable than Model 1 in some cases. Predictions (testings) were made for two regular mid-growing season critical dry spells (first and second) for all stations. Predictions were made on yearly basis on the twentieth (20th) day after the onset


### **Table 3.**

*A measure of ANN most suitable model performance on the basis of all statistical measures of the observed and predicted critical dry spell onset dates for the nine stations.*


*Critical Dry Spell Prediction in Rain-Fed Maize Crop Using Artificial Neural Network in Nigeria DOI: http://dx.doi.org/10.5772/intechopen.100627*

*Cal, War, Iba, Ilo, Lok, Mak, Yel, Kad, Yol—Calabar, Warri, Ibadan, Ilorin, Lokoja, Makurdi, Yelwa, Kaduna, Yola; M1 .. M7—Model1 .. Model7; On Date1, On Date2—First Onset Date, Second Onset Date; Len1, Len2— First Spell Length, Second Spell Length; RMSE—Root-Mean-Square Error; R2—Coefficient of Determination;*  **NSE***—Nash-Sutcliffe Coefficient of Efficiency; WIA—Wilmott's Index of Agreement; RSR—RMSE-Observations Standard Deviation Ratio.*

### **Table 4.**

*A measure of ANN most suitable model performance on the basis of all statistical measures of the observed and predicted critical dry spell lengths for the nine stations.*

dates of growing season for Calabar and Warri with use of 10-day average values of the attributes (predictors), that is, average taken from the eleventh (11th) day through twentieth (20th) day. However, for the remaining seven stations, yearly predictions were made for the first and second critical dry spell onset dates and lengths on the thirtieth (30th) day after the onset dates of growing season with the use of 10-day average values of the attributes (predictors), that is, average taken from the twenty-first (21st) day through the thirtieth (30th) day. The choice of the 10-day average of the predictors and the choice of the beginning date were basically by trial and error until good predictors were realized. The predictions made for the onset dates of critical dry spells were actually for the number of days before the occurrence of first and second critical dry spells from the 20th or 30th day after the onset dates of growing season. So, the onset dates of the critical dry spells in terms of days of the year should be onset dates of growing season (in days of the year) plus 20 days (for Calabar and Warri) or 30 days (for the remaining seven stations) plus the number of days before the occurrence of the critical dry spell. These are indicated in Eqs. (2) and (3) respectively below:

**For Calabar and Warri Stations (two station):**

$$\text{'CDS}\_{\text{OD}} \text{ (day of year) = OGS (day of year) + 20 + NaOH} \tag{2}$$

### **For Ibadan, Ilorin, Lokoja, Makurdi, Yelwa, Kaduna, and Yola Stations (seven stations):**

$$\text{CDS}\_{\text{OD}} \text{ (day of year)} = \text{OGS (day of year)} + \text{30} + \text{NoD} \tag{3}$$

where CDSOD (day of year)—Critical Dry Spell Onset Date in days of year, OGS (day of year)—Onset Date of Growing Season in days of year, and NoD—number of days before the occurrence of the critical dry spell.

For any year, the normalized attributes (predictors) were substituted in the prediction equations (not shown) derived from the neural network architecture involving the input (predictors), hidden, and output (predictands) neurons. Normalized values of the predictors were used in the equation to limit the output to a range between 0 and 1, making the function useful in the prediction of probabilities. Outputs of hidden layer neurons and output layer neuron were determined using Sigmoid Activation Function. The purpose of the sigmoid activation function is to introduce nonlinearity into the output of a neuron. Neural network has neurons that work in correspondence of weight, bias, and activation function. After prediction, the predicted values were converted to actual values by the removal of the normalization.

## **3. Results and discussions**

### **3.1 Warri and Calabar**

**Figure 3(a)** and **(b)** gives the *first and second* respectively yearly actual and predicted values of mid-season critical dry spell onset dates and lengths for Warri in the Mangrove Swamp agro-ecological zone. The actual and predicted values of the onset dates of first and second critical dry spells are actually the *number of days* before the occurrence of the critical dry spells *from 20th day* after the onset dates of growing season. So, the predicted onset dates of the critical dry spells in terms of days of the year should be onset dates of growing season (in days of the year) plus 20 days plus the predicted number of days before the occurrence of the critical dry spell (Eq. (2)). The prediction lead times for first and second critical dry spell onset dates range from 31 to 66 days for Warri and from 27 to 56 days for Calabar (figure not shown) as shown in **Table 3**. The range of errors during testing for onset dates and lengths for the first and second critical dry spells is generally ±4 days for Warri and for Calabar (figure not shown). The root-mean-square errors (RMSE), coefficient of determination (R2 ), Nash-Sutcliffe Coefficient of Efficiency (NSE), Wilmott's Index of Agreement (WIA), and RMSE-Observations Standard Deviation Ratio (RSR) for first and second critical dry spell *onset dates* for Warri range from 2.95 to 3.31, 0.83 to 0.86, 0.77 to 0.80, 0.92 to 0.95, and 0.42 to 0.47 days, respectively, while those for Calabar (figure not shown) range from 1.53 to 2.93, 0.75 to 0.82, 0.72 to 0.82, 0.89 to 0.95, and 0.40 to 0.50 days, respectively (**Table 3**). The RMSE, R2 , NSE, WIA, and RSR for the first and second critical dry spell *lengths* for Warri range from 0.46 to 0.93, 0.85 to 0.92, 0.69 to 0.82, 0.94 to 0.94, and 0.40 to 0.53 days, respectively, while those for Calabar (figure not shown) range from 0.74 to 0.97, 0.69 to 0.81, 0.67 to 0.77, 0.87 to 0.94, and 0.45 to 0.55 days, respectively (**Table 4**). The neural network architecture for the first and second onset dates and lengths of the critical dry spells for both stations are given in **Tables 3** and **4**.

Ogunrinde et al. [3] who applied ANN for forecasting Standardized Precipitation and Evapotranspiration Index (SPEI): A case study of Nigeria got an RMSE value of 0.7476 for Ikeja, a station in Lagos State, Western Nigeria in the same agro-ecological

*Critical Dry Spell Prediction in Rain-Fed Maize Crop Using Artificial Neural Network in Nigeria DOI: http://dx.doi.org/10.5772/intechopen.100627*

### **Figure 3.**

*Yearly prediction of (a) mid-season first critical dry spell onset dates and lengths (b) mid-season second critical dry spell onset dates and lengths in Warri. The critical dry spell onset dates are given in terms of the number of days before the critical dry spell occurrence from the 20th day after the onset dates of growing season.*

zone with Warri and Calabar. The two values are somehow close especially for the initial aspect of the range for the critical dry spell lengths even though the forecasts in the current work are for the onset dates and lengths of mid-season critical dry spells and not for SPEI. Dry spell onset dates and lengths prediction were not carried out by these and other researchers. So, on the 20th day after the onset date of growing season of any year in Warri and Calabar, maize farmers could be given yearly advance information on the dates of occurrence of first and second critical dry spells and their respective lengths for the mid-season (tasseling and flowering of maize). This would enable them make adequate preparations for their farming operations to ensure improved maize yield taking cognizance of the error margins.

### **3.2 Ibadan**

The yearly actual and predicted values of the *first and second* mid-season critical dry spell onset dates and lengths are shown in **Figure 4(a)** and **(b)** respectively for Ibadan in the Rain Forest agro-ecological zone. The actual and predicted values of the onset dates of first and second critical dry spells are actually the *number of days* before the occurrence of the critical dry spells *from 30th day* after the onset dates of growing season. So, the actual and predicted onset dates of the critical dry spells in terms of days of the year should be onset dates of growing season (in days of the year) plus 30 days plus the predicted number of days before the occurrence of the critical dry spell (Eq. (3)). The first and second critical dry spell onset date prediction lead times range from 15 to 37 days in Ibadan (**Table 3**). The range of errors during testing for onset dates and lengths for the first and second critical dry spells is generally ±4 days. The RMSE, R2 , NSE, WIA, and RSR for first and second critical dry spell *onset dates* for Ibadan range from 1.42 to 2.07, 0.70 to 0.80, 0.64 to 0.65, 0.90 to 0.93, and 0.56 to 0.57 days, respectively (**Table 3**), while those for first and second critical dry spell *lengths* range from 1.49 to 1.52, 0.75 to 0.78, 0.57 to 0.57, 0.79 to 0.86, and 0.62 to 0.65 days, respectively (**Table 4**). The neural network architecture for first and second onset dates and lengths of the critical dry spells for Ibadan are also given in **Tables 3** and **4**.

### **Figure 4.**

*Yearly prediction of (a) mid-season first critical dry spell onset dates and lengths (b) mid-season second critical dry spell onset dates and lengths in Ibadan. The critical dry spell onset dates are given in terms of the number of days before the critical dry spell occurrence from the 30th day after the onset dates of growing season.*

The result of the work of Morid et al. [15] regarding ANN forecast of Effective Drought Index (EDI) (6 months in advance) in Mehrabad station using nine input models gave validation RMSE values ranging from 0.55 to 1.51. Though the latitudes of Ibadan and Mehrabad differ and the target forecasts also differ, the range of RMSE values is somewhat close. The predictions of critical dry spell onset dates and lengths were not addressed by the researchers.

Therefore, on the 30th day after the onset date of growing season of any year in the station, maize farmers could be given advance information on the dates of occurrence of first and second critical dry spells and their respective lengths to enable them make informed preparations in their farming operations for enhanced maize yield taking note of the error margins.

### **3.3 Makurdi, Ilorin, and Lokoja**

**Figure 5(a)** and **(b)** shows the *first* and *second* respectively yearly actual and predicted values of mid-season critical dry spell onset dates and lengths for Makurdi in the Southern Guinea Savannah agro-ecological zone. The actual and predicted values of the onset dates of first and second critical dry spells are actually the *number of days* before the occurrence of the critical dry spells *from 30th day* after the onset dates of growing season. So, the predicted onset dates of the critical dry spells in terms of days of the year should be onset dates of growing season (in days of the year) plus 30 days plus the predicted number of days before the occurrence of the critical dry spell (Eq. (3)). The first and second critical dry spell onset date prediction lead times range from 20 to 44 days for Makurdi, those for Ilorin (figure not shown) range from 17 to 37 days, while those for Lokoja (figure not shown) range from 13 to 36 (**Table 3**). The range of errors during testing for onset dates and lengths of the first and second critical dry spells is generally ±4 days for each of the stations—Makurdi, Ilorin (figure not shown), and Lokoja (figure not shown). The RMSE, R<sup>2</sup> , NSE, WIA, and RSR for first and second critical dry spell *onset dates* for Makurdi range from 1.12 to 2.70, 0.75 to 0.79, 0.59 to 0.76, 0.82 to 0.94, and 0.46 to 0.61 days, respectively, those for Ilorin (figure not shown) range from 1.54 to 1.65, 0.70 to 0.86, 0.68 to 0.85, 0.91 to 0.96 and 0.37 to 0.53 days,

*Critical Dry Spell Prediction in Rain-Fed Maize Crop Using Artificial Neural Network in Nigeria DOI: http://dx.doi.org/10.5772/intechopen.100627*

### **Figure 5.**

*Yearly prediction of (a) mid-season first critical dry spell onset dates and lengths (b) mid-season second critical dry spell onset dates and lengths respectively in Makurdi. The critical dry spell onset dates are given in terms of the number of days before the critical dry spell occurrence from the 30th day after the onset dates of growing season.*

respectively, while those for Lokoja (figure not shown) range from 2.05 to 2.19, 0.58 to 0.79, 0.48 to 0.79, 0.88 to 0.94, and 0.44 to 0.69 days, respectively(**Table 3**). The RMSE, R<sup>2</sup> , NSE, WIA, and RSR for first and second critical dry spell *lengths* for Makurdi range from 1.83 to 1.83, 0.63 to 0.71, 0.55 to 0.63, 0.86 to 0.91, and 0.58 to 0.63 days, respectively; those for Ilorin (figure not shown) range from 0.79 to 2.05, 0.68 to 0.93, 0.51 to 0.90, 0.84 to 0.98, and 0.30 to 0.66 days, respectively, while those for Lokoja (figure not shown) range from 1.61 to 1.72, 0.78 to 0.82, 0.55 to 0.58, 0.83 to 0.87, and 0.61 to 0.64 days, respectively (**Table 4**). The neural network architecture for first and second onset dates and lengths of the critical dry spells for the three stations are given in **Tables 3** and **4**.

Ogunrinde et al. [3] in their work on ANN for forecasting SPEI: A case study of Nigeria (for drought matters) got an RMSE value of 0.5957 for Lokoja station. The difference in the values got for critical dry spell length in the present work is possibly as a result of different target forecasts—SPEI as distinct from mid-season critical dry spell lengths. Therefore, on the 30th day after the onset date of growing season of any year in the stations, maize farmers could be given yearly advance information on the dates of occurrence of first and second critical dry spells and their respective lengths. This would enable farmers make necessary plans for their farming operations for enhanced maize yield noting the prediction error margins.

### **3.4 Kaduna, Yelwa, and Yola**

The yearly actual and predicted values of *first* and *second* mid-season critical dry spell onset dates and lengths are presented in **Figure 6(a)** and **(b)** respectively for Kaduna in Northern Guinea Savannah agro-ecological zone. The actual and predicted values of the onset dates of first and second critical dry spells are actually the *number of days* before the occurrence of the critical dry spells *from 30th day* after the onset dates of growing season. So, the predicted onset dates of the critical dry spells in terms of days of the year should be onset dates of growing season (in days of the year) plus 30 days plus the predicted number of days before the occurrence of the critical dry spell (Eq. (3)). The prediction lead times for first and second

### **Figure 6.**

*Yearly prediction of (a) mid-season first critical dry spell onset dates and lengths (b) mid-season second critical dry spell onset dates and lengths respectively in Kaduna. The critical dry spell onset dates are given in terms of the number of days before the critical dry spell occurrence from the 30th day after the onset dates of growing season.*

critical dry spells range from 13 to 34 days for Kaduna. Those for Yelwa (figure not shown) range from 18 to 41 days, while those for Yola (figure not shown) range from 13 to 35 days (**Table 3**). The range of errors during testing for onset dates and lengths of the first and second critical dry spells is generally ±4 days for each of the stations—Kaduna, Yelwa (figure not shown), and Yola (figure also not shown). The RMSE, R<sup>2</sup> , NSE, WIA, and RSR for *onset dates* of first and second critical dry spells for Kaduna range from 2.37 to 2.67, 0.71 to 0.79, 0.65 to 0.74, 0.91 to 0.93, and 0.48 to 0.56 days, respectively. Those for Yelwa (figure not shown) range from 2.40 to 3.07, 0.71 to 0.72, 0.66 to 0.72, 0.91 to 0.91, and 0.50 to 0.55 days, respectively, while those for Yola (figure not shown) range from 2.46 to 3.16, 0.67 to 0.73, 0.57 to 0.64, 0.90 to 0.90, and 0.57 to 0.62 days, respectively (**Table 3**). The RMSE, R<sup>2</sup> , NSE, WIA, and RSR for first and second critical dry spell *lengths* for Kaduna range from 0.68 to 1.85, 0.76 to 0.89, 0.58 to 0.83, 0.83 to 0.94, and 0.39 to 0.61 days, respectively, those for Yelwa (figure not shown) range from 0.90 to 1.71, 0.67 to 0.78, 0.64 to 0.66, 0.89 to 0.89, and 0.55 to 0.59 days, respectively, while those for Yola (figure not shown) range from 0.93 to 1.65, 0.71 to 0.75, 0.62 to 0.67, 0.87 to 0.87, and 0.55 to 0.59 days, respectively (**Table 4**). The neural network architecture for the first and second onset dates and lengths of the critical dry spells for the three stations are also given in **Tables 3** and **4**.

Mulualem and Liou [14] in their work on ANN in forecasting SPEI for the Upper Blue Nile Basin in Ethiopia got RMSE value of 0.428 for Bahdir Dar of almost the same latitude with Yelwa, Nigeria. The value of 0.91–1.71 got for critical dry spell length got in the current work is somehow close. However, the difference in the values could be as a result of different target forecasts—SPEI as distinct from midseason critical dry spell lengths. Therefore, on the 30th day after the onset date of growing season of any year in the stations, maize farmers could be given advance information on the dates of occurrence of first and second critical dry spells and their respective lengths to enable them make adequate plans for their farming operations for improved maize yield. The prediction could be made using ANN on 30th day after growing season onset dates for these critical dry spells with 10-day average values of the predictors (attributes) taken from 21st to 30th day with minimum lead *Critical Dry Spell Prediction in Rain-Fed Maize Crop Using Artificial Neural Network in Nigeria DOI: http://dx.doi.org/10.5772/intechopen.100627*

times of about 2 weeks and maximum of about 2 month as given above (**Table 3**). To make predictions for any year, the predictors (attributes) are first normalized and substituted into the equation (not shown) derived from the neural network architecture involving the input, hidden and output layers, weights, and sigmoid activation functions. At the result stage, the normalization is removed to get the actual onset dates and lengths of the critical dry spells—predictands (classes).

## **4. Conclusions and recommendation**

The prediction of mid-season critical dry spell onset dates and lengths for 118 day rain-fed maize crop in Nigeria using ANN has yielded the following useful results that include the following: (a) the provision of yearly advance information on the number of days before the occurrence of first and second critical dry spells and their respective lengths on 20th day after the onset dates of growing season in Calabar and Warri; (b) the provision of yearly advance information on the number of days before the occurrence of first and second critical dry spell onset dates and lengths on 30th day after the onset dates of growing season in Ibadan, Ilorin, Lokoja, Makurdi, Yelwa, Kaduna, and Yola in Nigeria. The minimum prediction lead time is about 2 weeks, while the maximum is about 2 months. This information will aid yearly supplementary irrigation planning, scheduling, and various other decision makings related to sustainable agricultural operations for enhanced 118 day maize yield in the nine stations in Nigeria. For future work, it is recommended that more stations and longer years of data be used to ensure adequate training of ANN networks to realize better prediction results and gain more insight into dry spell occurrences during mid-growing seasons in Nigeria.

## **Acknowledgements**

We are grateful to Dr. Imoleayo Gbode for his technical assistance regarding the downloads and use of neuralnet package for this work. We are indebted to the former Director General/Chief Executive Officer of Nigerian Meteorological Agency (NiMet) and Dr. A. C. Anuforom, for the provision of the data used for this work. We thank immensely the former Director of West African Science Center for Climate Change and Adapted Land Use (WASCAL) of The Federal University of Technology, Akure, Nigeria, Prof. K. O. Ogunjobi, for granting permission for the use of its Internet facility. We place on record the technical assistance of Dr. O. Adeyeri on matters of data homogenization. The Director of the Centre for Continuing Education, The Federal University of Technology, Akure, Prof. E. C. Okogbue is highly appreciated for his good advice in this work and for the provision of some academic facility used for this work.

### **Conflict of interest**

The authors declare that they have no conflict of interest as regards the publication of this article.
