Analysis and Forecast of Railway Freight Volume based on Prophet-Deep AR Model

: The research on railway freight volume forecast is of great significance to the allocation of railway freight transport resources, the formulation of transport plans and the organization of railway freight transport. This study, by fully mining the railway freight ticket data information, put forward the precise forecast model of railway freight volume under different types of freight. Firstly, the railway freight ticket data are cleaned, regulated and integrated, and the time series of the daily number of railway freight trains are constructed, get the trend, periodicity and holiday data of railway traffic data, and set the parameters of Chinese holidays and rest days according to the demand characteristics of different categories. Secondly, the forecasting result of the Prophet is taken as a cooperative parameter. DeepAR is used to forecast, and a combined model of the Prophet-DeepAR is constructed. Finally, the combined model was validated with Shanghai Railway Bureau data from January 1, 2015 to December 31, 2018 for the food and tobacco category, and with Prophet-DeepAR, LSTM, Wavelet, BILSTM, and Prophet-LSTM, prophet-wavelet and Prophet-Bilstm are used to compare the prediction results. The results show that the Prophet-DeepAR model can extract the multi-dimensional periodicity of freight traffic and mine the trend information of freight traffic, and get the prediction result with high precision. It has better accuracy than other models.


INTRODUCTION
With the continuous increase of the total volume of the society, the competition in the freight transport market is increasingly fierce, and the railway freight industry is facing specific opportunities and challenges.The forecast of railway freight transport volume is the basis for railway enterprises to carry out transport organization and compile transport plans, and it is also the important basis for the future development of railway enterprises.Therefore, the scientific and accurate forecasting method of railway freight volume is of great significance to optimize the allocation of railway freight resources, improve the railway industrial structure, enhance the level of railway freight management and improve the railway freight customer experience.
The railway freight transport system is a complex dynamical system of many factors.Therefore, the railway freight volume presents the characteristics of high nonlinearity, uncertainty, sequence dependence and periodicity.The prediction methods mainly include time series analysis method [1], regression analysis method [2] and neural network analysis method [3].The method of time series analysis is to use the historical data to predict the future data, and the multiple linear regression model can study the causal relationship between the influencing factors and the railway freight volume, but only by studying the linear relationship between the variables, can't the internal complexity of the railway transportation system be comprehensively and scientifically reflected.The neural network model can reflect the dynamic complexity of the railway transportation system through black box operation; however, it is not possible to determine the causal relationship between the influencing factors and the railway freight volume.Xiao et al. [4] verified that the error between the predicted value and the actual value of Arima model with drift term is smaller, which can provide more accurate prediction results.Tang et al. [5] predicted the freight volume by Holt-Winters multiplication model, which was verified by an example.The result obtained is higher than the traditional forecasting models such as grey forecasting and regression forecasting.With the development of deep learning theory in the field of time series prediction, deep learning model has strong adaptive ability, flexible nonlinear modeling ability and massive learning and parallel computing ability.So it is to provide support for railway freight volume forecast.Tan et al. [6] established single-step and multistep forecasting models to forecast short-term freight volume by studying the simple structure GRU with high efficiency memory function.The prediction results were then compared with those of support vector machine regression, BP Neural Network and LSTM models in terms of accuracy and root-mean-square error.The results show the superiority of GRU deep network.At present, the research of railway freight volume forecast is mainly the long-term forecast based on the yea.It is difficult to fully excavate the predictable information of time series, and the granularity is rough.There are few researches on the seasonal and periodic characteristics of different categories of railway freight, and the data mining of holiday freight volume is insufficient.Behmanesh [7] optimizes the ant colony algorithm for multi-source job scheduling.Chu [8] also uses algorithms for traffic safety risk assessment.Zhang [9] uses an improved whale optimization algorithm to carry out the service capability of electric charging piles.
Therefore, this study is based on the Prophet-DeepAR model to predict the railway freight volume forecast accurate probability model by extracting the railway freight ticket data, fully mining the railway freight volume time series of different categories of transportation, and using the trend, periodicity and holiday characteristics of Prophet model time series.The paper fuses DeepAR probability model to build an accurate railway freight forecasting model.The accuracy of the Shanghai Railway Bureau model was verified by the comparison of the metal categories from January 1, 2015 to December 31, 2018.

RELATED WORKS 2.1 Time Series Prediction Algorithm
Time series is a phenomenon of a statistical index in different time for the various values of the order of time into the sequence of the sequence.The basic principle of the time series prediction algorithm is to recognize the continuity of the development of things, and to use the statistical analysis of the past time series data to infer the development trend of things.In order to eliminate the influence of the random fluctuation we make use of the historical data to carry on the statistical analysis, and do the Data Pretreatment, forecast changes in future trends [10].In recent years, recurrent neural networks (RNN) and convolutional neural networks (CNN), represented by deep learning models, have become the strong competitors of classical statistical models.This is because of its powerful ability to discover patterns in traffic time series and track their evolving characteristics.Khow [11] and Lee [12] applied deep learning algorithm to real-time monitoring system respectively.In Troias et al. [13] the gated cycle unit of recurrent neural network is used to explore the mutual dependence of traffic time series and predict the future traffic fluctuation.The LSTM generated by a recurrent neural network (RNN) is suitable for learning time series dependencies, in which neurons in each memory block are fully connected [14].Cheng et al. [15] established LSTM multivariate forecasting model based on monthly freight volume data and LSTM time series model based on daily freight volume data, respectively, considering the characteristics of freight data in different periods.It is concluded that LSTM network is more effective than Arima and BP neural network.Yang et al. [16] have carried on the modelling and the comparison to the parking lot vehicle assignment forecast.Zhang [17] applies Bayesian network model to the analysis and forecast of e-commerce logistics.

Prophet Model Theory
The Prophet model, published by Talay in 2017, is a model for large-scale time series analysis.Based on the Additive Model, the model is suitable for fitting data with strong periodicity and several periodicity, and the missing values, trend offset and outliers have good support,as shown in Fig. 1.

Figure 1 Prophet schematic
Prophet model can adapt to the festival effect and trend change point of time series, and has strong robustness against missing value, trend change and a large number of outliers.In other words, the curve fitting problem can easily introduce seasonal and multi-cyclical effects, and can be applied to a variety of data types.In flexibility, unlike the Arima model, the curve fitting problem does not need data and so on step size.Therefore, there is no need to perform special operations on the data (such as interpolation).In speed, that is, curve fitting is faster than the traditional training model, which helps data scientists to iterate.Variables are easy to interpret: most of the variables in the model have clear physical meanings, and people with some experience in data analysis can quickly translate background knowledge into new parameters to be introduced into the model.
Prophet model is widely concerned and applied in many fields.The model has good accuracy in predicting air pollution [18], transportation price [19], retail sales [20], power load [21] and noise pollution [22].Meng et al. [23] found that LSTM model is more accurate than Prophet model in drug sales prediction, but Prophet has good applicability.Long et al. [24] used the Prophet model to decompose the power load series of an area into trend, season and holiday terms.The forecast results of the Prophet model are compared with those of the traditional Arima model and the LSTM model.The validity and feasibility of the model in power load forecasting are verified.
Prophet decomposes the time series into trend, seasonal and holiday terms, which are superposed to form the time series values, as shown in Eq. ( 1).
In the equation: y(t) is the time series value; g(t) is the trend model, simulating the non-periodic change of the time series value; s(t) is the seasonal model, representing the periodic (daily or weekly, etc.) change to the time series value influence; h(t) is the holiday model, representing changes caused by special circumstances such as holidays; ε t is the noise portion of the time series, representing random fluctuations that cannot be predicted.The Prophet decomposition models are described as follows: Trend model.Prophet's trend term g(t) is the main part of the whole model, which is used to fit the aperiodic change of the sequence.In this paper, we use a piecewise linear growth trend model with the expression, as shown in Eq. (2).
In the equation: k is the growth rate;   T t a is a binary vector indicating whether time; t is the change point ; δ is the change in the growth rate; m is the offset parameter; and γ is the parameter that makes the trend model continuous.
Seasonal models.Prophet uses Fourier series to fit seasonal periodic changes in time series, as shown in Eq. (3).
Formula: P is the period of time series; 2n is the number of periods.
The holiday model.Prophet assumes that different holiday models h(t) are independent of each other, and can set different pre-and post-window values for different holidays, indicating that the holiday will affect the time series of the pre-and post-period, as shown in Eq. ( 4).
, ..., 1 Normal 0, D I represents the date in the time window of the holiday, and each holiday corresponds to a priori parameter  , which follows a normal distribution.

DeepAR Model Theory
DeepAR was developed in 2020 by David Salinas et al. [25], a method used to generate accurate probabilistic predictions.DeepAR method includes Recurrent Neural Network (RNN), which has the characteristics of memory, parameter sharing and Turing completeness.It has advantages in learning the non-linear features of the sequence.So it can predict the probability well.
The DeepAR method is based on the training of autoregressive recurrent neural network models on a large number of correlated time series.In essence, the deep learning technique is applied to the prediction.The prediction results are issued in the form of probability distribution to provide interval estimation, to achieve more accurate time series prediction.In this paper, the DeepAR method is used to predict the ground settlement near the transmission line by Li et al. [26].And the DeepAR model is used to predict the slope displacement by Dong [27], which the prediction accuracy of DeepAR model was verified by mean absolute error, root mean square error and goodness of fit.Li et al. [28] proposed a method for predicting the residual service life of rolling bearing based on gru-depth autoregressive model with self-adaptive failure threshold [29].
The DeepAR, shown in Fig. 2, predicts future observations from observations in a given sequence.The training process is on the left side and the prediction process is on the right side.Z d,t represents the observed value of the d sequence at time t, with t 0 as the starting point to be predicted.The observed value of time interval [1 -t 0−1 ] is known as the condition interval, and the observed value position of [t 0 , T] is the prediction interval.In the prediction, the observations prior t 0 T will be entered to obtain , the DeepAR adopts the structure of an autoregressive recursive network, which can be written as shown in Eq. ( 6). has its corresponding activation function, using softplus as its activation function, thus ensuring that σ is positive, as shown in Eq. ( 7) to Eq. ( 9).
μ is the expectation, σ is the standard deviation.The parameters such as , , and  were all optimized by RNN training.
In the application process, the quantile can be predicted by the model to achieve the goal.For example, an interval prediction with a confidence of 50% can be obtained by predicting a two-sided 50% quantile.For deterministic point prediction, the upper 50% percentile of prediction can be achieved.

PROPHET-DEEPAR CONSTRUCTION OF RAILWAY FREIGHT VOLUME MODEL 3.1 Railway Freight Time Series Data
Railway freight can be divided into two categories according to the types of goods to be shipped, namely bulk goods and scattered white goods.The bulk cargo mainly refers to the goods with a certain size, a certain amount of freight.The cargo flow is stable and balanced, can determine the transport demand in advance, and the use of transportation agreement to provide capacity protection.Common bulk cargo generally includes coal, oil, coke, metal ore and other categories of goods.The loose white goods refer to the goods other than the bulk goods which are transported by agreement.Because the transportation demand of different goods is different periodically, this research relies on the railway freight ticket data generated by railway freight order.The time series of railway freight transport volume is constructed by extracting and integrating data of different categories of China's railway freight transport.Since the loading index is simpler and clearer than the tonnage index of goods delivered in daily control, loading number is often used as an index when assessing the implementation of transport plans issued to transport units at all levels, in order to organize the vehicle flow and cargo flow plan.This study uses the daily loading number as the experimental data.Taking the Shanghai Railway Bureau data on metal cargo tickets from January 1, 2015, to December 31, 2018 as an example, a total of 1620935 railway cargo customer cargo ticket information data were included.Each record contains 13 fields including the name of the departure station, the province and city of the departure station, the date of shipment, the code of the shipper, the name of the arrival station, the Bureau of the arrival road, the province and city of the arrival station, the total mileage, the metered mileage, the category, the total cost, the freight and the freight insured price.It contains a time series of daily departures of Shanghai Railway Bureau metals derived from data cleaning, specification and integration, as shown in Fig. 3.

Forecast of Railway Freight Volume Based on Prophet Model
The data of daily departure time series from January 1, 2015 to December 31, 2017 was used as training set, and the data of daily departure time series from 2018/1/1 to 2018/12/31 was used as test set.The Prophet model is constructed for training, and the model is decomposed according to the non-periodic changing trend term, the seasonal period term and the holiday effect, and then the model is trained by components, finally, according to the training results; the model is further optimized to improve the prediction accuracy of the model.The process is shown in Fig. 4.  Prophet forecasts daily freight volume in 2018, as shown in Fig. 6, which shows that Prophet can learn the periodicity and tendency of historical event series, but because of the randomness of daily freight demand and volume, there is a big difference between the predicted value and the true value.

Prophet-DeepAR
In view of the randomness of daily railway freight volume, this paper proposes a probability prediction model which integrates Prophet and DeepAR.First, the DeepAR network structure is designed.Secondly, the results of Prophet calculation are used as covariates, and the initial parameters of the optimal prediction model are determined by DeepAR network training.If the optimality search condition is satisfied, the iteration is terminated and the calculation is completed.The above calculation flow is shown in Fig. 7.According to the analysis of the time series of daily number of trains, the daily volume series has great fluctuation and randomness, so the probability prediction is more meaningful than the single point prediction.DeepAR is an autoregressive RNN time series model and a recurrent neural network model with hidden state.In this study, the output value of prophet is taken as a co-variable, and the final output prediction result is obtained.The Prophet-DeepAR prediction is shown in Fig. 8.In order to verify the validity of Prophet-DeepAR prediction model, this paper uses three evaluation indexes: root mean square error (RMSE), mean absolute error (MAE) and coefficient of determination (R 2 ).The calculation process is shown in Eq. (10) to Eq. (12).
The smaller the number of values, RMSE and MAE, the better the predictive ability of the model.The closer R 2 is to 1, the better the predictive effect of the fitted model.The study shows that the Prophet model can fully mine the trend features of railway freight volume time series, extract multi-dimensional periodic features, predict the impact of holidays on the series, and can well predict railway freight volume.DeepAR is more accurate and applicable than LSTM, Wavelet and BilSTM in forecasting railway freight volume.Using Prophet as a cooperative parameter, DeepAR can optimize the experimental results in different degrees compared with LSTM, Wavelet and BILSTM models.The model predicts a contrast, as shown in Fig. 9 to Fig.

Figure 3
Figure 3 Metal Products 2015 -2018 daily time series (by Shanghai Railway Bureau)

Figure 4
Figure 4 Flow of Prophet prediction algorithm Prophet model can flexibly set the parameters of each component, and the value of these parameters represents the contribution of each component to the prediction result of the model.According to the analysis of the result of the training set data slice, it has obvious characteristics, as shown in Fig. 5.In conjunction with Tab. 1, the Prophet time series cross-validation function is used for the other parameters of the trend model, seasonal models and the holiday model.According to the characteristics of time series data of railway freight volume, it has obvious characteristics of Chinese festivals.Therefore, according to the Chinese legal holidays, the setting of holiday parameters is shown in Tab. 1.

Figure 5 Table 1 Festivals 1 Figure 6
Figure 5 Periodic analysis chart of Metal Shanghai Railway Bureau daily starting times seriesTable 1 The date of Chinese holiday window Festivals The window period of the festival The lower limit of the holiday window period / days Holiday window cap / days

Figure 7
Figure 7 The flow of Prophet's prediction algorithm

Figure 8
Figure 8 Prophet-DeepAR prediction result To verify the validity of the Prophet-DeepAR model two evaluation indexes, RMSE and MAE (in Sect 4.1), are used to evaluate Prophet, DeepAR, LSTM, Wavelet, Bilstm, Prophet-LSTM, Prophet-Wavelet, Prophet-Bilstm.The training set and the test set in 3.1 are trained in each model and the parameters are adjusted to achieve the optimal results.According to Tab. 2, the prediction results of Prophet-DeepAR are better than other prediction methods.

17
. The following comparison shows that the Prophet-DeepAR combination model can be used to improve the accuracy of railway traffic forecasting.

Figure 10 Figure 11 Figure 12
Figure 10 Prophet comparison of predicted and real values

Figure 13 Figure 14 Figure 15
Figure 13 Prophet-Wavelet comparison of predicted and real values

Figure 17
Figure 17 Prophet-BiLSTM comparison of predicted and real values 5 CONCLUSIONS The forecast of railway freight volume is of great significance for improving the efficiency of railway freight organization, improving the foresightedness of railway logistics planning and making plans.Based on the characteristics of time series of railway freight volume, this paper proposes an accurate forecasting model of railway freight volume based on Prophet-DeepAR by fully mining railway freight ticket data information.The Shanghai Railway Bureau was validated with invoice data from January 1, 2015 to December 31, 2018 for the food and tobacco categories and compared with the combined model of Prophet, DeepAR, LSTM, Wavelet, BILSTM and Prophet-LSTM, Prophet-Wavelet and Prophet-Bilstm.The following conclusions can be drawn: (1) The decomposable method of Prophet model can decompose the trend, period and random error of the time series of railway freight transport volume.It can well fit the trend change point and periodicity of railway freight volume time series.(2) DeepAR model based on neural network can learn a lot of long-term historical data and mine potential trend characteristics and nonlinear information, and can better predict the potential law of railway freight volume.(3) Taking the forecast result of Prophet's traffic volume as a cooperative parameter, DeepAR is used to forecast, and a combined model of Prophet-DeepAR is constructed to make full use of the advantages of both.The experiment proves that the prediction result of the combined model is more accurate than that of the single model.(4) In the future research, we can consider the macroeconomic data and industry-related indexes that affect the railway freight volume, and establish a multi-source data prediction model through the correlation between the historical freight volume and the external data.
d,1:T represents a known covariate at the time node of the entire time series.In the training part, the covariate X d,t , the observed value Z d,t−1 of the previous time point and the output h i,t−1 of the previous time point are input on each t = H(h i,t−1 , Z d,t−1 , X d,t , Θ).It will be used as the input parameter θ d,t = θ(h d,t , Θ) for calculating the likelihood function   z .The network is trained by maximizing log-likelihood with the observed value Z d,t .The loglikelihood function is shown in Eq. (5).
the sampling value becomes the input of the next time node and is fed back to its output interval, the process is repeated until the end of the interval

Table 2
Comparative experimental results Figure 9 Prophet-DeepAR comparison of predicted and real values