Forecasting of Rainfall in Central Java using Hybrid GSTAR-NN-PSO Model

. Forecasting of rainfall trends is essential for several fields, such as airline and ship management, flood control and agriculture. The rainfall data were recorded several time simultaneously at a number of locations and called the space-time data. Generalized Space Time Autoregressive (GSTAR) model is one of space-time models used to modeling and forecasting the rainfall. The aim of this research is to propose the nonlinear space-time model based on hybrid of GSTAR, Feed Forward Neural Network (FFNN) and Particle Swarm Optimization (PSO) and it called GSTAR-NN-PSO. In this model, input variable of the FFNN was obtained from the GSTAR model. Then use PSO to initialize the weight parameter in the FFNN model. This model is applied for forecasting monthly rainfall data in Jepara, Kudus, Pati and Grobogan, Central Java, Indonesia. The results show that the proposed model gives more accurate forecast than the linear space-time model, i.e. GSTAR and GSTAR-PSO. Moreover, further research about space-time models based on GSTAR and Neural Network is needed to improving the forecast accuracy especially the weight matrix in the GSTAR model.


Introduction
Rainfall is the amount of water that falls on a flat surface during a certain period measured in units of millimeters (mm) above the horizontal surface. In other explanations rainfall can also be interpreted as the height of rainwater collected in a flat place, not evaporating, not seeping and not flowing. Rainfall forecasting trends is essential for some areas, such as flood control and agriculture, airline and ship management. The rainfall data were recorded several time simultaneously at a number of locations and called the space-time data [1]. The challenge in forecasting space-time series data is that there is an increase in error rates almost every time.
Generalized Space Time Autoregressive (GSTAR) is one of the space-time models that can be used to model and forecast data that has previous time relationships and linkages to adjacent locations. This model is a development of the Space Time Autoregressive (STAR) model which was introduced by Pfeifer and Deutsch in 1980 [2]. Several previous studies related to GSTAR were done by Irawati, et al. [3], Gusnadi, et al. [4], Diani et al. [5], and Caraka et al. [6,7].
The implementation of artificial neural networks is developing rapidly, especially in the forecasting problem of the Spatio-temporal model. Neural networks are good methods for predicting non-linear functions [8]. This method does not require assumptions from the data being modeled. This model is very appropriate for solving problems where prior information is not easy to define. Therefore, neural networks are non-linear and non-parametric methods in representing functional relationships in data analysis [9]. Studies on comparing the performance between non-linear spatio-temporal model, i.e. FFNN-VAR and FFNN-GSTAR, and the linear model, i.e. VAR and GSTAR has been done by Suhartono et al. [10]. The results show that the nonlinear is more accurate than the linear model.
The selection method of optimization is very important to get the optimal weight parameters. The gradient-based optimization method will require that the activation function must be continuous and can be distinguished because the weight update process is carried out through calculations using the derivative function [11]. Various classical gradient-based algorithms for training neural networks have been created in recent years [12][13][14]. However, some of them can remain trapped in unwanted solutions. Optimization methods based on Gradient are often unable to get the global optimum and are often trapped in the local optimum at that initial stage. Therefore, another type of technique was developed for neural network training. Many heuristic algorithms are then overcome to solve the problem. Heuristic techniques utilize knowledgespecific problems to find efficient solutions [15]. In this research, the Particle Swarm Optimization (PSO) algorithm is combined with the Back Propagation algorithm to optimizing the GSTAR model to forecast the rainfall data at Central Java, Indonesia.

Generalized Space Time Autoregressive (GSTAR) Model
GSTAR is one of spatio-temporal models that can explain response variables from past data of the variable and the spatial effect of these variables. Let locations, then GSTAR with autoregressive order p and spatial order s  or GSTAR ( ) ; s p  in matrix notation can be written as follows: diag  = Φ [2]. For example, GSTAR model with time order one and spatial order one for four locations is as follows : (2) and in matrix form, it can be written as follows:    [2] state that some of the spatial weight matrices normally used in the GSTAR model are uniform weights, weights based on inverse distances between locations, and weights based on normalization of cross-correlation inference. In general, the number of parameters in VAR is greater than the GSTAR model.

Feed Forward Neural Network (FFNN)
Normally, the Feed Forward Neural Networks (FFNN) model is developed based on the gradient descent training algorithm. On FFNN, neurons are arranged in at least three layers, i.e. input layer, hidden layer, and output layer. Based on the result of the GSTAR model as an input layer, the FFNN formula can be written as follows: where ( ) 0 , 1, 2, , and 1, 2, , are the weight that connected the input layer and hidden layer, i vv are the that connected the hidden layer and the output layer, and ( ) 12 ,


are the activation function [16]. In this research 1  is the 'logistic sigmoid' function, and 2  is the 'linear' activation function. Before the artificial neural network training process, it is needs to transform the data in a certain range. This is needed so that the data is processed according to the activation function used, or also called Pre-Processing. Then, the data is returned to its original form, after the training process is finished, or named Post Processing [9].

Input Layer (p unit neurons)
Hidden Layer (q unit neurons)

Fig. 1.
The rchitecture of FFNN with p neuron in the input layer, q neuron in the hidden layer.

Particle Swarm Optimization (PSO)
Swarm Intelligent (SI) is a discipline that deals with natural and artificial systems that are composed of many individuals who coordinate using decentralized control and can organize themselves (self-organization) [17]. Specifically, these disciplines focus on collective behavior that results from local interactions between one individual and another individual and between individuals and their environment. Swarm Intelligent Logic (SI) then inspired most researchers to develop algorithms based on animal intelligence, especially to overcome optimization problems. Various algorithms regarding collective behavior are proposed to overcome optimization problems. There are two types of optimal values, namely global optimum and local optimum. Most optimization algorithms are created with the aim of finding the optimum global value. 2 One of the Intelligent Swarm (SI) algorithms is Particle Swarm Optimization (PSO) [18]. Particle Swarm Optimization (PSO) is a population optimization technique developed by James Kennedy and Russ Eberhart in 1995. PSO is inspired by social behavior in flocks of birds that flock or in groups of fish that swim in groups to form certain formations without colliding one each other even though the distance between individuals is so close [17]. Each bird is considered as a particle that represents the solution of a problem that has position (x) and velocity (v). Particle Swarm Optimization (PSO) has two main functions, namely the speed update and position update which is used to update the particle speed and position so that it will continue to be accelerated until it approaches the best particle position of the particle (local best/ pBest) and the best particle of the whole herd (global best/ gBest) until the minimum error condition is reached. PSO starts with a collection of particles (solutions) that are generated randomly. The following is the PSO calculation formula: where ρ is inertia weight, c1 and c2 are velocity coefficients, r1 and r2 are random values from uniform distribution. Symbols of t i pBest describe the best position of i th particle at t th iteration, whereas t i x is the particle i th position at t th iteration.

Hybrid GSTAR-NN-PSO Model
In this research, the hybrid space-time model is proposed to forecasting rainfall data in Jepara, Kudus, Pati and Grobogan, Central Java, Indonesia. This model combine the GSTAR, FFNN and the PSO algorithm to optimize the weight of GSTAR-NN. The architecture of GSTAR-NN-PSO that be used for forecasting the rainfall data could be seen in Figure 2 input variable and the number of neuron in hidden layer as much of number of particle in PSO using the random value of (-1,1). 5. Repeat: 1. Evaluate the fitness value of the particle in PSO using the Root Mean Squared Error (RMSE). 2. Update the pBest (best position) and gBest (global optimal). 3. Update the velocity of a particle.  are the activation function. In this research 1  is the 'logistic sigmoid' function, and 2  is the 'linear' activation function.
This output as a vector that consists of rainfall data at four locations i.e. Jepara, Kudus, Pati and Grobogan in Central Java, Indonesia. The explanation about notation in figure 2 can be written as follows: The training process to estimate the optimal weights are done by the hybrid PSO and Back Propagation algorithm. In this research, Matlab Code is developed and used for optimization to find the optimal weights in GSTAR-NN.
The steps of estimation GSTAR-NN-PSO model in this research are as follows: 1. Specify the input variable using GSTAR model 2. Specify the number of neurons in hidden layers 3. Initialize all weights in all layers using PSO 4. Calculate the output value in the hidden layer with logistic sigmoid activation function 5. Update all weights until convergence 6. Determine the GSTAR-NN-PSO prediction accuracy using RMSE to obtain the best model 7. Forecast rainfall using the best model To compute the GSTAR-NN model, the Matlab code is developed to train the network and find the optimal weights.

Description of Rainfall Data
In this paper, the monthly rainfall data at Jepara, Kudus, Pati, and Grobogan are used to develop the GSTAR-NN. The data consist of 96 observation at every location. Rainfall data were collected from January 2010 until December 2017. The data is divided into two parts, i.e. 84 for in sample dataset and 12 for out sample dataset. The time series of the data is shown in Figure 3.  Figure 3 shows that in general, the rainfall patterns of the four locations are relatively the same. This allows the tendency of the effects of interrelationships between locations one to another. Based on the MACF and MPACF plots, it can be seen that the data contains seasonal patterns. Therefore it is necessary to do differencing on lag 12. Then based on the AIC value it is obtained that the best GSTAR model is GSTAR(11)-I(1) 12 . Therefore, the model is as follows: (6) where ( ) ( ) ( )

Identification the Input Variable in GSTAR
Therefore, the input variables used in the GSTAR-NN model are:

GSTAR-NN Model
Based on input variable of GSTAR model in Equation 6 the GSTAR-NN in this data can be written as follows: The network architecture of this model to develop base on the GSTAR-NN at Figure 2. In this study, their weighting functions are used to find the best GSTAR-NN model. The selection of the best model is based on the minimum value of RMSE. In each simulation, the training process is carried out for a maximum of 1000 iterations in the PSO and in each iteration we generated 20 particles. Then the best particle of the PSO algorithm is used for the initials weights parameter in Backpropagation. Using the in sample dataset, the results of this experiment can be seen in Table 1. Furthermore, it could be concluded that in general GSTAR-NN-PSO as nonlinear space-time models give more accurate forecast than GSTAR and GSTAR-PSO as linear space-time models. These results are supported by the forecast of GSTAR-NN-PSO with the normalization cross-correlation weight scheme that tends to yield more accurate forecast at in sample dataset. Hence, the results also give new opportunities to do further research about NN and PSO for forecasting space time datasets.
The forecast results of out-sample dataset using the best model, i.e. GSTAR-NN-PSO with Normalization Cross-Correlation Weight, can be seen at figure 5. Based on this model, the RMSE of out-sample dataset is 174.608.

Conclusion
The present study was proposed nonlinear space-time model, i.e. GSTAR-NN-PSO, for forecasting rainfall data at Jepara, Kudus, Pati and Grobogan, Central Java, Indonesia. The empirical study concluded that this model could work well for estimating rainfall data. In addition, the results also show that GSTAR-NN-PSO tends to be more accurate estimates than GSTAR to forecast the rainfall data at Central Java. Future research is needed in determining the weighting function in GSTAR in order to obtain a more accurate space-time series model.