Oil Price Forecasting Using a Time-Varying Approach

: The international crude oil market plays an important role in the global economy. This paper uses a variable time window and the polynomial decomposition method to deﬁne the trend term of time series and proposes a crude oil price forecasting method based on time-varying trend decomposition to describe the changes in trends over time and forecast crude oil prices. First, to characterize the time-varying characteristics of crude oil price trends, the basic concepts of post-position intervals, pre-position intervals and time-varying windows are deﬁned. Second, a crude oil price series is decomposed with a time-varying window to determine the best ﬁtting results. The parameter vector is used as a time-varying trend. Then, to quantitatively describe the continuation of the time-varying trend, the concept of the trend threshold is deﬁned, and a corresponding algorithm for selecting the trend threshold is given. Finally, through the predicted trend thresholds, the historical reference data are selected, and the time-varying trend is combined to complete the crude oil price forecast. Through empirical research, it is found that the time-varying trend prediction model proposed in this paper achieves a better prediction than several common models. These results can provide suggestions and references for investors in the international crude oil market to understand the trends of oil prices and improve their investment decisions.


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 Energies 2020, 13, 1403 3 of 16 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.

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.

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.

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.
It is important to note that for a given time t ,

Related Definitions of Time-Varying Trends
Definition 1. For a given time series {Y 1 , Y 2 , · · · Y m } m ∈ N + , for any of the sample points Y t t = 1, 2, · · · , m and for particular numbers t a , Figure 2).
Energies 2020, 13, x FOR PEER REVIEW 5 of 16 In Definition 1 and Definition 2, t LI can reflect the influence of historical information on t Y , and t PI can reflect the impact of t Y 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 It is important to note that for a given time t, a Y t (t a ) is a function of t a , and b Y t (t b ) is a function of t b . Therefore, the time-varying window represents all possible intervals containing the time t, and the most suitable time-varying window for the sample point Y t at each moment is not necessarily the same.
In Definitions 1 and 2, LI t can reflect the influence of historical information on Y t , and PI t can reflect the impact of Y t 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 has the best fitting effect on the time-varying window. Then, the vector formed by the coefficient vector ϑ t = (θ t,0 , θ t,1 , · · · ) T of the coefficients of the optimal fitting function f (x) and the corresponding time window W t is the time-varying trend of the time series sample point Y t , represented by the symbol T t . It is easy to find that where t a , t b are the time-varying window endpoints corresponding to the optimal fit.

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.

1.
Input: Time series, search space for fitted polynomials S = f 1 , f 2 , · · · , f n , n ∈ N, search space for time-varying window.

2.
Output: Time-varying trend of time series sample point Y t . 3.
Step 1: Use different degree polynomials in S to fit the sample points on the selected window [t a , t b ] to get different sets of coefficients and errors, and choose a set of coefficients with the smallest error. 4.
Step 2: Traverse all windows in the search space and restore the resulting polynomial fitting parameters with time-varying windows. According to the formulaŶ t = n i=0 θ t,i x i t obtain the fitting valueŶ t . 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 Y t .

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 Energies 2020, 13, 1403 6 of 16 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 (x 1 , y 1 ), . . . , (x m , y m ) , where x i ∈ R n and y i ∈ R (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 f (w, x) to predict the target vector as shown in Equation (1): where w is the weights vector, ϕ(x) 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].

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.

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.
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 Energies 2020, 13, 1403 7 of 16 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. Algorithm 2. Frequency division regression prediction method.

2.
Output: The predicted value of the time series sample point Y t+1 . 3.
Step 1: Extract each component from the input time-varying trend.

Data Description
The selected financial time series research subjects in this paper are Brent and WTI crude oil spot prices (daily data from 2 January 1997 to 24 February 2020). Both data samples are from the official website of the US Energy Information Administration (https://www.eia.gov/). For the case of missing data due to the lack of holiday transactions, the missing spot price data are eliminated, and the final sample size are 5869 and 5809.
The basic statistical characteristics of the sample is shown in Table 1. The mean oil prices for Brent and WTI are 58.21 and 56.17, respectively. The ranges for Brent and WTI are 134.85 and 134.49. Therefore, the average and range of oil prices between Brent and WTI are not much different. Brent has a standard deviation of 32.13 and WTI has a standard deviation of 28.50, indicating that the WTI's oil price distribution is denser than Brent's oil price distribution. The skewness of Brent is 0.43 indicating that the time series has a positive skew; the time series distribution is not symmetrical but skewed to the right, and the right tail is longer than the left tail. The kurtosis is 2.14; since the kurtosis of a normal distribution is 3, the distribution curve has a small kurtosis and a flat top. Considering the skewness and kurtosis, the crude oil price time series does not obey a normal distribution. It can be seen from the augmented dickey-fuller (ADF) test value that both Brent and WTI oil price time series are non-stationary sequences and generally cannot be used for direct regression. Therefore, it is necessary to find a suitable method to predict the price of crude oil. In this paper, a prediction method based on time-varying trends is proposed for crude oil price time series that can be used to predict crude oil prices.

Construction of Time-Varying Trends
The search spaces for the pre-position and post-position sets in this experiment are all consecutive positive integers from 2 to 20. For each crude oil price time series sample point, the fitted polynomial search space S = f 1 , f 2 , f 3 , f 4 following Equation (2).
Using Algorithm 1, the polynomial used in the fitting is first determined; then, a polynomial is selected for each of the 361 time-varying window combinations of each sample point, one of those windows with selected polynomial is selected as the time-varying trend of the sample point, and each of the trends is drawn. Line charts of the components are shown in Figure 3, and the pre-position and post-position charts are shown in Figure 4.

Construction of Time-Varying Trends
The search spaces for the pre-position and post-position sets in this experiment are all consecutive positive integers from 2 to 20. For each crude oil price time series sample point, the fitted polynomial search space       Energies 2020, 13, 1403 Figure 3 shows that coefficients of different powers can be used to extract different degrees of oil price change trends. The higher-order terms θ 3 and θ 4 of the fitting polynomial in the time-varying trend describe the third-order and fourth-order terms, respectively, in the polynomial. Regarding the fluctuations in the trends, it can be considered that they are very small in most of the time period, but in the vicinity of 2009, 2010 and 2015, the value changes greatly, and over the past few years, the oil price has fallen sharply. It can be seen that our model can indeed capture the historical fluctuations in the Brent crude oil spot prices. The coefficients θ 1 and θ 2 describe the fluctuations in the primary and secondary terms, respectively. The values are small and relatively stable before 2004, but, after 2004, the values change to varying degrees. This shows that our model has a strong ability to capture the historical evolution of trends. It can also be seen that the constant term θ 0 that filters out different degrees of fluctuations captures the overall trend of Brent crude oil spot prices. In Figure 4, it is found that the number of pre-position intervals of length 3 is much higher than the number of intervals of other lengths. It is assumed that the trends of most points can be extended to the next three days, and some points can continue to the next 20 days.
The fifth component of the Brent and WTI time-varying trends is displayed in Figure 5. It is interesting that there is a significant lag in the fifth component of the time-varying trend between WTI and Brent. WTI will change the trend before Brent and this time difference is about two months. If the Brent time-varying trend sequence is shifted to the left by a unit length of two months, it will almost coincide with the inflection point of the WTI time-varying trend.  Figure 4, it is found that the number of pre-position intervals of length 3 is much higher than the number of intervals of other lengths. It is assumed that the trends of most points can be extended to the next three days, and some points can continue to the next 20 days. The fifth component of the Brent and WTI time-varying trends is displayed in Figure 5. It is interesting that there is a significant lag in the fifth component of the time-varying trend between WTI and Brent. WTI will change the trend before Brent and this time difference is about two months. If the Brent time-varying trend sequence is shifted to the left by a unit length of two months, it will almost coincide with the inflection point of the WTI time-varying trend.

Construction and Prediction of Trend Thresholds
First, the time-varying trend of the predicted point lag from two to 50 steps is selected in turn; then, Algorithm 2 is used to predict the next step, and a series of predicted values are obtained. By comparing the predicted values with the true values, the mean square error (MSE) indicators are shown in Figure 6. According to the fixed-order method proposed in the second part, the overshoot point is selected as the trend threshold (denoted as H); the trend threshold is H = 8 in Figure 6a, and the trend threshold is H = 18 in Figure 6b. After confirming the trend thresholds of all sample point data, they are drawn with the corresponding Brent crude oil prices, as shown in Figure 7. It can be

Construction and Prediction of Trend Thresholds
First, the time-varying trend of the predicted point lag from two to 50 steps is selected in turn; then, Algorithm 2 is used to predict the next step, and a series of predicted values are obtained. By comparing the predicted values with the true values, the mean square error (MSE) indicators are shown in Figure 6. According to the fixed-order method proposed in the second part, the overshoot point is selected as the trend threshold (denoted as H); the trend threshold is H = 8 in Figure 6a, and the trend threshold is H = 18 in Figure 6b. After confirming the trend thresholds of all sample point data, they are drawn with the corresponding Brent crude oil prices, as shown in Figure 7. It can be seen from Figure 7 that at the points where the trend threshold is relatively large, the corresponding crude oil prices show little short-term fluctuation in the future and are close to a straight rise, a straight fall or a horizontal trend. In Figure 7, we draw a line which means H = 20 and find that the point with a higher H than 20 can be considered as a turning point of oil price fluctuation, that means oil prices will move in the opposite direction after the turning point. The WTI oil prices decreased sharply in the interval from August 2018 to November 2018 with large trend threshold H = 50 at start point and continuous small thresholds. However, for the points where the trend threshold is relatively small, the oil price fluctuation changes very frequently.
Energies 2020, 13, x FOR PEER REVIEW 11 of 16 seen from Figure 7 that at the points where the trend threshold is relatively large, the corresponding crude oil prices show little short-term fluctuation in the future and are close to a straight rise, a straight fall or a horizontal trend. In Figure 7, we draw a line which means H = 20 and find that the point with a higher H than 20 can be considered as a turning point of oil price fluctuation, that means oil prices will move in the opposite direction after the turning point. The WTI oil prices decreased sharply in the interval from August 2018 to November 2018 with large trend threshold H = 50 at start point and continuous small thresholds. However, for the points where the trend threshold is relatively small, the oil price fluctuation changes very frequently.     After determining the trend threshold sequence, the SVR model is used for a rolling prediction, and the scroll window length is set to the length of training set. Because of the existence of the overshoot phenomenon, the predicted results often do not satisfy the rationality of the financial market; as a consequence, we set the predicted value at the next step to not exceed 10% of the current value: if the predicted value exceeds 10% of the current value, the trend threshold prediction value is gradually reduced until this condition is met. The changes in Brent and WTI's oil prices have been counted from 2 January 1997 to 24 February 2020. The number of changes in Brent that exceed 10% is 18 (0.31% of the total) and the point exceed doesn't occur in the past three years. WTI has 33 days (0.57% of the total) and these points only appeared twice in the past five years, so the 10% setting is reasonable.

Model Comparison and Evaluation
This section uses the ARIMA and AR models for a comparison with our proposed TV-TD model. The ARIMA form was determined by ADF test, and autocorrelation/partial autocorrelation function, as ARIMA. We set the rolling window length to the length of training set and use sample as shown in Table 2. The Brent and WTI oil prices are used to train and test models in different parts from January 1998 to January 2020. According to the field of machine learning, we divide the sample into a training set and a test set in a 7:3 ratio. For all inspections, the results were compared using three common indicators: MAPE ratio, MSPE ratio and success ratio. The oil price prediction of the benchmark no-change forecast model is set to the previous day's oil price. The rolling window estimation and out-of-sample test with one-step-ahead forecasting are used for all of models. Then the Diebold-Mariano test on the first two indicators and the Pesaran-Timmermann test on the success ratio are performed. The results are conditional on above and shown in Tables 3-5.  For the MAPE ratio, the TV-TD model has lower MAPE ratio (0.9057 in Brent and 0.9541 in WTI) for prediction than others and has significant difference (p-value less than 10%) with the no-change forecast model about Brent and WTI oil price forecasting in dataset 2. In the above three data sets, the prediction effect of the TV-TD model in the second data set is better. For the MSPE ratio, the TV-TD model has no significant difference about Brent oil price forecasting in dataset 3 and is only better than ARIMA(1,2,1) in dataset 1. But the TV-TD model has a lower MSPE ratio (0.8099 in Brent dataset 2, 0.8886 in WTI dataset 2 and 0.8154 WTI in dataset 3) and a small p-value on these sample sets. So the TV-TD model has better prediction accuracy than other models on Brent and WTI oil prices in datasets 2 and datasets 3. For the success ratio, the TV-TD model has statistical improvements in directional accuracy about WTI price change. Except for the Brent prediction of dataset 2, TV-TD has higher Success ratio than other models. It can be seen that the prediction effect of the TV-TD model for WTI is better than that of Brent. From the time scale, TV-TD has the best prediction ability in the second data set (1998)(1999)(2000)(2001)(2002)(2003)(2004)(2005)(2006)(2007)(2008), and the prediction ability in the first data set (2002-2013) performs poorly in a statistical sense.
Analysing the reasons, it can be considered that the amplitude of oil prices change in the training sample of dataset 1 is not large, but the price amplitude is larger in test set. For dataset 2, the data fluctuations on both the training and test sets are significant. Overall, the TV-TD model is better than other models in WTI oil price forecasting and compared with the ARIMA and AR models, the advantages of the TV-TD model are reflected in the range of sharp fluctuations in oil prices.

Conclusions
In this paper, a new perspective on the description of time series trends-time-varying trends-is introduced, and time-varying trends are constructed using coefficients of fitted polynomials and time-varying windows; then, short-term predictions of time series are presented. The TV-TD model proposed in this paper consists of three parts. The first part constructs the time-varying trends. For this part, a new method for decomposing time series is proposed. Time series are decomposed by polynomial fitting into coefficients of the fitting polynomials and the corresponding time-varying window lengths. At the same time, this study also develops a specific algorithm for finding the time-varying trends of time series sample points. The second part constructs and predicts the trend threshold. For this part, we define the trend threshold to select valid historical data points and use the SVR model to predict the trend threshold sequence. The third part predicts the time series sample points using time-varying trends and trend thresholds to predict the oil price on a future day. The proposed TV-TD model has the following contributions: (1) The introduction of time-varying trends provides a new method for researchers to analyse the trends of time series, thereby resolving the limitation of using fixed-length time windows in traditional methods; moreover, we define time-varying trends by defining the time-varying window. The trend of time series sample points is characterized by different optimal time window fitting parameters. In addition, our model has a good ability to express the historical trend of Brent and WTI oil spot prices; hence, the time series trend is more scientifically described and thus more realistic. We recommend that policymakers and investors can use WTI's time-varying trends to predict future Brent's time-varying trends according to the significant lag in the fifth component of the time-varying trend. (2) The presentation of the trend thresholds acknowledges that the data used for the prediction are not perfect, but historical data need to be selected according to the trend characteristics of each point. In addition, the trend thresholds are defined according to the overshoot phenomenon of polynomial functions; therefore, the predicted trend thresholds are obtained by a rolling prediction, and the historical data used for the prediction are determined in combination with a preseted controllable range. If investors can correctly grasp the value brought by the trend threshold, it will help investors to accurately control the crude oil market and adjust their investment strategies in time. And the TV-TD model has a good prediction ability in a specific time period, and this ability is significantly improved.
In future research, the relationship between time-varying trends and oil prices will be explored so that investors could predict the future changes in Brent oil prices based on changes in WTI's oil prices. On the other hand, the TV-TD model can significantly improve accuracy in areas with large fluctuation ranges. Therefore, the model could be improved to suitable for small price fluctuation ranges.

Conflicts of Interest:
The authors declare no conflict of interest.