Oil Price Forecasting Based on EMD and BP_AdaBoost Neural Network

Show more

1. Introduction

Crude oil is part of the most important financial instruments in the commodity market. Predicting the price fluctuations and trends of the crude oil market accurately is very significant for the country, enterprises, financiers and investors. However, crude oil price fluctuations usually present non-stationary, complex, non-linear, long-term memory characteristics. And the crude oil price forecast is a major difficulty in commodity research. With the development of the crude oil market, it is particularly important to use appropriate decomposition methods and establish appropriate time-series prediction models to forecast oil prices.

In recent years, people have been paying more and more attention to the application of multi-scale decomposition methods in non-stationary financial time series. The multi-scale decomposition methods are mainly wavelet analysis methods and empirical mode decomposition methods. Wavelet analysis can perform multi-scale analysis on signals in the time domain and frequency domain, and gradually refine the original sequence into sub-sequences of different frequencies [1]. The neural network method based on wavelet transform has been extensively used in financial time-series analysis, but wavelet analysis still has some defects, which cannot be adaptively decomposed, because wavelet transform is generated on the basis of Fourier transform. The essence is still the window-adjustable Fourier transform, and there are still limitations of the Fourier transform. Therefore, wavelet analysis cannot perform multi-scale analysis well, and it also generates false harmonics when simulating the original signal.

Huang N. E. proposed an empirical mode decomposition (EMD) method in 1998; it is in a position to smooth nonlinear, non-stationary raw time series data signals while maintaining the originality as much as possible in the decomposition [2]. At present, many scholars use EMD methods and artificial neural network combined forecasting methods to predict financial time series. Yu et al. combined EMD with a fuzzy neural network (FNN) to predict international crude oil futures prices [3]. Zhang et al. used the EMD method to analyze the basic characteristics of the oil price series on different time scales, and pointed out that it can be predicted by using decomposition models combined with SVM and other prediction models [4]. Islam used the EMD method to decompose the financial time-series, and compared it with wavelet decomposition. The results show the effect of EMD decomposition is better [5]. Tao constructed an innovative multi-period oil futures price forecasting model based on EMD-based FNN model [6]. Wei proposed the ANFIS algorithm based on EMD decomposition and FNN model to predict Taiwan TAIEX and HSI stock indexes [7].

Scholars use BP neural network combined with EMD method to make predictions. However, BP neural network has the effects of local minimum value, slow convergence rate and poor generalization ability of the model. The AdaBoost algorithm can improve the prediction accuracy of the set weak predictor, and solves many problems that the weak predictor does not predict well. Therefore, in order to make up for the limitation of BP neural network weight initialization and sample data, and improve the prediction accuracy of BP neural network and EMD method, this paper proposes a BP_AdaBoost model time-series prediction method based on EMD method, and applies the model into crude oil. The empirical results are shown that the prediction accuracy of the model are preferable to the ARIMA model, BP neural network and EMD-BP combined model.

2. Fundamental Principles

2.1. Empirical Mode Decomposition

Huang N.E proposed the concept of the Intrinsic Mode Function (IMF) to represent the indigenous features of the signal. At any time, a signal can be the sum of a finite number of IMFs. Huang pointed out that the part obtained by decomposition must meet the following two conditions to be the IMFs: 1) The number of extreme points and the number of zero-crossing points are at most one difference; 2) The mean value of the upper and lower envelopes formed by the points of maximum and minimum is equal to zero. The specific decomposition steps are as follows [8] :

Step 1: Determine the local maximum point and the local minimum point of the original sequence $X\left(t\right)$ , and then interpolate it with the cubic spline function to obtain the upper envelope sequence value ${U}_{1}\left(t\right)$ and the lower envelope sequence value ${L}_{1}\left(t\right)$ respectively.

Step 2: Calculate the mean of the upper envelope ${U}_{1}\left(t\right)$ and the lower envelope ${L}_{1}\left(t\right)$ at each moment to obtain the instantaneous average ${m}_{1}\left(t\right)$ , ${m}_{1}\left(t\right)=\left({U}_{1}\left(t\right)+{L}_{1}\left(t\right)\right)/2$.

Step 3: The original sequence $X\left(t\right)$ subtracts ${m}_{1}\left(t\right)$ can obtain the difference sequence ${h}_{1}\left(t\right)$ , ${h}_{1}\left(t\right)=X\left(t\right)-{m}_{1}\left(t\right)$ . If ${h}_{1}\left(t\right)$ meet the two assumptions of the IMF, ${h}_{1}\left(t\right)$ is an intrinsic mode function. Then make ${c}_{1}\left(t\right)={h}_{1}\left(t\right)$ . If ${h}_{1}\left(t\right)$ is not met the two assumptions, think of ${h}_{1}\left(t\right)$ as $X\left(t\right)$ . Repeat the above steps until the empirical model function is met the definition of intrinsic mode function.

Step 4: With the original sequence original $X\left(t\right)$ subtract ${c}_{1}\left(t\right)$ , it can obtain the residual sequence ${r}_{1}\left(t\right)$ , ${r}_{1}\left(t\right)=X\left(t\right)-{c}_{1}\left(t\right)$ . Then, make ${r}_{1}\left(t\right)$ as the original sequence. Repeat steps 1 - 4 until the obtained residual sequence ${r}_{n}\left(t\right)$ is a monotonic function and cannot be extracted. At this time, the original sequence can be expressed as

$X\left(t\right)={\displaystyle \underset{i=1}{\overset{n}{\sum}}{c}_{i}\left(t\right)+{r}_{n}\left(t\right)}$ (1)

Among them, the number of IMFs is n. The residual is ${r}_{n}\left(t\right)$ which represents the long-term trend of the original sequence; ${c}_{i}\left(t\right)$ represents the IMF component, ${c}_{1}\left(t\right),{c}_{2}\left(t\right),\cdots ,{c}_{n}\left(t\right)$ represents the part of the original sequence with different frequencies from high to low.

2.2. Basic Principles of BP_AdaBoost Model

The AdaBoost algorithm is just an iterative algorithm. The core idea of the algorithm is to process the same test sample data, obtain multiple weak predictors, and then obtain the weight of different weak predictors through training, and finally combine the outputs of multiple weak predictors to form strong predictor. The weak predictor in the BP_AdaBoost model is a BP neural network. Depending on the prediction result of each weak predictor, changing the weight of the training sample. And train the weak predictor of BP neural network. Finally, the output of the BP neural network weak predictor is combined to form a strong predictor. The specific algorithm steps are as follows [9] :

Step 1: Initialize the distribution weight of the samples and the BP neural network. Select m training samples in the sample data, and initialize the distribution weight of the training sample ${D}_{t}\left(i\right)=1/m$ . The number of input layer nodes and output layers in the BP neural network are determined by the sample input feature dimension and the output result dimension, respectively, and the weight and threshold of the BP network are initialized.

Step 2: Preprocess the data. The data is normalized so that the reprocessed data can be read by the BP neural network weak predictor.

Step 3: Weak predictor prediction. When the t-th BP weak predictor is trained through the training samples, the prediction error ${\epsilon}_{t}$ of the prediction sequence $g\left(t\right)$ can be obtained according to the BP neural network output, and the formula is

${\epsilon}_{t}={\displaystyle \underset{i=1}{\overset{m}{\sum}}{D}_{t}\left(i\right)}\begin{array}{cc}& \text{when}g\left(t\right)\ne y\end{array}$ (2)

$g\left(t\right)$ is forecast results for the network, $y$ is expected value.

Step 4: Calculate the weight of the prediction sequence $g\left(t\right)$ , and use the sum of the prediction error in Equation (2) to calculate the weight of $g\left(t\right)$ . The formula is:

${w}_{t}=\frac{1}{2}\ast \mathrm{ln}\left[\left(1-{\epsilon}_{t}\right)/{\epsilon}_{t}\right]$ (3)

Step 5: Update the sample weight. The next round of sampling data weight is adjusted by the predicted sequence weight ${w}_{t}$ , and the mathematical expression is

${D}_{t+1}\left(i\right)=\frac{{D}_{t}\left(i\right)}{{B}_{t}}\ast \mathrm{exp}\left[-{w}_{t}{y}_{i}{g}_{t}\left({x}_{i}\right)\right]$ (4)

Step 6: Output the strong predictor. After training T time, T weak prediction functions are obtained, then the strong prediction function is:

$h\left(x\right)={\displaystyle \underset{t=1}{\overset{T}{\sum}}\frac{{w}_{t}}{{\displaystyle \underset{t=1}{\overset{T}{\sum}}{w}_{t}}}\ast f\left({g}_{t},{w}_{t}\right)}$ (5)

3. Oil Price Prediction Model Based on EMD and BP_AdaBoost Model

Using algorithms to predict the crude oil prices. Figure 1 is based on the EMD method and BP_AdaBoost model oil price forecasting process.

The specific modeling steps are as follows:

1) Determine sample data. Suppose the sample sequence is $X={\left({x}_{1},{x}_{2},\cdots ,{x}_{n}\right)}^{\prime}$ , and n is the number of sample sequences.

2) Perform a stationarity test on the sample sequence $X$ to determine whether it is stable.

3) After decomposing by the EMD method, $t-1$ IMF components and a residual component are generated.

${\left({x}_{1},{x}_{2},\cdots ,{x}_{n}\right)}^{\prime}\underset{}{\overset{EMD}{\Rightarrow}}\left(\begin{array}{cccc}{f}_{11}& {f}_{12}& \cdots & {f}_{1t}\\ {f}_{21}& {f}_{22}& \cdots & {f}_{2t}\\ \cdots & \cdots & \cdots & \cdots \\ {f}_{n1}& {f}_{n2}& \cdots & {f}_{nt}\end{array}\right)\Rightarrow \left({F}_{1},{F}_{2},\cdots {F}_{t}\right)$ (6)

Figure 1. Oil price prediction flow chart based on EMD method and BP_AdaBoost model.

Among them, ${F}_{i},i=1,2,\cdots ,t-1$ is the intrinsic mode function obtained by decomposition, and ${F}_{t}$ is the residual component.

4) Perform data preprocessing.

${v}_{i}=\frac{{F}_{i}-{F}_{\mathrm{min}}}{{F}_{\mathrm{max}}-{F}_{\mathrm{min}}}$ (7)

${v}_{i},i=1,2,\cdots ,t$ is the normalized value.

5) Identify the structural parameters of the BP_AdaBoost model. The normalized IMFs and residual component will form several BP neural network weak predictors. And depending on the principle of BP_AdaBoost algorithm. The weight of the BP weak predictor will be continuously updated. The error will be rectified repeatedly. Network training will be carried out, and finally several predictors are combined to output a strong predictor.

4. Empirical Research

4.1. Selection of Sample Data

This paper selects the daily closing price of brent crude oil from November 28, 2014 to March 18, 2018 as an experiential research object. The data is from EIA, 843 samples in total. The whole data is divided into 2 sections. Among them, 828 of data from November 28, 2014 to February 23, 2018 is chosen as the training set. The prediction model based on EMD and BP_AdaBoost model is established. The selection is taken from February 26, 2018. A total of 15 data were used as a test set on March 18, 2018. Figure 2 shows the price chart of brent crude oil. This article utilizes R language and Matlab software for programming.

4.2. Stationary Tests

It can be seen from Figure 2 that the entire sequence changes with time, and the original sequence has obvious non-stationary and nonlinear variation characteristics. In order to test the stationarity of the original sequence, the unit root test is performed. The results are presented in Table 1. After testing, the ADF value of the original sequence is −2.12, and the corresponding P value is 0.23, so the

Figure 2. Crude oil price series.

Table 1. Results of stationarity test of the original sequence.

rejection is not rejected under the confidence of 0.95. The null hypothesis is the case that crude oil prices are non-stationary time series.

4.3. EMD Decomposition

The EMD method is utilized to decompose the sample sequence, and 7 IMF components and one residual amount are generated. Figure 3 is the EMD decomposition result of the sample sequence, showing the frequency from the IMF1 component to the IMF7 component from high to low. The bottom is the residual component. The higher frequency IMF corresponds to the short-term trend of the crude oil price, and the lower frequency IMF corresponds to the long-term change of the crude oil price, and the residual corresponds to the trend of the crude oil price. Each intrinsic mode function obtained by EMD decomposition can represent the local features of the original time-series, so the intrinsic mode function obtained after the analysis and decomposition can well grasp the essential feature information of the original time series.

4.4. Forecast Model Parameter Settings

Firstly, in order to obtain a good prediction effect, before the BP_AdaBoost model is modeled, the IMF component and the trend term need to be reprocessed so that the value is distributed between [0, 1]. Secondly, after many attempts, we chose the parameter with the highest prediction accuracy. The training target in the BP neural network is set to 0.001, the maximum number of

Figure 3. IMF component of the oil price series and trend items.

training is 1000, and the activation function of the hidden layer node is tansig., the training target in the BP neural network is set to 0.001, the maximum number of training is 10,000, and the activation function of the hidden layer node is tansig. Then, through training data training network, the test sample prediction sequence output is obtained, and the test sample weight value is updated according to the output result, and the BP neural network weak predictor and its corresponding weight are obtained. Finally, when using the AdaBoost algorithm for combination, this paper takes the sample with the prediction error greater than 0.001 between the actual output of the BP neural network and the real value as the sample that needs to strengthen the learning, continuously corrects the error, repeatedly trains the network, and optimizes the BP through the AdaBoost iterative algorithm. The BP_AdaBoost prediction model is calculated by the neural network, and the strong predictor is output. The BP_AdaBoost prediction model of this paper is made up of 10 BP network weak predictors.

Table 2 shows the true value of the brent crude oil price series and the predicted values of the model constructed in this paper, and gives the corresponding absolute error value and relative error value.

5. Model Comparison

5.1. Evaluation Criteria

The prediction accuracy and effectiveness of different methods are compared by the root mean square error (RMSE), mean absolute error (MAE), mean absolute percentage error (MAPE), Theil inequality coefficient (U) and other evaluation indicators. Assuming that the original price series is ${Y}_{i}$ and the predicted price series is ${\stackrel{^}{Y}}_{i}$ , the calculation formulas for these evaluation indicators are defined as follows:

Table 2. Oil price predict results.

$RMSE=\sqrt{\frac{1}{n}{\displaystyle \underset{i=1}{\overset{n}{\sum}}{\left({Y}_{i}-{\stackrel{^}{Y}}_{i}\right)}^{2}}}$ (8)

$MAE=\frac{1}{n}{\displaystyle \underset{i=1}{\overset{n}{\sum}}\left|{Y}_{i}-{\stackrel{^}{Y}}_{i}\right|}$ (9)

$MAPE=\frac{1}{n}{\displaystyle \underset{i=1}{\overset{n}{\sum}}\left|\frac{{Y}_{i}-{\stackrel{^}{Y}}_{i}}{{Y}_{i}}\right|}$ (10)

$TheilU=\frac{\sqrt{\frac{1}{n}{\displaystyle {\sum}_{i=1}^{n}{\left({Y}_{i}-{\stackrel{^}{Y}}_{i}\right)}^{2}}}}{\sqrt{\frac{1}{n}{\displaystyle {\sum}_{i=1}^{n}{Y}_{i}{}^{2}}}+\sqrt{\frac{1}{n}{\displaystyle {\sum}_{i=1}^{n}{\stackrel{^}{Y}}_{i}{}^{2}}}}$ (11)

5.2. Model Effect Comparisons

In order to check the validity of the BP_AdaBoost model constructed in this paper, it is compared with the ARIMA model, BP neural network and EMD-BP combined model. Crude oil price series prediction is carried out by the above method, and compared with the original sequence. The accuracy is evaluated. Table 3 gives a comparison of the forecast performance of different predictive models.

From the prediction results in Table 3, the model with the highest prediction accuracy in the ARIMA model, BP neural network and EMD-BP combined model is the EMD-BP combined model with root mean square error (RMSE) and mean absolute error (MAE) are 1.5226 and 1.2101 respectively. The root

Table 3. Comparison of prediction models for brent crude oil price.

mean square error (RMSE) and mean absolute error (MAE) of the EMD-BP_AdaBoost model constructed in this paper are only 0.9823 and 0.8337, which indicate that it has higher prediction accuracy than other models. According to the training samples, the EMD + BP_AdaBoost combined model uses the AdaBoost algorithm to form a strong predictor of BP neural network weak predictors, which can improve the generalization ability. The prediction error is significantly lower than the ARIMA model, BP neural network and The EMD-BP combined model has a certain improvement in prediction accuracy and has evident reference value for crude oil price prediction.

6. Conclusions

This paper aims to fully consider the non-stationary and non-linear characteristics of crude oil price data, introduces the EMD method to decompose crude oil price data, and proposes an oil price forecasting method based on EMD and BP_AdaBoost model. In this paper, the EMD multi-scale decomposition method is used to decompose the crude oil price series into 8 IMF components and a residual quantity, then normalize the data, select the BP_AdaBoost model to predict the price series, and finally obtain the prediction result of the original sequence. The prediction results of BP_AdaBoost model are compared with ARIMA model, BP neural network and EMD-BP combination model. The empirical results show that the AdaBoost iterative algorithm optimizes the combination of multiple BP neural network weak predictor outputs for oil price prediction, which effectively reduces the problem that a single BP neural network is easy to fall into local minimum, and the optimized model can improve generalization performance. As well as prediction accuracy, its prediction effect is preferable to other models.

Compared with the existing prediction models, the EMD + BP_AdaBoost combination model constructed in this paper has certain advantages:

1) The EMD method can realize adaptive decomposition, which can extract signals of different frequencies and decompose the original complex signals into simple sub-sequences without loss of information.

2) Compared with the BP neural network model based on the EMD method, the prediction model based on EMD and BP_AdaBoost has stronger generalization ability, reduces the influence of local minimum values in BP neural network, and improves the prediction accuracy. And it can better meet the needs of non-linear, time-varying crude oil price forecasting, and has a useful application prospect.

Acknowledgements

This project was funded through National Natural Science Foundation of China (61703117); Guangxi Key Laboratory of Spatial Information and Surveying and Mapping (15-140-07-33); Guangxi Key Laboratory of Spatial Information and Surveying and Mapping (16-380-25-20).

Conflicts of Interest

The authors declare no conflicts of interest regarding the publication of this paper.

References

[1] Torrence, C. and Compo, G.P. (1998) A Practical Guide to Wavelet Analysis. Bulletin of the American Meteorological Society, 79, 61-78.

https://doi.org/10.1175/1520-0477(1998)079<0061:APGTWA>2.0.CO;2

[2] Huang, N.E., Shen, Z., Long, S.R., et al. (1998) The Empirical Mode Decomposition and the Hilbert Spectrum for Nonlinear and Non-Stationary Time Series Analysis. Proceedings of the Royal Society of London A: Mathematical, Physical and Engineering Sciences, 454, 903-995.

https://doi.org/10.1098/rspa.1998.0193

[3] Yu, L., Wang, S. and Lai, K.K. (2008) Forecasting Crude Oil Price with an EMD-Based Neural Network Ensemble Learning Paradigm. Energy Economics, 30, 2623-2635.

https://doi.org/10.1016/j.eneco.2008.05.003

[4] Zhang, Y.J. and Wei, Y.M. (2010) The Crude Oil Market and the Gold Market: Evidence for Cointegration, Causality and Price Discovery. Resources Policy, 35, 168-177.

https://doi.org/10.1016/j.resourpol.2010.05.003

[5] Islam, M.R., Rashedalmahfuz, M., Ahmad, S., et al. (2012) Multiband Prediction Model for Financial Time Series with Multivariate Empirical Mode Decomposition. Discrete Dynamics in Nature and Society, 2012, 87-88.

https://doi.org/10.1155/2012/593018

[6] Xiong, T., Bao, Y.K. and Hu, Z.Y. (2013) Beyond One-Step-Ahead Forecasting: Evaluation of Alternative Multi-Step-Ahead Forecasting Models for Crude Oil Prices. Energy Economics, 40, 405-415.

https://doi.org/10.1016/j.eneco.2013.07.028

[7] Wei, L.Y. (2016) A Hybrid ANFIS Model Based on Empirical Mode Decomposition for Stock Time Series Forecasting. Applied Soft Computing, 42, 368-376.

https://doi.org/10.1016/j.asoc.2016.01.027

[8] Huang, N.E., Shen, Z. and Long, S.R. (1999) A New View of Nonlinear Water Waves—The Hilbert Spectrum. Annual Review of Fluid Mechanics, 31, 417–457.

https://doi.org/10.1146/annurev.fluid.31.1.417

[9] Hu, D., Zheng, D. and Fu, H. (2015) Application of AdaBoost-BP Model to Dam Deformation Prediction. Journal of China Three Gorges University, 37, 5-8.