1. Introduction
Influenced by many uncertain factors, international crude oil prices are characterized by high randomness. The traditional crude oil price forecasting model, which is based on time series analysis, extracts effective information from historical price series, decomposes those price series into trend, seasonal, periodic and random components, and makes reasonable judgements on the basis of historical trends and future trends. This model plays a key role in judging historical trends reasonably and predicting future trends accurately in investment and decision-making.
Trends in the price sequence of crude oil often depend on a specific time frame that reflects the interrelationships between the data on a time scale. Therefore, predictions of trends tend to occur over specific time intervals. In terms of trend characterization, Noguera (2011) verified the randomness of oil prices by analysing multiple structural changes in actual oil prices [
1]. Zhang and Zhang (2014) used the Markov system transformation model with dynamic autoregressive coefficients to discuss the Brent and West Texas Intermediate (WTI) price patterns after the financial crisis and analysed the reasons for the abnormal fluctuations of these two benchmark crude oil prices [
2]. Luo et al. (2019) established fuzzy information particles, granulated time series that were used to characterize the time series characteristics, and predicted the trends of time series such as temperature and financial data [
3]. Yahyaoui et al. (2018) proposed a new trend-based symbolic approximation (SAX) reduction technique to classify time series with different trends by using variable segment sizes of time series variation points [
4]. Mello et al. (2018) proposed a new method for classifying time series with different trends by using the probability density function (PDF) and K-nearest neighbour (KNN) algorithm, indicating that there are similarities and differences among different time periods of time series [
5]. Although the above research introduced a new perspective for describing time series, it remains difficult to grasp the temporal attributes of those time series, and thus the temporal characteristics inherent in the time series (for those time series with nuances) are fundamentally ignored. However, it is difficult to distinguish temporal attributes accurately.
Recognizing that the selection of the time window has an important impact on time series analysis, scholars have proposed a predictive model for variable windows. Gao et al. (2016) examined the evolution of different wave patterns over time from a complex network perspective using a sliding time window to divide the time series of crude oil prices into several parts and defined an autoregressive model based on regression to indicate the fluctuation of each segment. This model proves that there are various autoregressive modes with significantly different statistical characteristics under different periodic time series [
6]. An uncertain hidden state can affect the changes in trends [
7], creating some difficulty in describing those trends. In addition, there is a popular trend analysis theorem based on time series analysis that is dominated by the moving average method [
8]. However, because the values predicted by this method always stay at the previous levels, higher or lower fluctuations cannot be predicted for the future [
9,
10]. In addition, these methods use a fixed periodic window for each point in the time series, and just because the trend of the time series changes with the length of the window, the same window size is used for all points. This assumption is not reasonable. The trend of the time series is not singular. In contrast, the trend is variable [
11,
12,
13,
14]. Although the above theories have important application value in finance, biomedicine and environmental science, the selection of the time interval, the sampling frequency of the data and sudden changes in the sample structure will affect the prediction of price trends [
15].
Many linear and non-linear models have been widely used in forecasting daily oil prices [
16]. For non-stationary data, many scholars often use autoregressive integrated moving average (ARIMA) as a time series prediction model to analyse and predict time series [
17]. The autoregressive model (AR) is widely used in economics, informatics, and prediction of natural phenomena and achieves good prediction results [
18,
19,
20]. With the application of big data technology, many machine learning and deep learning algorithms have been applied to oil price forecasting and have achieved good results. The support vector machine (SVM) is a popular model in the field of machine learning. Its advantage is that it can effectively solve nonlinear problems, and the training samples are very simple. The disadvantage is that the training time for large-scale training data samples is very long, and thus, the SVM is usually used in contrast methods [
21,
22,
23]. The back propagation neural network (BPNN) is another relatively common model in deep learning. It is widely used in time series prediction. It has the advantages of a strong nonlinear mapping ability, high self-learning and self-adaptive abilities, and a certain fault tolerance capability; however, the downside is that the calculation convergence speed is slow, and it easily falls into local minima. Given the good performance of the BPNN, it is often used in oil price forecasting [
24,
25]. The above methods can effectively describe the nonlinearity and complexity of crude oil price series, but they still suffer from some problems, such as over-fitting, poor stability and lack of interpretability.
So far, there has been limited research on oil price forecasting using a time-varying method, and there are only some early attempts by some people [
26,
27]. Early researchers provided theoretical ground for our research and proved that the method of characterizing oil prices with polynomial function parameters is feasible [
28]. The above studies have effectively resolved the description of price trends and the prediction of price fluctuations. However, these methods often describe the trends of time series in a single category or a few categories without taking into account the nuances of different oil price trends over time, which makes it difficult to distinguish between subtle changes in those trends. Therefore, there are two main research problems in the paper: ‘‘how can we describe oil price trends with time-varying characteristics?’’ and “what are the historical price data we should choose to use?” In response to these questions, this paper proposes a time-varying trend method using variable time windows and parameter vectors in the window based on the function approximation theory [
29]. The main methodologies are as follow. Firstly, the oil prices are converted into time-varying trends, and then the time-varying trends are used to find the trend threshold corresponding to each point. Secondly, due to the superiority of machine learning models, we use support vector regression (SVR) to predict the trend threshold. Thirdly, the frequency division regression prediction method is used to predict the time-varying trend of oil price based on the obtained trend threshold and restore it to the predicted value of oil price. Finally, the obtained results are compared with ARIMA and AR models in different hyper parameters, and the significant difference tests are performed on the obtained indicators. Generally, controlling oil prices in the future could provide effective help for policy makers and investors [
30]. One of the contributions of this article is that the lag relationship between the time-varying trend components between Brent and WTI. By converting the prices of two oil products into a time-varying trend series, and then by referring to the time-varying trend of WTI, the time-varying trend of Brent after two months can be predicted. It is a new method for studying oil price trends, which verifies the feasibility of combining time-varying windows with parameter vectors to characterize oil prices.
This paper is divided into four parts. The first part introduces the main work of current time series trend forecasting. In the second part, the concept and algorithm of the time-varying trend decomposition model (TV-TD model) are proposed. In the third part, the time-varying trend model is used to construct the time-varying trend and perform a short-term forecast of the Brent and WTI crude oil spot prices. The TV-TD model has been tested by the data from different time periods and been evaluated by the mean absolute percentage error ratio (MAPE-ratio), mean squared prediction error ratio (MSPE-ratio) and success ratio as evaluation indices. Finally, the Diebold–Mariano test and the Pesaran–Timmermann test are performed on the predicted values to determine whether the predicted results have significant differences. In the fourth part, we draw conclusions on our model and provide some suggestions for related scholars and investors about discussing the oil prices with time-varying characteristic to help them make properly decisions.
2. Materials and Methods
Based on the above analysis, this paper uses a variable time window and the polynomial decomposition method to define the trend term and proposes a crude oil price prediction method based on a time-varying trend decomposition model (TV-TD model) to describe the change in the trend over time, and then the crude oil price is predicted. The TV-TD model is divided into three parts, as shown in
Figure 1. The first part constructs a time-varying trend to quantitatively describe the trend of time series sample points. The second part constructs a trend threshold. On the one hand, the trend threshold is filtered by overshoot points, and on the other hand, support vector regression is used to perform the rolling prediction according to the obtained trend threshold sequence; then, the trend threshold of the sample point to be predicted, which can be used for the frequency division regression prediction method, is obtained. Finally, the obtained time-varying trend and trend threshold are used to perform the short-term prediction of time series sample points.
2.1. Construction of Time-Varying Trends
The rising and falling state of a time series sample point is determined by the relationship between the selected sample point and its context data. For the same sample point, selecting different time windows will show different trends. Therefore, to characterize the different trends exhibited by the differences in the selected time windows, we first give the following definitions.
2.1.1. Related Definitions of Time-Varying Trends
Definition 1. For a given time series , for any of the sample points and for particular numbers , the interval that satisfies is called the time-varying window of the sample point (Figure 2). Definition 2. For the time-varying window of the sample point , let ; then, call the post-position of the sample point . In addition, let ; then, call the pre-position of the sample point .
Correspondingly, we call the interval the post-position interval of the time series sample point , denoted by the symbol , we call the interval the pre-position interval of the time series sample point , denoted by the symbol , and we call the length of the time-varying window, expressed by . For convenience, the vector formed by the pre-position and post-position are denoted , where .
It is important to note that for a given time , is a function of , and is a function of . Therefore, the time-varying window represents all possible intervals containing the time , and the most suitable time-varying window for the sample point at each moment is not necessarily the same.
In Definitions 1 and 2, can reflect the influence of historical information on , and can reflect the impact of on future data.
In financial time series, there are different trend changes for all subsequences contained in a time window of different sample points. Moreover, the closer the sample point is to the trend, the greater the influence on the trend of the point [
31]. Although we cannot accurately describe an overall sequence with a single function, the sub sequences within each time window can be described by different fitting functions. We call the coefficients used to fit the fitting functions of the sub sequences in the time window the trends of the sub sequences on this time window. However, although the trends of the sub sequences on the time window have been described, since there are many kinds of time windows for each point, the way in which they can be described is not unique, and thus, we have a limited time variation from this point. In the time window, we find the optimal fitting function for the subsequence containing this point and the time window corresponding to the best fit. At this time, the coefficients and time window of the optimal fit function are referred to as the time-varying trend of the sample points.
On the time-varying window of the time series sample point , there is a fitting function such that has the best fitting effect on the time-varying window. Then, the vector formed by the coefficient vector of the coefficients of the optimal fitting function and the corresponding time window is the time-varying trend of the time series sample point , represented by the symbol . It is easy to find that , where are the time-varying window endpoints corresponding to the optimal fit.
2.1.2. Time-Varying Trend Construction
As seen from the above definition, the use of different fitting functions produces different forms of time-varying trends, which forces us to search for a reliable and convenient fitting function to solve the time-varying trend. For vectors, polynomial functions have good representation capabilities [
28]. So, an Algorithm 1 is proposed to solve the time-varying trend for polynomial functions.
Algorithm 1. Time-varying trend construction. |
Input: Time series, search space for fitted polynomials , search space for time-varying window. Output: Time-varying trend of time series sample point . Step 1: Use different degree polynomials in S to fit the sample points on the selected window to get different sets of coefficients and errors, and choose a set of coefficients with the smallest error. Step 2: Traverse all windows in the search space and restore the resulting polynomial fitting parameters with time-varying windows. According to the formula obtain the fitting value . Select the fitting polynomial coefficients with the smallest fitting errors with the corresponding time-varying window to form the time-varying trend of sample point .
|
2.2. Construction of The Trend Threshold
In the field of machine learning, the SVR is a commonly used predictive model. The SVR model has reliable theoretical support and has a high model prediction accuracy [
32]. The SVR model introduces kernel techniques and can fit various forms of functions. SVR, which is mainly applied to the regression of multivariate predictive variables, estimates the function by solving an optimization problem. It has strong advantages in numerical fitting and parameter optimization and is suitable for price time series with randomness and seasonal characteristics [
22]. In this section, this paper first introduces the basic mathematical theory of SVR and then uses SVR to predict the trend threshold.
2.2.1. The Concept of SVR
Support vector regression (SVR) is a machine learning algorithm based on statistical learning theory, with utilization of the structural risk minimization (SRM) principle [
33]. Given a training set
, where
and
(
i = 1: m is the number of data pairs). SVR maps the training data into a higher dimensional feature space then builds a linear model
to predict the target vector as shown in Equation (1):
where
w is the weights vector,
is the non-linear higher dimension mapping of
x, and
b is the bias term. The aim of SVR is to find
w and
b to predict
y using
x as input, with
f being as flat as possible. To achieve a flat function
f, the weight vector
w must be as small as possible [
34].
2.2.2. Using SVR to Predict Trend Thresholds
Due to the overshoot phenomenon of a polynomial function, the blind use of a large amount of data will sharply modify the prediction accuracy. Therefore, it is necessary to determine the number of data points involved in the prediction. To determine how much historical data are needed for short-term predictions, we present a method intended to determine the order while using historical data points reasonably and efficiently and thus define the trend thresholds.
First, for the time-varying trend of all sample points, the error between the predicted and true values is calculated by traversing the lag order of the sample training set to be predicted. After the error is obtained, the starting point of the overshoot phenomenon of the error is found in all the results for each point, after which the error suddenly increases, and this point is defined as the trend threshold.
Second, after obtaining the trend threshold of the sample points, the specific regression algorithm described above is used to perform a rolling prediction on the trend threshold. The predicted trend threshold value is then used as the lag order for predicting the data points outside the sample and reducing it to the predicted oil price. For unreasonable predicted values, their trend thresholds are gradually reduced and re-screened until the predicted results fall within the pre-determined allowable range.
In this paper, the SVR model is used to predict the trend threshold sequence. The trend threshold of the previous day is used as the input, and the SVR is used to predict the trend threshold of the next day.
2.3. Oil Price Forecast
Based on the forecasting results of the time-varying trends and trend thresholds, a new method for forecasting oil prices is presented.
Algorithm 2. Frequency division regression prediction method. |
Input: Time-varying trend of time series sample points , where . Output: The predicted value of the time series sample point . Step 1: Extract each component from the input time-varying trend. , after which the least squares estimate of the sequence and the sequence are obtained, and the regression vector is obtained as well. Step 2: Use the obtained vector , use to obtain the predicted value of the sample point according to the formula .
|
By using Algorithm 2, the predicted oil price can be obtained by inputting the time-varying trend and the trend threshold of the sample point to be predicted. At the same time, different models need to be used for comparison to verify the superiority of the proposed model.
To test the prediction accuracy of the TV-TD model outside the sample, we use the mean absolute percentage error ratio (MAPE-ratio), mean squared prediction error ratio (MSPE ratio) and success ratio as evaluation indices. It is standard in the literature to include measures of directional accuracy using the success ratio [
18,
19]. The MAPE ratio is defined as the MAPE of the model over the MAPE of the no-change forecast. The MSPE ratio is defined as the MSPE of the model over the MSPE of the no-change forecast. The success ratio is defined as the fraction of forecasts that correctly predict the sign of the change in the price of oil. Then the Diebold–Mariano test [
35] and Pesaran–Timmermann test [
36] are used to determine whether forecasts are significantly different.