Keywords

1 Introduction

Financial markets are affected by many factors, such as economic conditions, political events, traders’ expectations and so on. Hence, financial time series forecasting is usually regarded as one of the most challenging tasks due to the nonlinearity and irregularity. How to forecast financial time series accurately is still an open question with respect to the economic and social organization of modern society. Many common econometric and statistical models have been applied to forecast financial time series, such as autoregressive integrated moving average (ARIMA) model [1], vector auto-regression (VAR) model [2] and error correction model (ECM) [3]. However, traditional models fail to capture the nonlinearity and complexity of financial time series which lead to poor forecasting accuracy. Hence, exploring more effective forecasting methods, which possess enough learning capacity, is really necessary for forecasting financial time series. Thus, nonlinear and more complex artificial intelligence methods are introduced to forecast financial time series, such as artificial neural networks (ANNs) [4, 5], support vector regression (SVR) [6] and deep learning method [7].

The forecasting accuracy of those nonlinear artificial intelligence methods are usually better than the common econometric and statistical models, while they also suffer from many problems, such as parameter optimization and overfitting. Hence, many hybrid forecasting approaches are proposed to get better forecasting performance [8,9,10,11,12,13]. So far, the decomposition ensemble learning approach has been widely used to forecast time series in many fields, such as financial time series forecasting [14, 15], crude oil price forecasting [16], nuclear energy consumption forecasting [17], PM2.5 concentration forecasting [18], etc. According to the existing literatures, ANNs are the most common used methods both in single model forecasting and hybrid model forecasting, which demonstrates that ANNs are really suitable for time series forecasting. If the advantages of different ANNs methods are combined, a better forecasting performance can be obtained. Long short-term memory (LSTM) neural network is a kind of deep neural networks, while it possesses similar properties of recurrent neural network (RNN). Therefore, LSTM is a better choice for financial time series forecasting. In addition, the above ensemble learning approach usually chooses AdaBoost to integrate different LSTM forecasters.

In this study, an AdaBoost-based LSTM ensemble learning approach is firstly proposed to forecast financial time series, combining AdaBoost ensemble algorithm and LSTM neural network. LSTM is considered as weak forecasters and AdaBoost is utilized as an ensemble tool. The rest of this paper is organized as follows: the proposed method is briefly introduced in Sect. 2. Section 3 gives the empirical results and Sect. 4 provides the conclusions.

2 AdaBoost-LSTM Ensemble Learning Approach

Suppose there is a time series, we would like to make the m-step ahead forecasting. It is noticing that the iterative forecasting strategy is implemented in this paper, which can be expressed as:

$$ \hat{x}_{t + m} = f(x_{t} , x_{t - 1} , \ldots , x_{t - (p - 1)} ) $$
(1)

where \( \hat{x} \) is the forecasting value, x t is the actual value in period t, and p denotes the lag orders.

In this study, the AdaBoost algorithm is introduced to integrate a set of LSTM predictors. An AdaBoost-LSTM ensemble learning approach is proposed for financial time series forecasting, and the flowchart is illustrated in Fig. 1. The proposed AdaBoost-LSTM ensemble learning approach consists of three main steps:

Fig. 1.
figure 1

The flowchart of the AdaBoost-LSTM ensemble learning approach.

  1. (1)

    The sampling weights \( \left\{ {D_{n}^{t} } \right\} \) of the training samples \( \left\{ {x_{t} } \right\}^{T}_{t = 1} \) are calculated as follows:

$$ D_{n}^{t} = \frac{1}{N}, n = (1, 2, \ldots ,N;t = 1, 2, \ldots ,T) $$
(2)

where N is the number of LSTM predictors, T is the number of training samples.

  1. (2)

    The LSTM predictor F n is trained by the training samples which are sampled according to the sampling weights \( D_{n}^{t} \).

  2. (3)

    The foresting error \( \left\{ {e_{n}^{t} } \right\} \) and ensemble weights {W n } of the LSTM predictor F n are calculated as follows:

    $$ e_{n}^{t} = \frac{{\left| {x_{i} - \hat{x}_{i} } \right|}}{{x_{i} }} , (n = 1, 2, \ldots , N;t = 1, 2, \ldots ,T) $$
    (3)
    $$ w_{n} = \frac{1}{2}{ \ln }\left( {\frac{{1 - \mathop \sum \nolimits_{t = 1}^{T} e_{n}^{t} }}{{\mathop \sum \nolimits_{t = 1}^{T} e_{n}^{t} }}} \right) $$
    (4)
  3. (4)

    Update the sampling weights \( D^{t}_{n + 1} \) of the training samples \( \left\{ {x_{t} } \right\}_{t = 1}^{T} \) as follows:

    $$ D_{n + 1}^{t} = \frac{{D_{n}^{t} \beta_{n}^{t} }}{{\mathop \sum \nolimits_{t = 1}^{T} D_{n}^{t} \beta_{n}^{t} }} $$
    (5)

    where \( \beta_{n}^{t} \, = \,exp\left( {e_{n}^{t} } \right) \) is the update rate of training sample x t .

  4. (5)

    Repeat the step 2–4 until all the LSTM predictors are obtained.

  5. (6)

    The final forecasting result is generated by integrating the forecasting results of all the LSTM predictors with ensemble weights.

3 Empirical Study

3.1 Data Description and Evaluation Criteria

The data in this research comprises of two typical stock indexes (S&P 500 index and Shanghai composite index (SHCI)) and two main exchange rates (the euro against the US dollars (EUR/USD) and the US dollars against the China yuan (USD/CNY)). The historical data are daily data, collected from the Wind Database (http://www.wind.com.cn/). The datasets are then divided into in-sample subsets and out-of-sample subsets, as illustrated in Table 1.

Table 1. In-sample and out-of-sample dataset of the stock indexes and exchange rates.

Table 2 shows the descriptive statistics of those research data. The difference of statistics between the four series can be obviously seen from Table 2.

Table 2. The descriptive statistics of the stock indexes and exchange rates.

In order to evaluate the forecasting performance of the proposed AdaBoost-LSTM ensemble learning approach, mean absolute percentage error (MAPE) and directional symmetry (DS) are employed to evaluate the level forecasting accuracy and directional forecasting accuracy, respectively. MAPE and DS are defined as follows:

$$ MAPE = \frac{1}{n}\sum\nolimits_{t = 1}^{n} {\left| {\frac{{Y_{t} - \hat{Y}_{t} }}{{Y_{t} }}} \right|*100\% } $$
(6)
$$ DS = \frac{1}{n - 1}\sum\nolimits_{i = 2}^{n} {d_{i} \times 100 {\% },\,d_{i} = \left\{ {\begin{array}{*{20}l} {1, (y_{i} - y_{i - 1} )(\hat{y}_{i} - y_{i - 1} ) \ge 0} \hfill \\ {0, {\text{otherwise}}} \hfill \\ \end{array} } \right.} $$
(7)

where \( \hat{y}_{i} \) is the forecasting value, y i is the actual value, and n is the number of observation samples.

3.2 Forecasting Performance Comparison

The forecasting performances of the proposed AdaBoost-LSTM ensemble learning approach and benchmarks are discussed in this section. Tables 3, 4, 5 and 6 show the comparison results of MAPE and DS evaluation criteria, which show that the out-of-sample forecasting performance of the proposed approach is better than that of the benchmarks for all of the four financial time series and demonstrates that the proposed approach is an effective tool for financial time series forecasting.

Table 3. Forecasting performance of different models for stock indexes
Table 4. Forecasting performance of different models for exchange rates series.
Table 5. MAPE comparison with different ensemble forecasting approaches.
Table 6. DS comparison with different ensemble forecasting approaches.

As shown in Tables 3, 4, 5 and 6, the proposed approach significantly outperforms all of the benchmark models by means of level forecasting accuracy and directional forecasting accuracy for the stock indexes and exchange rates. Overall, the ensemble learning approaches outperform the single models, while individual LSTM, ELM, SVR and MLP models consistently outperform ARIMA models in terms of MAPE and DS. Moreover, the proposed AdaBoost-LSTM ensemble learning approach produces 19.44–22.33% better directional forecasts than ARIMA models, reaching up to an accuracy rate of 76.68% in out-of-sample directional forecasting for the EUR/USD.

In summary, some interesting findings can be summarized: (1) the proposed AdaBoost-LSTM outperforms all of the benchmark models in different forecasting horizons, which implies that the AdaBoost-LSTM ensemble learning approach is a powerful learning approach for financial time series forecasting in both level accuracy and directional accuracy; (2) it clearly shows that the hybrid ensemble approach with AdaBoost is much better than the one without ensemble by means of level accuracy and directional accuracy, which reveals that AdaBoost is a more effective ensemble algorithm; (3) the forecasting performance of hybrid ensemble learning approaches are significantly better than single models. The possible reason is that the ensemble can dramatically improve the forecasting performance of single models.

4 Conclusions

This paper proposes an AdaBoost-LSTM ensemble learning approach which employs AdaBoost algorithm to integrate the forecasting results of LSTM forecasts. Then, the proposed AdaBoost-LSTM ensemble learning approach is applied to forecast financial time series, including stock indexes and exchange rates. For model evaluation and model comparison, four typical financial time series data are collected to test the model performance. The empirical results show that the proposed AdaBoost-LSTM ensemble learning approach can significantly improve forecasting performance and outperform some other single forecasting models and some other ensemble learning approaches in terms of both level forecasting accuracy and directional forecasting accuracy, which demonstrates that the proposed approach is really a promising approach for financial time series forecasting. What’s more, the proposed approach can also be employed to solve other complex time series forecasting problems, such as crude oil price forecasting, wind speed forecasting, traffic flow forecasting, etc.