Hybrid SARIMA-FFNN model in forecasting cash outflow and inflow

The monthly inflow and outflow of money from an area is one of the important concerns in the economic life of a region. This study aims to model and predict the monthly cash inflow and outflow of Kediri, East Java Province, Indonesia using the Hybrid Seasonal Autoregressive Integrated Moving Average – Feedforward Neural Network (SARIMA-FFNN) model. Seasonal time series data from monthly cash inflow and outflow of Kediri are used to test the forecasting accuracy of the proposed hybrid model. First, both variables are modeled using the SARIMA model. Then, non-linearity testing was carried out on the best SARIMA model for each variable and the results showed that only cash inflow was non-linear. Therefore, only cash inflow could be continued with the FFNN model. The best selected model was the FFNN model with the input SARIMA(0,0,0)(1,0,0)12 with five hidden layers. The input of FFNN modeling was based on the best SARIMA model with only the autoregressive order which for non-seasonal and seasonal. The sum of hidden layers was chosen by the smallest values of MAPE and RMSE. Forecasting results with the hybrid SARIMA-FFNN model on data testing followed the actual data pattern.


Introduction
The economy of a country cannot be separated from the economy of each region. In everyday life, the economy cannot be separated from the need for money. Indonesia has a central bank in charge of issuing and circulating money. The bank is known as Bank Indonesia. The bank is based in Jakarta. However, each region has Representative Office of Bank Indonesia which is abbreviated as KPw BI which regulating the money needs of each region. One example is the Representative Office of Bank Indonesia in Kediri, East Java Province, Indonesia. Bank Indonesia strives to meet the needs of money in the community, both insufficient nominal and in a condition fit for circulation.
In carrying out the task of regulating and maintaining the smooth running of the payment system, Bank Indonesia is authorized to manage currency, which includes planning, spending (outflow), circulation, revocation, and withdrawal (inflow) of currency [1]. Therefore, forecasting is needed to estimate cash outflow and inflow. Bank Indonesia uses the Autoregressive Integrated Moving Average (ARIMA) method in estimating cash outflows and inflows. Not infrequently the actual data detected a seasonal pattern caused by certain events so that the method used is the Seasonal Integrated Moving Average (SARIMA). This method is often used in several studies by Elena et al. [2] which predicts tourist arrivals in Bali; Fransiska [6]; etc. In addition to the SARIMA method, there are several other development methods for forecasting cash outflows and inflows. One of them is the study by Monica & Suharsono [7] which predicts cash outflow and inflow in Jember, East Java Province, Indonesia using the ARIMAX method.
The disadvantage of these methods is that they can only be used on linear data. Tsay and Chen [8] say that the linear model is easier to use and can provide a good approximation in many applications. However, the data does not always show a linear pattern. This deficiency is overcome by the Artificial Neural Network (ANN) method which is used in non-linear data modelling. One of the ANN methods that can be used in this research is the Feedforward Neural Network (FFNN). Machmudin & Ulama [9] showed that the ARIMA and ANN methods with the FFNN approach provided a good model compared to ARIMA to predict air temperature in Surabaya. Besides that, Hidayat et al. in his research stated that the comparison between FFNN model and time series model shows that FFNN model is better than time series model [10]. Based on these results, this study uses basic methods such as ARIMA echoed by the development method, namely FFNN so that non-linear patterns in the data can be resolved. However, the data in this study indicate a seasonal pattern, so SARIMA is used as the basic method for determining the FFNN input. Therefore, the method used in this method is called hybrid SARIMA and FFNN. This research is expected to provide a better forecasting model to predict cash outflow and inflow at the Representative Office of Bank Indonesia, Kediri, West Java, Indonesia which can later be used as one of the determinants of monetary policymaking.

Cash Outflow and Inflow
Cash Outflow is money that comes out of Bank Indonesia through withdrawals by the public and commercial banks either directly, mobile cash, or cash deposit [11]. Meanwhile, cash inflow is money that enters Bank Indonesia through deposits by the public and commercial banks either directly, mobile cash, or cash deposit.

Seasonal Autoregressive Integrated Moving Average (SARIMA)
Unlike the ARIMA model, the SARIMA model has six components which consist of autoregressive, integrated, moving average, seasonal autoregressive, seasonal integrated, and seasonal moving average. Model identification can be done by identifying Autocorrelation Function (ACF) and Partial Autocorrelation Function (PACF) graphs. In general, the SARIMA model can be written in equation (1) [12]. where:

Feedforward Neural Network (FFNN)
Lazzeri said that deep learning neural networks can automatically learn arbitrary complex mappings from input to output and support multiple inputs and outputs [13]. This powerful feature can solve nonlinear time series problems for forecasting both with multivalent-input and multi-step forecasting. There are several types of artificial neural networks such as Radial-Basis Function Networks, Generalized Regression Neural Networks, Feedforward Neural Networks (FFNN), etc. Based on Awchi's research, it is said that FFNN gives better results than GRNN and RBFN [14]. Feedforward Neural Network (FFNN) is a model that can be used to predict time series data. This method is also a type of Artificial Neural Network method where the process goes forward from the input layer to the output with a directed acyclic graph [15]. Figure 1 shows the FFNN network architecture which consists of an input layer, a hidden layer, and an output layer. In general, the equation of the FFNN model can be seen in equation (2).
where K is the number of input nodes, J is the number of hidden nodes, is the weight vector from hidden layer to output, is the weight vector from the input layer to the hidden layer.
The data used in this study are cash outflows and inflows from the Representative Office of Bank Indonesia, Kediri, East Java Province, Indonesia with a monthly period starting from January 2015 to February 2021. Sixty data from January 2015 to December 2019 were used as training data and the rest as testing data. The division of training-testing was carried out to see whether the modelling that has been carried out has followed the actual data or not. The research variables are presented in Table 1.

Input Layer Hidden Layer
Output Layer  Based on Table 2, most of the monthly cash inflows in Kediri amounted to 1.453 trillion Rupiah from 2015 to 2021. Meanwhile, the cash outflow was 1.561 trillion Rupiah, so it can be said that the money that came out of Bank Indonesia was more than the money that came in either through direct withdrawals, mobile cash, and cash deposits by the public and commercial banks. In terms of the size of the data center, which is the average, there was not much different between the cash outflow and inflow. However, when viewed from the size of the data spread, cash outflows have more diverse values than cash inflows. This is evidenced by the value of the standard deviation of the outflow is greater than the inflow.

Cash Outflow and Inflow with SARIMA Modelling
The stationarity of the data needs to be tested first before carrying out time series analysis. Data is said to be stationary if the mean and variance of the data do not change systematically over time. Two things need to be tested in the stationarity of the data, namely the variance and the average. Based on the results of stationarity test of variance, both variables in this study were transformed by the Box-Cox transformation first so that they are stationary for variance. The results of transformation are shown in Figure 3. The data is said to be stationary to a variance if the rounded value is 1. While the average stationarity is carried out by Augmented Dickey-Fuller test was accompanied by an alternative hypothesis, namely stationary data, and obtained a p-value of 1% (less than the 5% level of significance) so that it can be said that the data is stationary to the average.  The identification of the ARIMA model is carried out using ACF and PACF plots as shown in Figure  4. Based on Figure 4, it can be seen that at lag 12, both ACF and PACF are significant. This indicates a seasonal pattern in outflow and inflow data. After that, seasonal differentiation was carried out to obtain a model that was formed for each variable. The identification of the two models has the same form as a tentative model. Testing the white noise assumption was conducted before determining the best model. The result has shown that all tentative models for both variables meet the white noise assumption. The best model obtained for the same cash outflow and inflow was SARIMA (0,0,0) (1,0,0)12. The selection of the best model was based on the smallest Akaike Information Criterion (AIC) value from several tentative models.

Cash Outflow and Inflow with FFNN Modelling
Before doing FFNN modelling, a non-linear detection test was first performed. The test was conducted to determine whether the relationship between t Y and the input variable was non-linear. The non-linear detection test used was the Terasvirta test with an alternative hypothesis, namely a non-linear model. Table 4 shows the results of the Terasvirta test for each variable. The input was derived from the SARIMA modelling in sub-chapter 4.2.

Variable
P-Value Cash Inflow (Y11) 0.00035 Cash Outflow (Y12) 0.1077 * Row marked in grey is subject to reject the null hypothesis Based on Table 4, it can be concluded that the cash inflow variable can be continued with FFNN modelling while cash outflow continues to use the SARIMA model for modelling and forecasting. In FFNN modelling, it is necessary to first identify many hidden layers that are used for the learning algorithm process. In this study, the number of hidden layers is limited to 10 neurons with the selection of many hidden layers based on the smallest Root Mean Square Error (RMSE) and Mean Absolute Percentage Error (MAPE) values. Table 5 shows the MAPE and RMSE values for each hidden layer and 5 hidden layers were selected for FFNN modelling in this study.

Sum of Hidden
The FFNN diagram can be shown in Figure 5 with input from the SARIMA model and 5 neurons hidden layer.
__ : Forecasting Testing Data Cash Inflow __ : Actual Data Cash Inflow  Basically, the FFNN model cannot be interpreted but is used for forecasting. Figure 6 is the result of the training-testing data forecast. Based on Figure 6, the forecast follows the actual data pattern even though it does not detect a high spike.  Table 6, it can be said that the FFNN model for cash inflow is good enough to be used for forecasting, or in other words the FFNN model followed the actual patterns of data. The same thing was also carried out for cash outflows. Figure 7 shows the data testing forecast using SARIMA (0,0,0) (1,0,0)12 and the forecast followed the actual patterns of data. Based on Table 6, since the resulting MSE value for cash outflows was 0.164, it can be said that the SARIMA model followed the actual patterns of outflow data.  Figure 7. Forecasting Testing Data Cash Outflow with SARIMA Furthermore, forecasting cash outflows and inflows for the next six months using SARIMA and FFNN are shown in Table 7. From Tale 7, it can be concluded that the forecast for the highest inflow value occurred in May 2021, presumably due to the Eid Al-Fitr holiday occurring in that month. It is suspected that due to the Covid-19 pandemic, people tend to save rather than deposit their money in the bank. Meanwhile, the highest outflow occurred in August 2021. The cause of the spikes in these months is required further analysis, particularly related to other economic indicators such as in terms of inflation or can be detailed by the increase or decrease in prices of basic commodities and other necessities.

Month
Outflow Inflow

Conclusion
Hybrid SARIMA and FFNN models were used for modelling and forecasting the cash inflows in Kediri, East Java Province, Indonesia. Meanwhile, the cash outflow was used the SARIMA (0,0,0) (1,0,0) 12 model since, there was no non-linear pattern. The predictions can be used by the Representative Office of Bank Indonesia and the local government in Kediri to make evidence-based policies that are effective to ensure the smooth running of the payment system, the task of regulating and maintaining, as well as the planning, spending (outflow), circulation, revocation, and withdrawal (inflow) of currency in the future. Suggestions for further research are to link the cash outflow and inflow with other variables that may have significant contribution to the flows so that the increase or decrease in the cash outflow and inflow can be further analysed.