# Traffic Flow Prediction Method Based on Seasonal Characteristics and SARIMA-NAR Model
## 2 Methods
### SARIMA-NAR Model  
Considering the advantages of the SARIMA model and NAR dynamic neural network, two combination models were established for traffic flow prediction. Their prediction process is shown in Figure 2.  
* Method of combining linear and nonlinear components  
In general, the time series of traffic flow can be simplified to have both linear and nonlinear components simultaneously. The ARIMA model is widely used to solve linear problems; on this basis, the SARIMA model can also extract the seasonal fluctuation part of the time series, and the NAR dynamic neural network has an excellent ability to predict the nonlinear part [41; 42; 43]. Thus, a method of combining linear and nonlinear components is constructed, that is, the combination of SARIMA model and NAR dynamic neural network; its mathematical expression is as follows:  
\[\hat{y}_{t}=\hat{L}_{t}+\hat{N}_{t} \tag{6}\]  
Figure 1: Structure of NAR model.  
where \(\hat{y}_{t}\), \(\hat{L}_{t}\), and \(\hat{N}_{t}\) are the prediction results of the SARIMA-NAR combination model, SARIMA model, and NAR model, respectively. \(\hat{L}_{t}\) represents the linear component and \(\hat{N}_{t}\) represents the nonlinear component.  
As shown in Figure 2, the first step is to use the SARIMA model to perform linear prediction on the traffic flow time series \(\hat{L}_{t}\); the second step is to calculate the residual difference \(N_{t}\) according to Formula (7) and extract the residual series; the third step is to use the extracted residual series to construct the NAR model and perform nonlinear prediction to obtain the nonlinear result \(\hat{N}_{t}\); the fourth step is to superimpose these two results to obtain the final traffic flow prediction result \(\hat{y}_{t}\)[21,44].  
\[N_{t}=y_{t}-\hat{L}_{t} \tag{7}\]  
* The method of MSE weight combination  
As shown in Figure 2, while constructing this combination method, a higher weight is assigned to the prediction model with the better fitting performance, and a smaller weight is assigned to the prediction model with poor fitting performance [45]. The mathematical expression of the combination model is as follows:  
\[\hat{y}(t)=\omega_{1}\hat{y}_{1}(t)+\omega_{2}\hat{y}_{2}(t)+\cdots+\omega_{n }\hat{y}_{n}(t)=\sum_{i=1}^{k}\omega_{i}\hat{y}_{i}(t) \tag{8}\]  
where \(\omega_{i}\) is the weight coefficient of model \(i\), and \(\hat{y}_{i}(t)\) is the predicted value of model \(i\) at time \(t\).  
In this paper, \(k=2\), and the combination model \(\hat{y}(t)\) is shown in Formula (9):  
\[\hat{y}(t)=\omega_{1}\hat{y}_{1}(t)+\omega_{2}\hat{y}_{2}(t) \tag{9}\]  
Figure 2: SARIMA–NAR combined model forecast flow chart.  
In the combination model, the choice of weight is very important. In this paper, the fitting mean square error (MSE) of the historical traffic flow series was selected to evaluate the fitting result, to determine the weight. The calculation formula of MSE is Formula (10):  
\[e_{MSE}=\frac{1}{n}\sum\limits_{t=1}^{n}(y_{t}-\hat{y}_{t})^{2} \tag{10}\]  
Denote the MSE of the historical traffic flow series of model \(i\) as \(s_{i}\), then the weight coefficient of model \(i\) is as follows:  
\[\omega_{i}=\frac{1/s_{i}}{\sum\limits_{i=1}^{k}1/s_{i}} \tag{11}\]