With the rapid development of e-commerce (EC) and shopping online, accurate and efficient forecasting of e-commerce sales (ECS) is very important for making strategies for purchasing and inventory of EC enterprises. Affected by many factors, ECS volume range varies greatly and has both linear and nonlinear characteristics. Three forecast models of ECS, autoregressive integrated moving average (ARIMA), nonlinear autoregressive neural network (NARNN), and ARIMA-NARNN, are used to verify the forecasting efficiency of the methods. Several time series of ECS from China’s Jingdong Corporation are selected as experimental data. The result shows that the ARIMA-NARNN model is more effective than ARIMA and NARNN models in forecasting ECS. The analysis found that the ARIMA-NARNN model combines the linear fitting of ARIMA and the nonlinear mapping of NARNN, so it shows better prediction performance than the ARIMA and NARNN methods.

1. Introduction

In recent years, e-commerce has developed rapidly in China. The forecasting of ECS greatly affects inventory, ordering, and logistics strategies, so it is very important for e-commerce enterprises to predict the ECS accurately [1]. In terms of the lifecycle of EC, its sales present the stages of growth, stability, and decline, whereas in the short term, the sales are affected by price, promotions, evaluations and descriptions online, product life cycle, season, ranking online, etc. There is a dramatic fluctuation in ECS volume, and the ECS shows a linear trend of increase or decrease in a specific period of time, but certain phases may show the characteristics of nonlinear fluctuation because of various potential uncertainties. Therefore, it is critical for the forecasting of ECS to find a prediction method that is suitable for the mixed characteristics of both the linear and nonlinear changes.

The prediction studies of ARIMA and NARNN models in other areas [27] found that ARIMA fits and forecasts better when the time series data shows a clear linear trend, otherwise the prediction becomes less accurate or even lower than the confidence requirements, while the NARNN model shows a better prediction performance for nonlinear changes in the data.

In view of the above characteristics of the ARIMA and NARNN models, as well as the mixed characteristics of ECS change, both linearly and nonlinearly, we propose to establish the ARIMA-NARNN hybrid model to predict the ECS.

At first, we gained the real sales data of a single food product in Jingdong Company of China and preprocessed and divided the data set into an experimental set and a test set. Then we, respectively, used the ARIMA, NARNN, and the ARIMA-NARNN hybrid models to fit based on experimental set data and predict sales of the single food product for the next few weeks. Finally, we compare fitting accuracy of the three models with the same experimental data and prediction accuracy in the test data. In order to prove the universal superiority of our proposed hybrid model in the e-commerce industry, weekly sales data for a total of 60 e-commerce products was used for our empirical analysis. Finally, the research shows that the ARIMA-NARNN hybrid model is superior to the ARIMA and NARNN models for the ECS we selected. This research has certain reference value to the EC enterprises in the forecast of ECS, demand control of stock, and development of logistics strategy.

In fact, ARIMA, NARNN, and ARIMA-NARNN have been studied in many industries, such as agriculture and forestry [2], healthcare [3, 5], geography [4], manufacturing [6], and offline retail [7]. Some of these studies [25] only analyzed a single time series to reach conclusions, and some [6, 7] only conducted empirical analysis of the hybrid model and did not compare the ARIMA, NARNN, and ARIMA-NARNN to prove the effectiveness of the hybrid model. The innovativeness of this paper is to do a comparative study between the ARIMA, NARNN, and ARIMA-NARNN methods combining the characteristics of the e-commerce industry. The empirical analysis of multiple time series of multiple e-commerce products is used to verify the universal superiority of the ARIMA-NARNN model we propose.

The remainder of this paper is organized as follows. Section 2 is about the relevant literature review. ARIMA and NARNN are introduced, and the ARIMA-NARNN model for forecasting of ECS is proposed in Section 3. Related description of the real case study is presented in Section 4. The conclusion and further research directions are in Section 5.

2. Literature Review

There are a large number of studies on the prediction of the sales volume of e-commerce products which mainly include time series, causal regression, and machine learning methods. On time series forecasting, Dai W et al. [8] studied the prediction of the clothing sales volume in Taobao based on structure time series model and Taobao search data. In this research, they explored a real-time prediction method of clothing sales volume using structure time series model and website search data. For the regression prediction, Peng Geng [9] predicted the e-commerce transaction volume based on online keywords search, word frequency, and other data as well as the classification of commodities. Jian-hong YU et al. [10] studied Amazon’s sales forecast. Based on the historical data of Amazon, the authors used exponential smoothing, time series decomposition, and ARIMA models to predict sales. They found that the exponential smoothing forecast is the worst, while the ARIMA is best. As for machine learning prediction, Yu Miao [11] studied the extreme learning machine (ELM) neural network, taking into account seasons, categories, holidays, and other factors in the forecasting of medium-term sales of clothes. Weng Yingjing [12] used a back propagation (BP) neural network to predict sales online. Philip Doganis et al. [13] constructed a framework of combining genetic algorithms with a radial basis function (RBF) neural network model to analyze and predict sales of perishable food, and its predictive performance and efficiency were demonstrated in the practice of several large companies in the Athens dairy industry. Franses PH [14] combined expert prediction and model prediction to accurately predict the stock keeping unit (SKU) level of drug products and then proved that the effect of the hybrid model is better than either model alone. Weng Y and Feng H [15] established the BP neural network using variables such as the number of users, the conversion rate, the unit price, and the number of collections and verified the accuracy and validity of the model by using sales data from Alibaba.

The above methods do have effects on the prediction of ECS. The causal regression and machine learning methods require a large number of explanatory variables such as the number of clicks and visits, the favorable rate, and even the consumer information. However, there are many kinds of products involved in the e-commerce sales, and the sales of different kinds of products are affected by different factors. Therefore, it is a waste of time and energy to establish a forecasting model by collecting a large number of explanatory variables, and it also does not meet the requirement of a quick prediction, whereas the time series model only needs time as an explanatory variable, and if it can achieve an acceptable prediction accuracy, it will be very suitable for prediction of ECS. Therefore, we selected the time series method to predict.

Previous studies show that ARIMA and NARNN approaches have better prediction performance in time series prediction [1624]. For example, Cheng C and Qin P [16] used the ARIMA model to predict the time series data of settlement of seawalls and got higher accuracy than the gray prediction. Also, Bonetto R and Rossi M [24] used the NARNN model to predict the power demand and get a good predictive effect. In time series prediction of ECS, currently, most scholars [1625, 2531] mainly use the methods of moving average, exponential smoothing, time regression, or ARIMA alone, while the ARIMA, NARNN, and ARIMA-NARNN combined models have not yet been used to predict and analyze comparisons in the e-commerce industry.

However, in the e-commerce industry, the types of products are very numerous; that is to say, there are more than one time series to be predicted. Moreover, the sales volume of e-commerce products fluctuates greatly and is easy to be affected by many factors such as price, promotion, ranking, etc. In addition, the prediction of e-commerce requires timeliness. Therefore, the mechanism and approaches for predicting e-commerce sales should be reformulated.

3. Methodology

3.1. ARIMA for ECS Forecasting
3.1.1. Basic Theory and Assumptions

ARIMA (p, d, q) is called autoregressive integrated moving average [25]. ARIMA (p, d, q) is used in the e-commerce sales forecasting to build the ECS-ARIMA forecasting model, where AR is an autoregressive and p is an autoregressive term, MA is moving average, q is the moving average term, and d is the number of differentials made when the time series of ECS become stable.

The basic assumptions of the ECS-ARIMA forecasting model are as follows:

(1) The time series of ECS follow the basic assumptions of the traditional ARIMA model.

(2) Abnormal data, including promotions, will be discarded or smoothed out.

(3) The time series of ECS can become a stationary sequence with a finite difference.

(4) Presales of EC are not considered in the ECS-ARIMA forecasting model.

(5) The e-commerce company as a research object operates continuously.

The ECS-ARIMA forecasting model includes the moving average process (MA), the autoregressive process (AR), the autoregressive moving average process (ARMA), and the ARIMA process, depending on whether the time series of ECS is stable or not and what the regression contains.

3.1.2. Moving Average: MA (q)

A qth-order moving average process: MA (q) is expressed as follows:

where is the current value of ECS, u is a constant term, is the white noise sequence of ECS, and are the moving average coefficient.

3.1.3. Autoregression: AR (p)

A pth-order autoregressive process: AR (p) is expressed as follows:

where , are, respectively, the value that lag 1st-order, 2nd-order, , and pth-order of the ECS time series, c is a constant term, and is a white noise process.

3.1.4. The Autoregressive Moving Average: ARMA (p, q)

If the MA (q) process is merged with the AR (p) process, the ARMA (p, q) process can be obtained, which is in the form as follows:

where the meaning of each parameter is the same as those mentioned above.

3.1.5. Autoregressive Integrated Moving Average: ARIMA(p, d, q)

A time series can be transformed into a stationary sequence by one or more differences. If a time series of ECS is transformed into a stationary sequence with d differences, is a nonstationary sequence of d order. The ARMA (p, q) process is established for ; in this way, is a ARMA (p, q) process, and is an ARIMA(p, d, q) process.

3.1.6. Seasonal Autoregressive Integrated Moving Average

When the time series of e-commerce sales are both trendy and seasonal, the series has a correlation that is an integer multiple of the seasonal period. It requires that some appropriate stepwise differencing and seasonal differencing of the series is usually performed to make the series stationary, which should adopt the SARIMA(p, d, q) model for this kind of time series, where P, Q are the seasonal autoregressive and moving average orders, D is the seasonal differencing order, and s is a seasonal cycle. p,d,q are same as the ARIMA (p,d,q) mentioned in Section 3.1.1.

The (S)ARIMA model is good at linear fitting and forecasting, because it is both linear combination of the historical data set residuals and the linear regression of the time series lag items, no matter in the MA, AR, or ARMA process.

3.2. NARNN for ECS Forecasting
3.2.1. Basic Theory

NARNN is called nonlinear autoregressive neural network [26]. The NARNN is used in forecasting of ECS to build an ECS-NARNN forecasting model. The model can continuously learn and train based on past values of a given time series of ECS to predict future values, which has good memory function. The components of the ECS-NARNN model include the input neuron(s), the input layer(s), the hidden layer(s), the output layer(s), and the output neuron(s). The basic framework is as shown in Figure 1.

Figure 1 shows an example NARNN, y(t) is the input and output of the neural network, that is the time series of e-commerce sales, is the output of hidden layer, 1: n represents the delay order (1: 3 shown in the figure), in which the 1: n can be calculated by formula and obtained by constantly trying, w is the link weight, b is the threshold, is the number of hidden layer neurons, and f is the activation function of the hidden and output layer.

The basic assumptions of the ECS-NARNN forecasting model are as follows:

(1) The time series of ECS follow the basic assumptions of the traditional NARNN model.

(2) Other basic assumptions are the same as the assumptions (2) - (5) in Section 3.1.1 of ECS-ARIMA model.

It can be described as follows:

where are, respectively, the value lag 0-order, 1st-order,, and nth-order of the ECS sequence and e(t) is white noise. It can be seen from the equation that the output at the next moment depends on the last n moments.

Based on the principle of autoregression, the following NARNN are used in the model:

Delay in the ECS-NARNN is the time delay of the output signal. Because it is a regression based on its own data, the ECS-NARNN takes the output time delay as the input of the network and calculates the output of the network from the hidden layer and the output layer. The input signal of network is represented by . The hidden layer calculates the output of each neuron based on the connection weight and the threshold between the input data and hidden layer neurons.

where is the output of the jth neuron in hidden layer, i is the ith input e-commerce sales data, n is the number of input e-commerce sales, j is the jth hidden layer neuron, is the number of hidden layer neurons, f is the activation function of the hidden layer, is the input of the ECS time series of the network, is the connection weight between the ith output delay signal and the jth neuron of the hidden layer, and is the threshold of the jth hidden neuron.

The output layer gets the output of the network through a linear calculation based on the output of the hidden layer.

where is the output of the network, f is the activation function of the output layer, is the connection weight between the jth neuron in the hidden layer and the neuron in the output layer, and is the threshold of output layer neurons.

3.2.2. Forecasting of the ECS-NARNN Model

NARNN predictions in ECS-NARNN are recursive. The main idea of this method is to recycle 1st-step forward predictive value. The basic idea is that, as for the NARNN model , the first prediction value can be obtained when k=1; when it is added to the original samples , a new sample can be obtained for the two-step prediction value; then we use the nonparametric model to get the new samples , repeating this continuous cycle until k is reached. Since the information contained in is used for the prediction of the kth step (k>1), the recursive prediction method is better than the direct prediction method.

It can be seen that the ECS-NARNN can perform nonlinear autoregressive prediction based on time series lag values, and the NARNN and all-regression neural network can transform each other, so the ECS-NARNN has significant performance in nonlinear mapping and prediction.

3.3. The ARIMA-NARNN Combined Model

Based on the above basic theories of the ARIMA and NARNN models, a time series of ECS can be considered as comprising a linear autocorrelation structure and a nonlinear component . Therefore, can be expressed as

The basic assumptions of the ARIMA-NARNN combined model are as follows:

(1) The ECS-ARIMA model can fully extracted the linear component of the time series of ECS.

(2) The fitting residues of the ECS-ARIMA model contain a great deal of the nonlinear component in the time series of ECS.

(3) Other basic assumptions are the same as the assumptions (2)-(5) in Section 3.1.1 of ECS-ARIMA model.

The steps of the ARIMA-NARNN combined model to predict are as follows.

Step 1. The linear component is predicted by modeling and forecasting the true time series of ECS by using the ARIMA model.

Step 2. The predicted residuals of the ARIMA model are obtained by The sequence implies a nonlinear relationship in the original time series:where is a random error, are, respectively, the value lag 1st-order, 2nd-order, …, and nth-order of and is the nonlinear autoregressive function.

Step 3. The NARNN model is used to approximate the nonlinear function , and then, the sequence is predicted with the NARNN model. We set the predicted result as .

Step 4. Combining the two models, the final prediction result of the ARIMA-NARNN combined model is as follows. is the predicted sequence of ECS time series data:

The above process is shown in Figure 2.

3.4. Predictive Evaluation Method

We use the mean relative error (MRE), correlation coefficient R2, and root mean square error (RMSE) to evaluate the accuracy of fitting and prediction of each model. [27]

where is the true value of ECS, is the predictive value of ECS, and n is the number of ECS samples.

4. Case Study

We selected a total of 60 types of e-commerce items from the Jingdong Company in China as an empirical research object. The types of items include food, beverages, household appliances, fresh food, household goods, baby products, toys, home textiles, clothing, footwear, etc. Each time series of e-commerce items we selected is from January 2014 to March 2017, a total of 167 weekly sales data sets for one time series. Outliers due to promotions and price changes will be removed and reinterpolated. Then, based on the preprocessed data, the ECS-ARIMA, ECS-NARNN, and the ARIMA-NARNN combined models are, respectively, used to predict the ECS that we selected, and, finally, the prediction errors of the three models are compared by using (12) and (14).

For this time series, a total of 167 weekly sales data sets were used for modeling and forecasting, and the top 85% (i.e., a total of 142 sets of weekly sales data from January 06, 2014, to September 19, 2016) were selected as the model training set. The last 15% (i.e., a total of 25 sets of weekly sales data from September 26, 2016, to March 13, 2017) were used as a test set. A two-sided P value of ≤ 0.05 was regarded as significant.

In order to fully demonstrate the process of the case study, from Sections 4.14.3, a time series (e-commerce sales data for a single food item) was selected as the object to be described. In Section 4.4, the results of a comprehensive analysis of 60 time series consisting of 60 e-commerce products will be presented.

4.1. ARIMA for ECS Forecasting

Based on Eviews 8.0 software, the ARIMA model is used to predict to the ECS. At first, the ECS model training set is plotted as Figure 3. This sequence shows dramatic fluctuations, with some tendency and the possible seasonality; therefore, the (S)ARIMA process is considered for this time series.

The nonstationary sequence shown in Figure 3 is differentiated, and the stationarity test of differential sequence is performed using the augmented dickey-fuller (ADF) test.

From Table 1, the first-order differential sequence is a stationary sequence at a significant level of 0.05, so d = 1 and D = 0 in the ECS-ARIMA model.

From Figure 4, both graphs are trailing. And possible (S)ARIMA models are identified by Eviews, and the best one is selected as SARIMA (2, 1, 3)(1, 0, 1)52. Finally, we use Eviews to predict the total 25 weekly sales data of the test sample from September 26, 2016, to March 13, 2017. The predicted results are in Figure 5.

4.2. NARNN for ECS Forecasting

We use neural network toolbox of Matlab2014b to construct a NARNN structure and use the trial-and-error method to construct the model with the number of hidden layer neurons from 5 to 40, respectively (debugging shows that when the number of neurons exceeds 40, network training time will become longer). The analysis shows that the goods needed to predict for Jingdong is too much, not suitable for an extended training time, that is, after more than 40, model predictive performance improvement is not enough to make up for the training time loss. Since input weights and thresholds directly affect the performance of the neural network, each model is trained 10 times, and the root mean square error (RMSE) and the decision coefficient of training results are recorded as shown in Figure 6.

From Figure 6, as the number of hidden neurons increases, RMSE decreases firstly, and increases. A change to the opposite direction begins to occur after reaching 20, indicating that, as the number increases, the tendency to coordinate results in reduced ability to generalize and finally get the best number of hidden layer neurons of 17. Network training and debugging results are shown in Figures 7 and 8:

From Figure 7, only the confidence interval of the error autocorrelation coefficient exceeds 95% when the delay lag order is 0. The correlation coefficients of the other orders are within 95% confidence intervals and then the relevance of information has been fully extracted. This illustrates this model is for purpose and then get the error graph shown in Figure 8.

The final result is shown in Figure 9.

4.3. ARIMA-NARNN for ECS Forecasting

ARIMA-NARNN combination prediction is mainly completed by the following:

(1) Calculating the residual sequence .

(2) Using the NARNN prediction to obtain the predicted sequence value of the nonlinear prediction part based on the obtained residual sequence .

(3) Calculating the sales forecast result of the ARIMA-NARNN model based on the prediction results of ARIMA model in 4.1 and the nonlinear part residual prediction values obtained in (2).

From Figure 10, only the autocorrelation coefficient of the error whose delay lag order is 0 exceeds 95% confidence intervals. The autocorrelation coefficients of the other orders are within 95% confidence intervals and fluctuate around the 0 value, indicating that the model is reasonable and credible. At the same time, its model error is shown in Figure 11.

The errors of NARNN are shown in Figure 11. The errors of training set, verification set and test set vary little with time, and the residuals in the previous period are close to zero. In the later period, although the residuals have become bigger than before, the overall error is within the acceptable range and fluctuates around the zero value, indicating that the established neural network model is credible and can be used for prediction of future residuals. So based on this network, the forecast result is shown in Figure 12.

This article uses weekly sales data from January 06, 2014, to September 19, 2016, as the experimental set, data from September 26, 2016, to January 13, 2017, as a test set, using the MRE and RMSE to compare the fitting error and prediction error of ECS-ARIMA, ECS-NARNN, and ARIMA-NARNN combined model and then evaluate the predictive performance of each model.

The predicted and actual values of the three models are compared as shown in Figure 13.

From Figure 13, the predicted value of the three models in the test set fits well with the real value, and the prediction performance is also good. The ARIMA-NARNN model has a higher fitting degree for predicted values and real values. However, the result is only for a single time series; in order to verify the universal superiority of the ARIMA-NARNN model, the same analysis process will be performed for the other 59 time series of different e-commerce items sales. The types of items include food, beverages, household appliances, fresh food, household goods, baby products, toys, home textiles, clothing, footwear, etc.

4.4. Model Comparison and Discussion

In the 60 time series of different e-commerce products, the trend and seasonality of them are not exactly the same. For different time series features, different analysis methods (i.e., ARIMA or SARIMA) will be used. The final analysis results are shown in Figure 14.

It can be seen in Figure 14 that the RMSE of ARIMA-NARNN is generally lower than that of ARIMA and NARNN. In order to quantitatively compare the effects of the three models, average of the MRE and RMSE for 60 e-commerce products of fitting and prediction was calculated by using (12) and (14). Table 2 shows the calculation results.

The fitting and forecasting performance of the three models for Jingdong’s weekly sales data is shown in Table 2. It can be seen that both the MRE and RMSE of the ARIMA-NARNN combined model are the lowest in model fitting and model prediction. Therefore, the ARIMA-NARNN combination model is the best, the ECS-NARNN is the second, and the ECS-ARIMA model is the worst.

5. Conclusion

The ECS studied in this paper often has two characteristics: linearity and nonlinearity. We choose the e-commerce sales time series of many single products from Jingdong Company in China as empirical analysis data sets and forecast the time series of weekly sales by ECS-ARIMA model. We find that the model has good adaptability to the linear patterns of e-commerce sales and low fitness to nonlinear patterns, which has a big local error. When ECS-NARNN model is used to predict, it is found that the model can well realize the nonlinear mapping process. However, it is easy to cause underfitting and overfitting because of poor control of the model structure, and the prediction of linear components is not as effective as the ECS-ARIMA model.

We set up the ARIMA-NARNN combined model. Specifically, we use the ECS-ARIMA model to predict linear components of the time series and use the predicted residual of the ARIMA as a nonlinear component. At last, we predict the nonlinear component by using the ECS-NARNN. Our case study shows that the ARIMA-NARNN outperforms the ECS-ARIMA and ECS-NARNN models in terms of the prediction accuracy, which is well adapted to the forecasting of ECS with linear and nonlinear characteristics.

In the actual application of EC companies, the idea of this research can be used to forecast the sales of different types of e-commerce products. Depending on the sales frequency of different types of products, different forecasting durations can be selected to use this more effective ARIMA-NARNN combined model to predict sales in a future period of time. Therefore, according to this precise forecast, the enterprise's inventory strategy and logistics strategy can be more rationally formulated so that the entire supply chain can operate more smoothly.


A. Matlab Code

See Box 1.

Data Availability

The data used to support the findings of this study are available from the corresponding author upon request. See the Appendix.

Conflicts of Interest

The authors declare that they have no conflicts of interest.


The study is funded by Scientific and Technological Support Program of the Ministry of Science and Technology of People’s Republic of China (2014BAH23F01).