Mathematical Problems in Engineering
Volume 2018 (2018), Article ID 6924960, 12 pages
https://doi.org/10.1155/2018/6924960

Research Article

Forecasting of Chinese E-Commerce Sales: An Empirical Comparison of ARIMA, Nonlinear Autoregressive Neural Network, and a Combined ARIMA-NARNN Model

Maobin Li,¹ Shouwen Ji,¹ and Gang Liu²

¹MOE Key Laboratory for Urban Transportation Complex Systems Theory and Technology, Beijing Jiaotong University, Beijing 100044, China
²Beijing Jingdong Century Trading Co. Ltd., Beijing 100044, China

Correspondence should be addressed to Shouwen Ji; jishouwen@126.com

Received 2 February 2018; Revised 25 June 2018; Accepted 27 August 2018; Published 19 November 2018

Academic Editor: Cornelio Posadas-Castillo

Copyright © 2018 Maobin Li et al. This is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

Abstract.

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 [2–7] 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 [2–5] 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 [16–24]. 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 [16–25, 25–31] 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: Example of the NARNN with one input, one hidden layer with 17 neurons, and one output layer with one output neuron and one output.

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.

Figure 2: The ARIMA-NARNN combined model principle.

3.4. Predictive Evaluation Method

We use the mean relative error (MRE), correlation coefficient R², 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.1–4.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.

Figure 3: Original time series graph of a single food item.

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.

Table 1: ADF test of first-order differential sequence.

Null Hypothesis: D(DLOGDATA) has a unit root

Exogenous: Constant

Lag Length: 5 (Automatic - based on SIC, maxlag=13)

t-Statistic
Prob.

Augmented Dickey-Fuller test statistic
-10.36760
0.0000

Test critical values:
1% level

-3.479656

5% level

-2.883073

10% level

-2.578331

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)⁵². 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.

Figure 4: Autocorrelation and partial autocorrelation functions graph of the first-order differential sequence.

Figure 5: Real values and ARIMA model predictive values.

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.

Figure 6: MSE and under different hidden neurons.

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:

Figure 7: The network residual autocorrelation map when the number of hidden neurons is 17.

Figure 8: The error graph of the NARNN fitting model.

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.

Figure 9: Actual values and predicted values from ECS-NARNN.

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.

Figure 10: Error correlation diagram of using NARNN to fit the residual of ARIMA.

Figure 11: Error of using NARNN to fit the residual of ARIMA.

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.

Figure 12: The prediction of using ARIMA-NARNN combined model and actual values.

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.

Figure 13: Actual values and the predicted values from the three models.

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.

Figure 14: RMSE of 60 time series of e-commerce products from the ARIMA, NARNN, and ARIMA-NARNN models.

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.

Table 2: Average of the MRE and RMSE for 60 e-commerce products of fitting and prediction.

Model
Fitting error
Prediction error

MRE
RMSE
MRE
RMSE

ARIMA
0.0998
28.3451
0.1389
31.8082

NARNN
0.0879
19.1893
0.1016
25.5668

ARIMA-NARNN
0.0703
12.9549
0.09012
23.2321

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.

Appendix

A. Matlab Code

See Box 1.

% solved by NARNN based on matlab

% rawdata is a weekly sales data of chocolate of the JD.COM

rawdata=data

T = tonndata(rawdata,false,false);

%  ‘trainlm’ is usually fastest.

%   ‘trainbr’ takes longer but may be better for challenging problems.

%   ‘trainscg’ uses less memory. NTSTOOL falls back to this in low memory situations.

trainFcn = ‘trainbr’; % Bayesian Regularization

feedbackDelays = 1:3;

hiddenLayerSize = 17;

net = narnet(feedbackDelays,hiddenLayerSize, ‘open’,trainFcn);

net.input.processFcns = ‘removeconstantrows’, ‘mapminmax’;

= preparets(net,,,T);

net.divideFcn = ‘dividerand’; % Divide data randomly

net.divideMode = ‘time’; % Divide up every value

net.divideParam.trainRatio = 70/100;

net.divideParam.valRatio = 15/100;

net.divideParam.testRatio = 15/100;

net.performFcn = ‘mse’;

net.plotFcns = ‘plotperform’, ‘plottrainstate’, ‘plotresponse’,...

‘ploterrcorr’, ‘plotinerrcorr’;

= train(net,x,t,xi,ai);

y = net(x,xi,ai);

e = gsubtract(t,y);

performance = perform(net,t,y)

trainTargets = gmultiply(t,tr.trainMask);

valTargets = gmultiply(t,tr.valMask);

testTargets = gmultiply(t,tr.testMask);

trainPerformance = perform(net,trainTargets,y)

valPerformance = perform(net,valTargets,y)

testPerformance = perform(net,testTargets,y)

view(net)

% Plots

% Uncomment these lines to enable various plots.

%figure, plotperform(tr)

%figure, plottrainstate(tr)

%figure, plotresponse(t,y)

%figure, ploterrcorr(e)

%figure, plotinerrcorr(x,e)

netc = closeloop(net);

= preparets(netc,,,T);

yc = netc(xc,xic,aic);

perfc = perform(net,tc,yc)

= preparets(net,,,T);

= net(x1,xio,aio);

= closeloop(net,xfo,afo);

= netc(cell(0,5),xic,aic);

nets = removedelay(net);

= preparets(nets,,,T);

ys = nets(xs,xis,ais);

stepAheadPerformance = perform(net,ts,ys)

genFunction(net, ‘myNeuralNetworkFunction’);

y = myNeuralNetworkFunction(x,xi,ai);

end

if (false)

genFunction(net, ‘myNeuralNetworkFunction’, ‘MatrixOnly’, ‘yes’);

x1 = cell2mat(x(1,:));

xi1 = cell2mat(xi(1,:));

y = myNeuralNetworkFunction(x1,xi1);

end

if (false)

gensim(net);

end

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.

Acknowledgments

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

References

L. R. Dhumne, “Electronic commerce: a current trend,” International Journal on Information Technology Management, 2012.

X. Q. Zhang and S. W. Chen, “Forecast of Chinas Forestation Area Based on ARIMA Model,” Chinese Forestry Science & Technology, vol. 5, no. 2, pp. 50–55, 2010.

K. W. Wang, C. Deng, and J. P. Li, “Hybrid methodology for tuberculosis incidence time-series forecasting based on ARIMA and a NAR neural network,” Epidemiology & Infection, vol. 1, 2017.

S. Wei, D. Zuo, and J. Song, “Improving prediction accuracy of river discharge time series using a Wavelet-NAR artificial neural network,” Journal of Hydroinformatics, vol. 14, no. 4, pp. 974–991, 2012.

L. Yu, L. Zhou, L. Tan et al., “Application of a new hybrid model with seasonal auto-regressive integrated moving average (ARIMA) and nonlinear auto-regressive neural network (NARNN) in forecasting incidence cases of HFMD in Shenzhen, China,” PLoS ONE, vol. 9, no. 6, 2014.

T. Van Calster, B. Baesens, and W. Lemahieu, “ProfARIMA: A profit-driven order identification algorithm for ARIMA models in sales forecasting,” Applied Soft Computing, vol. 60, pp. 775–785, 2017.

P. Ramos, N. Santos, and R. Rebelo, “Performance of state space and ARIMA models for consumer retail sales forecasting,” Robotics and Computer-Integrated Manufacturing, vol. 34, pp. 151–163, 2015.

D. Wei, P. Geng, L. Ying, and S. Li, “A prediction study on e-commerce sales based on structure time series model and web search data,” in Proceedings of the 26th Chinese Control and Decision Conference, CCDC 2014, pp. 5346–5351, China, June 2014.

P. Geng, L. Na, and L. Ben-Fu, “Research on the Prediction of E-commerce Transaction Volume - Based on the Prediction Model of Search Data and Commodity Classification in Station,” Management Modernization, vol. 2, pp. 30–32, 2014.

J. Yu and X. Le, “Sales forecast for amazon sales based on different statistics methodologies,” ICEME, vol. 12, 2016.

Y. Miao, Research on Mid - Season Sales Forecast Based on Machine Learning Theory, Zhejiang University of Technology, 2015.

L. Ye and D. D. Fu, “Experience of He Ruoping using medicine in treating bladder tumor,” Journal of Zhejiang Chinese Medicine University, vol. 39, no. 1, pp. 28–34, 2015.

P. Doganis, A. Alexandridis, P. Patrinos, and H. Sarimveis, “Time series sales forecasting for short shelf-life food products based on artificial neural networks and evolutionary computing,” Journal of Food Engineering, vol. 75, no. 2, pp. 196–204, 2006.

P. H. Franses and R. Legerstee, “Combining SKU-level sales forecasts from models and experts,” Expert Systems with Applications, vol. 38, no. 3, pp. 2365–2370, 2011.

Y. Weng and H. Feng, “Research online store sale forcast model based on BP neural network,” Journal of Minjiang University, 2016.

P. Qin and C. Cheng, “Prediction of Seawall Settlement Based on a Combined LS-ARIMA Model,” Mathematical Problems in Engineering, vol. 2017, Article ID 7840569, 7 pages, 2017.

Y. E. Shao, “Prediction of Currency Volume Issued in Taiwan Using a Hybrid Artificial Neural Network and Multiple Regression Approach,” Mathematical Problems in Engineering, vol. 2013, Article ID 676742, 9 pages, 2013.

J. Huang, Y. Tang, and S. Chen, “Energy Demand Forecasting: Combining Cointegration Analysis and Artificial Intelligence Algorithm,” Mathematical Problems in Engineering, vol. 2018, Article ID 5194810, 13 pages, 2018.

J. M. P. Menezes Jr. and G. A. Barreto, “Long-term time series prediction with the NARX network: An empirical evaluation,” Neurocomputing, vol. 71, no. 16-18, pp. 3335–3343, 2008.

K. Prabakaran, C. Sivapragasam, C. Jeevapriya, and A. Narmatha, “Forecasting Cultivated Areas And Production Of Wheat In India Using ARIMA Model,” Golden Research Thoughts, vol. 3, no. 3, pp. 281–289, 2013.

O. Kaynar and S. Tastan, “Zaman serileri tahmininde arima-mlp melez modeli,” Ataturk University Journal of Economics Administrative Science, 2010.

M. Qin and Z. Du, Red tide time series forecasting by combining ARIMA and deep belief network, Elsevier Science Publishers, 2017.

S. Barak and S. S. Sadegh, “Forecasting energy consumption using ensemble ARIMA-ANFIS hybrid algorithm,” International Journal of Electrical Power & Energy Systems, vol. 82, pp. 92–104, 2016.

R. Bonetto and M. Rossi, “Parallel multi-step ahead power demand forecasting through NAR neural networks,” in Proceedings of the 7th IEEE International Conference on Smart Grid Communications, SmartGridComm 2016, pp. 314–319, Australia, November 2016.

M. Sharafi, H. Ghaem, H. R. Tabatabaee, and H. Faramarzi, “Forecasting the number of zoonotic cutaneous leishmaniasis cases in south of Fars province, Iran using seasonal ARIMA time series method,” Asian Pacific Journal of Tropical Medicine, vol. 10, no. 1, pp. 79–86, 2017.

E. Cadenas, W. Rivera, R. Campos-Amezcua, and C. Heard, “Wind speed prediction using a univariate ARIMA model and a multivariate NARX model,” Energies, vol. 9, no. 2, pp. 1–15, 2016.

R. Gamberini, F. Lolli, B. Rimini, and F. Sgarbossa, “Forecasting of sporadic demand patterns with seasonality and trend components: An empirical comparison between holt-winters and (s)ARIMA methods,” Mathematical Problems in Engineering, vol. 2010, Article ID 579010, 15 pages, 2010.

M. A. Rahman and L. Casanovas, “Strategies to Predict E-Commerce Inventory and Order Planning,” International Journal of Technology Diffusion, vol. 8, no. 4, pp. 17–30, 2017.

S. Li and R. Li, “Comparison of forecasting energy consumption in Shandong, China Using the ARIMA model, GM model, and ARIMA-GM model,” Sustainability, vol. 9, no. 7, 2017.

M. H. Amini, A. Kargarian, and O. Karabasoglu, “ARIMA-based decoupled time series forecasting of electric vehicle charging demand for stochastic power system operation,” Electric Power Systems Research, vol. 140, pp. 378–390, 2016.

P. Sen, M. Roy, and P. Pal, “Application of ARIMA for forecasting energy consumption and GHG emission: A case study of an Indian pig iron manufacturing organization,” Energy, vol. 116, pp. 1031–1038, 2016.