Introduction

At present, stock investment has become one of the popular choices for people to invest and manage money. However, the stock index price has the characteristics of instability, nonlinearity, low signal-to-noise ratio, and easy to be disturbed by external factors [1], which makes it very difficult to predict the stock index trend. Accurate stock index prediction can not only help investors to have an insight into the fluctuation characteristics of the stock index and make accurate decisions to obtain benefits, but also help government departments to timely and effectively supervise and guide the market, so as to avoid financial risks [2]. Therefore, establishing an effective stock index prediction framework is a very necessary and challenging research topic.

Although the current research on stock index prediction has made some progress, there are still some problems to be solved in future research. In the existing literature, machine learning method overcomes the limitations of fundamental analysis method and statistical method in stock index prediction, so as to achieve more accurate stock index prediction results. Among them, support vector machine has been applied to stock index prediction by many scholars, and has achieved good prediction performance. However, the standard support vector machine does not consider the time characteristics of stock index data, and the optimization of kernel parameters and penalty parameters of SVM is also worthy of further research. In addition, the previous stock index prediction mainly focused on point prediction, but in most cases, point prediction cannot effectively solve the uncertainty related to stock index data, while interval prediction can quantify the changes of prediction results caused by uncertain factors. Therefore, interval prediction contains more information than point prediction.

In view of the above considerations, a deep nonlinear integration framework, SSA-EWSVM-RNN-GPR, is designed for point and interval prediction of stock index. Specifically, first of all, the framework applies the excellent data decomposition technology SSA to preprocess the original closing price, which can effectively reduce the interference of noise and improve the performance of the framework. Then, an enhanced weighted support vector machine model is proposed. In addition, the super parameters of the model are optimized by simulated annealing algorithm (SAA) to produce a predictor with good generalization ability. EWSVM model optimized by SAA method is used to predict n components after data preprocessing. Then, a deep nonlinear ensemble paradigm based on RNN is developed to integrate the prediction of all components and other indicators (opening price, high price, low price, and change) into the endpoint prediction. Finally, GPR is utilized to realize the confidence interval prediction based on the previous point prediction. Through systematic and comprehensive experimental simulation and analysis, it is proved that the prediction framework is a scientific and effective prediction tool.

The main innovations of this paper are summarized as follows:

  1. (a)

    Instead of modelling the original data directly, this study uses a novel SSA to decompose the original stock index signal into several components for feature extraction and denoising. Additionally, a signal-decomposition-based hybrid model is built to improve the performance of stock index forecasting.

  2. (b)

    Considering the shortcomings of the standard SVM model, this study proposes a novel EWSVM model for forecasting each component that was decomposed via SSA, for which the penalty weights are based on the time order and the hyperparameters are optimized via SAA.

  3. (c)

    To reconstruct the complicated nonlinear relationships between components that were decomposed by SSA, this study uses RNN to integrate the forecasting result of each component nonlinearly.

  4. (d)

    A two-stage mixed learning strategy is applied to capture the complicated features of stock index changes, and it utilizes EWSVM to forecast each component that was decomposed by SSA and, subsequently, applies RNN to nonlinearly integrate these forecasting results into the final point forecast.

  5. (e)

    To provide more uncertainty information for investors and regulators, this study uses the GPR model to identify the confidence interval for forecasting based on the previous point forecasting result.

  6. (f)

    A novel deep nonlinear ensemble model for stock index forecasting and uncertainty analysis, namely, SSA-EWSVM-RNN-GPR, is proposed for obtaining precise point forecasting and reliable interval forecasting results, and it has been shown to outperform various benchmark models.“

The remainder of this paper is organized as follows: “Literature Review” provides a detailed literature review and analysis, and draws some conclusions. “Related Methodology” describes the related basic methods that are utilized in the developed models. Subsequently, the developed models are presented in “Proposed Model”. “Optimizing Parameters with an Intelligence Algorithm” presents the experimental results and analysis, and conclusions of this study are summarized in “Case Study”.

Literature Review

Many methods have been proposed for stock market forecasting, and these methods can be divided into three main categories: fundamental analysis, statistical methods, and machine learning methods [3]. Fundamental analysis forecasts the trend of a stock price by analyzing the operating conditions, financial conditions, and macroeconomic policies of a company. Wafi et al. [4] analyzed the strengths and disadvantages of several fundamental analysis models and concluded that the residual income model (RIM) was the superior stock market forecasting model. However, fundamental analysis focuses on the long-term trends of the stock market; hence, it is unable to capture the recent trends of the stock market.

Statistical methods regard a stock index as a time series and utilize statistical models to identify hidden properties of the sequence and realize satisfactory forecasting performance [5]. Auto-regressive moving average (ARMA) and generalized auto-regressive conditional heteroskedasticity (GARCH) are classical statistical forecasting models [6,7,8,9,10]. Shi et al. [8] built a hybrid model, which includes ARMA, for forecasting the linear component of the stock price. Wei et al. [9] utilized a new GARCH-class model to study the long-term volatility of China’s stock market. Although statistical methods such as ARMA and GRACH realize relatively satisfactory performances in forecasting, they are weak in terms of nonlinear processing capability; namely, they cannot capture nonlinear characteristics that are hidden in the sequence.

To overcome the problem that is discussed above, machine learning methods, which include shallow learning and deep learning methods, are proposed, and they possess excellent nonlinear mapping capacity [11, 12]. Shallow learning methods include artificial neural network (ANN) and support vector machine (SVM) [13,14,15,16,17,18]. Wang [14] designed an improved ANN model for forecasting stock prices in the Turkish stock market, which mitigated the well-known problems of overfitting and underfitting. Grigoryan [15] applied the SVM technique to the forecasting of non-stationary stock price series satisfactorily. Xiao et al. [18] applied SVM to the forecasting of stock prices and demonstrated that SVM was a promising approach for stock price forecasting. Nevertheless, the standard SVM method assigns the same penalty weight (\(C\)) to all training samples that exceed the specified error (ε). The standard SVM method is suitable for series without time characteristics; however, a stock index is a featured time series; namely, the significance of the data and the influence on the method may not be the same across periods. Weighted support vector machine (WSVM) considers the timing of data and assigns different penalty weights to samples in different periods. Typically, the weight of a near-term sample is larger than that of a long-term sample [19,20,21]. Therefore, WSVM can obtain a more accurate forecasting result than SVM. Chen et al. [20] utilized WSVM with the Shanghai stock market and the Shenzhen stock market to forecast the turning signals of the stock and proved that the model can be applied in practice effectively. In addition, various methods are used to complete the difficult parameter optimization of SVM. Fayed et al. [22] used a sped-up exhaustive grid-search method to optimize the kernel parameters and the penalty parameter of SVM. Bergstra et al. [23] concluded that random search outperformed grid search and manual search within a small fraction of their computation times. Nevertheless, grid search and random search have drawbacks due to their low search efficiencies and long search times. To overcome these drawbacks, SAA was proposed for optimizing the hyperparameters of machine learning methods [24, 25]. SAA has the characteristics of strong robustness, less initial constraints, and excellent global optimization performance. It has achieved remarkable results in solving complex nonlinear optimization problems. Dias et al. [24] proposed SAA to solve the dual quadratic optimization problem of SVM. The results show that SAA can effectively improve the performance of the SVM model. Superior to shallow learning methods, various deep learning methods, such as RNN, can mine the deep intrinsic characteristics from complicated stock index data and have been utilized widely over the years [26, 27]. Qiu et al. [27] proposed a hybrid RNN model for stock trend prediction; they concluded that the developed model was highly promising and could be considered a feasible and effective stock market timing tool.

Recently, numerous signal decomposition methods have been used to strengthen the performances of mainstream forecasting models. These signal decomposition methods are often combined with forecasting methods for the construction of a hybrid model. Signal decomposition can smooth the series, extract the time and frequency features of the series, denoise the original series, and decompose the series into various components. For instance, Wang et al. [28] proposed a new approach for forecasting stock prices via the wavelet decomposition (WD)–based backpropagation network (BP), which was proven to be superior to the single BP model. Wei [29] combined empirical mode decomposition (EMD) with ANN to improve the performance of stock price forecasting. However, WD and EMD both have disadvantages: (1) the decomposition performance of WD depends strongly upon the choices of the decomposition levels and the wavelet basis; (2) the performance of WD is easily influenced by the white noise in the original data; and (3) EMD lacks a strict mathematical foundation and physical meaning. To address these problems, SSA was proposed by scholars for realizing superior signal decomposition and data denoising [30,31,32,33,34]. Wen et al. [34] used SSA to decompose a stock price into the trend, the market fluctuation, and the noise with various economic features, and they introduced these components into SVM for forecasting.

After the forecasting of each component that was decomposed via signal decomposition methods, the signal integration method is applied and is the most significant part of the signal decomposition and integration-based hybrid forecasting model. The simple integration method refers to the linear accumulation of components’ forecasting results while ignoring the complex nonlinear relationships between the components. In addition, due to the excellent nonlinear mapping performance, machine learning methods, especially deep learning methods, are applied to integrate the forecasts of the components. For instance, Wang et al. [35] utilized SSA to decompose the original price series into several components, forecast each component, and, finally, integrated them together using RNN, which resulted in error reductions and improvements compared to the single models.

Currently, most of the improvement efforts for stock index forecasting methods focus on increasing the accuracy of point forecasting, while less work has been conducted on realizing reliable interval forecasting of stock indices. Although accurate point forecasting is important for investors and financial regulators, reliable interval forecasting with consideration of uncertainty information is also beneficial for controlling and avoiding unnecessary risk in the stock market. Therefore, researchers have applied statistical learning methods such as GPR to conduct uncertainty analyses of time series forecasting [36,37,38,39,40]. For instance, Fang et al. [38] utilized GPR for probabilistic forecasting of carbon dioxide emission and generated satisfactory forecasting intervals. Zhang et al. [40] presented a new wind speed forecasting model that is based upon a shared-weight long short-term memory network (SWLSTM) and GPR, which is used to realize high-precision point forecasting and reliable interval forecasting, and the SWLSTM-GPR model was proven to perform effectively. However, GPR is rarely used in financial forecasting studies.

Through the review and analysis of the above literature, we can draw the following conclusions: (1) fundamental analysis model has limitations in capturing the recent fluctuation trend of stock index, and statistical methods cannot effectively deal with the nonlinear model of stock index data. These deficiencies may lead to poor prediction performance in the process of practice. (2) Stock index data is a kind of time series data. Therefore, it is necessary to design a more advanced SVM method based on previous experience, and use the SAA method with strong applicability and strong global optimization performance to optimize some parameters of the model, which is conducive to the development of the optimal weighted support vector machine model with good generalization ability and stability. (3) In the current prediction model, selecting practical and effective data preprocessing technology to improve the prediction performance is one of the key points of the hybrid model. The excellent decomposition algorithm can effectively remove the noise signal in the original data and significantly improve the prediction results. In addition, under the decomposition integration framework, the deep learning method shows excellent performance in integration, among which the RNN model has performed well in the past ensemble research. (4) The research on interval prediction of stock index is of great significance to the stock market, because interval prediction can analyze the uncertainty of stock index and quantify the change of prediction results caused by uncertain factors, so as to improve more and more useful reference information for stock market participants. However, most of the existing studies only focus on the point prediction of stock index, ignoring the significance of considering the interval prediction of stock index.

According to the combing and analysis of existing literature, we can reasonably infer that the research considering the uncertainty analysis of stock index is very insufficient. Therefore, developing an innovative stock index prediction framework for point prediction and interval prediction of stock index is of great significance to the stock market.

Related Methodology

In this section, five related basic methods in the developed SSA-EWSVM-RNN-GPR model are described.

Singular Spectrum Analysis

As a novel signal decomposition method, SSA can be used for feature extraction and denoising of an original times series signal. This study uses SSA to decompose the original stock index signal into several components for feature extraction and denoising. The following is the detailed procedure of SSA:

\(Step 1:\) Embedding: the analysis object of SSA is a centralized one-dimensional series \(\left[{x}_{1},{x}_{2},\cdots ,{x}_{N}\right]\), where \(N\) denotes the length of the series. The trajectory matrix X can be represented as follows:

$$X=\left[\begin{array}{ccc}\begin{array}{cc}{x}_{1}& {x}_{2}\\ {x}_{2}& {x}_{3}\end{array}& \cdots & \begin{array}{c}{x}_{N-J+1}\\ {x}_{N-J+2}\end{array}\\ \vdots & \ddots & \vdots \\ \begin{array}{cc}{ x}_{J}& {x}_{J+1}\end{array}& \cdots & {x}_{N}\end{array}\right]$$
(1)

where \(J\) denotes the integer that corresponds to one main trend component and other detail components.

\(Step 2:\) Singular value decomposition (SVD): the decomposition of the time series can be represented as:

$$X=\sum_{m=1}^{J}\sqrt{{\lambda }_{m}}{A}_{m}{B}_{m}^{T}$$
(2)

where \({B}_{m}\) denotes the right eigenvector, \({A}_{m}\) denotes the left eigenvector, and \({\lambda }_{m}\) denotes the feature vector of \({A}_{m}\), which is called the time-empirical orthogonal function (T-EOF).

\(Step 3:\) Grouping: in this step, the series is grouped as follows:

$$X={X}_{{I}_{1}}+\dots +{X}_{{I}_{c}}$$
(3)

where \(c\) denotes the number of disjoint groups that contain \(J\) subsequences, which include one main trend component and other detail components, and \(I\) denotes the disjoint groups.

\(Step 4:\) Refactoring: the projection of \({X}_{i}\) on \({A}_{m}\) can be represented as follows:

$${a}_{i}^{m}={X}_{i}{A}_{m}=\sum_{j=1}^{J}{x}_{i+j}{A}_{m,j}, \;\;\;0\le i\le N-J$$
(4)

Then, T-EOF is used to conduct the following refactoring:

$${x}_{i}^{k}=\left\{\begin{array}{c}\frac{1}{i}{\sum }_{j=1}^{i}{a}_{i-j}^{k}{A}_{k,j}, \quad 1\le i\le J-1 \\ \frac{1}{J}{\sum }_{j=1}^{J}{a}_{i-j}^{k}{A}_{k,j}, \quad J\le i\le N-J+1 \\ \frac{1}{N-i+1}{\sum }_{j=i-N+J}^{J}{a}_{i-j}^{k}{E}_{k,j}, \quad N-J+2\le i\le N\end{array}\right.$$
(5)

Support Vector Machine

SVM aims at identifying a hyperplane such that the total deviation of the distance between each sample and the hyperplane is maximized, and it is utilized widely in the field of forecasting. The procedure of SVM is presented in detail below.

The solution for SVM is expressed as follows:

$$\underset{\varphi ,d,{\xi }_{i},\widehat{{\xi }_{l}} }{\mathrm{min}}\frac{1}{2}{\varphi }^{T}\varphi +C\sum_{i=1}^{n}\left({\xi }_{i}+\widehat{{\xi }_{i}}\right)$$
(6)
$$s.t. \left\{\begin{array}{c}g\left({x}_{i}\right)-{y}_{i}\le \varepsilon +{\xi }_{i} \\ {y}_{i}-g\left({x}_{i}\right)\le \varepsilon +\widehat{{\xi }_{i}} \\ {\xi }_{i}\ge 0,\widehat{{\xi }_{i}}\ge 0 \end{array}\;\;\;\hfill(i=\mathrm{1,2},\dots ,n)\right.$$

where \(g(x)\) denotes the outcome, \({y}_{i}\) denotes the observation value, \(n\) denotes the number of training samples, \(\varepsilon\) denotes the threshold error, \({\xi }_{i}\) and \(\widehat{{\xi }_{i}}\) are two relaxation variables, and \(C\) is a constant. A schematic diagram is presented in Fig. 1.

Fig. 1
figure 1

Hyperplane of SVM

The above expression can be represented into dual form as follows:

$$\underset{{\beta }_{i},{\widehat{\beta }}_{i}}{\mathrm{max}}\sum_{i=1}^{n}{y}_{i}\left({\widehat{\beta }}_{i}-{\beta }_{i}\right)-\epsilon \left({\widehat{\beta }}_{i}+{\beta }_{i}\right)-\frac{1}{2}\sum_{i=1}^{n}\sum_{j=1}^{n}\left({\widehat{\beta }}_{i}-{\beta }_{i}\right)\left({\widehat{\beta }}_{j}-{\beta }_{j}\right){x}_{i}^{T}{x}_{j}$$
(7)
$$s.t.\left\{\genfrac{}{}{0pt}{}{\sum_{i=1}^{n}\left({\widehat{\beta }}_{i}-{\beta }_{i}\right)=0}{ 0\le {\widehat{\beta }}_{i},{\beta }_{i}\le C }\right.$$

where \({\widehat{\beta }}_{i}\mathrm{ and }{\beta }_{i}\) denote the Lagrange multipliers and \({x}_{i}\) denotes the training data input.

Then, the solution of SVM is expressed as:

$$g\left(x\right)=\sum_{i=1}^{n}\left({\widehat{\beta }}_{i}-{\beta }_{i}\right)K\left(x,{x}_{i}\right)+d$$
(8)

where \(K\left(x,{x}_{i}\right)\) denotes the kernel function.

Additionally, the radial basis function (RBF) is chosen to be the kernel function of SVM, and the kernel function is expressed as follows:

$$K\left(x,{x}_{i}\right)=exp\left(-\frac{1}{2{\sigma }^{2}}{\Vert x-{x}_{i}\Vert }^{2}\right)$$
(9)

Simulated Annealing Algorithm

In contrast to other parameter optimizing methods, the SAA introduces random factors; namely, SAA accepts a solution that is worse than the current solution with a specified probability when iteratively updating a feasible solution. The procedure of SAA is described in detail in the following, and the process is presented graphically in Fig. 2.

Fig. 2
figure 2

Graphical representation of the search process for the optimal parameters via SAA

\(Step 1:\) It is necessary to define the initial value of the maximum temperature \({T}_{0}\), the initial parameter values, their ranges, and the number of iterations.

\(Step 2:\) The cooling trend function is defined as follows:

$${T}_{i+1}=b\times {T}_{i}$$
(10)

where \(b\) is a constant and its value is defined as 0.8.

\(Step 3:\) Generate a new solution \({s}_{i+1}\) based on the current solution \({s}_{i}\). Calculating the corresponding objective function value \(F\left({s}_{i+1}\right)\) yields:

$$\Delta F = F \left({s}_{i+1}\right)-F \left({s}_{i}\right)$$
(11)

\(Step 4:\) According to the Metropolis criteria, the new solution is accepted with a specified probability. If \(\Delta F <0\), the new solution \({s}_{i+1}\) is accepted as the new current solution. If \(\Delta F> 0\), the new solution \({s}_{i+1}\) is accepted according to the probability \(P\):

$$P={e}^{-\frac{\Delta F}{{T}_{i}}}$$
(12)

\(Step 5:\) Repeat step 3 and step 4 for the specified number of iterations at temperature \({T}_{i}\).

\(Step 6:\) Determine whether the temperature has reached the value of \({T}_{end}\). If not, return to step 2 and continue the optimization of the equilibrium point at the next temperature. If the conditions are satisfied, the algorithm is terminated to obtain the optimal solution.

Recurrent Neural Network

RNN considers sequence data as input while conducting recursion in the evolution direction. RNN shows strong performance in natural language processing problems and can be employed on various practical problems, such as speech recognition and price forecasting. The following is the detailed procedure of RNN.

RNN outperforms simple machine learning methods in nonlinear forecasting. The structure of the utilized RNN is illustrated in Fig. 3.

Fig. 3
figure 3

Structure of the RNN

In Fig. 3, \(x\) denotes an input, \(h\) denotes a hidden cell, \(o\) denotes an output, \(L\) denotes the loss function, \(y\) denotes a label of the training set, \(x\) denotes the time, and \(V, U, \mathrm{and} W\) denote the weight matrices. At time \(t\), the relation formula can be expressed as follows:

$${h}_{t}=\varnothing \left(U{x}_{t}+W{h}_{t-1}+e\right)$$
(13)

where \(\varnothing\) denotes the activation function and \(e\) denotes the bias coefficient.

The output can be represented as follows:

$${o}_{t}=V{h}_{t}+c$$
(14)

Thus, the final forecast can be expressed as follows:

$${\widehat{y}}_{t}=\tau \left({o}_{t}\right)$$
(15)

where \(\tau\) denotes the activation function that is utilized for classification.

Gaussian Process Regression

GPR is based upon Bayesian theory, and it is a nonparametric model that uses a Gaussian process (GP) to conduct regression analysis. Equipped with the GP and their kernel functions, GPR is more convenient and has been applied to numerous tasks, such as time series analysis, image processing, and trend forecasting. The procedure of GPR is presented in detail in the following.

According to the assumption, a regression model that contains noise is represented as:

$$y=r\left(x\right)+\omega$$
(16)

where \(x\) denotes the input vector, \(r\) denotes the function value, and \(y\) denotes the observations. It is assumed further that \(\omega \sim N\left(0,{\sigma }_{n}^{2}\right)\).

Then, the joint distribution of \(r\) and \(y\) and the prior distribution of \(y\) are represented as follows:

$$\left\{\begin{array}{c}y\sim N\left(0,{\sigma }_{n}^{2}{Z}_{n}+E\left(X,X\right)\right) \\ \left[\begin{array}{c}y\\ r\end{array}\right]\sim N\left(0,\left[\begin{array}{cc}{\sigma }_{n}^{2}{Z}_{n}+E\left(X,X\right)& E\left(X,x\right)\\ E\left(x,X\right)& E\left(x,x\right)\end{array}\right]\right)\end{array} \right.$$
(17)

where \(E\left(X,X\right)={E}_{n}=\left({e}_{ij}\right)\) is an \(n\times n\) symmetric positive-definite covariance matrix, matrix element \({e}_{ij}=e\left({x}_{i},{x}_{j}\right)\) is utilized to measure the coefficient of \({x}_{i}\) and \({x}_{j}\), \(E\left(X,x\right)=E{\left(x,X\right)}^{T}\) denotes the \(n\times 1\) variance matrix of test point \(x\) and the input of training set \(X\), \(e\left(x,x\right)\) denotes the covariance of \(x\), and \({Z}_{n}\) denotes the n-dimensional identity matrix.

Finally, the posterior distribution of \(r\) is expressed as follows:

$$r\left(X,y,x\sim N\left(\overline{r },Cov\left(r\right)\right)\right)$$
(18)

In the above expression:

$$\left\{\begin{array}{c}\overline{r }=E\left(x,X\right){\left[E\left(X,X\right)+{\sigma }_{n}^{2}{Z}_{n}\right]}^{-1}y \\ Cov\left(r\right)=e\left(x,x\right)-E\left(x,X\right)\times {\left[E\left(X,X\right)+{\sigma }_{n}^{2}{Z}_{n}\right]}^{-1}E\left(X,x\right)\end{array} \right.$$
(19)

The commonly used covariance function can be represented as follows:

$$e\left(x,{x}^{^{\prime}}\right)={\sigma }_{r}^{2}exp\left(-\frac{1}{2}{\left(x-{x}^{^{\prime}}\right)}^{T}{M}^{-1}\left(x-{x}^{^{\prime}}\right)\right)$$
(20)

where \({\sigma }_{r}^{2}\) denotes signal variance.

Proposed Model

Enhanced Weighted Support Vector Machine

Definition of the Penalty Weight Function

The available hybrid forecasting models often ignore the accuracy of the intermediate forecasting result, and the accuracy of the final forecasting result has substantial room for improvement. Therefore, this paper focuses on increasing the accuracy of intermediate forecasting. Since standard SVM ignores the timing of the training samples, EWSVM is innovatively proposed to improve the forecasting performance. A stock index is a time series; namely, the importance of the data differs among periods. Typically, it is assumed that the recent data and the information that they provide have a stronger impact on the model than the forward data. In contrast to standard SVM, EWSVM regards the penalty weight of each sample as increasing backwards over time. In EWSVM, the weight function is defined as follows:

$${w}_{i}=\frac{1}{1+{e}^{8-\frac{16i}{n}}}$$
(21)

In this expression, \(i\) denotes \(i\) th day’s sample of the training set in chronological order, \(n\) represents the length of complete training set, and \({w}_{i}\) represents the weight of the \(i\) th day’s sample in chronological order. In addition, \({w}_{i}\bullet C\) replaces \(C\) in formula (6) and formula (7).

Optimizing Parameters with an Intelligence Algorithm

Previous studies often used grid search, random search, and ordinary Monte Carlo algorithms to optimize parameters. Grid and random search have huge computational complexities and low search efficiencies, while the ordinary Monte Carlo algorithm easily falls into local extrema. SAA method can overcome these limitations. As a universal algorithm, SAA has the global optimization performance of probability in theory. At present, SAA has been widely used in the fields of production scheduling, machine learning, signal processing, and so on. Therefore, in this research, SAA is selected to optimize EWSVM, and the optimized super parameters are the penalty coefficient and threshold error of EWSVM. The main steps for SAA to optimize the EWSVM model are as follows:

Step 1: Define the initial parameter values ​and parameter ranges of SAA and EWSVM, and the number of iterations.

Step 2: Determine the objective function of SAA. The objective function of this paper is designed as:

$$\mathrm{min Obj}=\mathrm{RMSE }=\sqrt{\frac{1}{L}{\sum }_{i=1}^{L}{({\widehat{t}}_{l}-{t}_{l})}^{2}}$$
(22)

where \(L\) denotes the samples’ number, and \({\widehat{t}}_{l}\) and \({t}_{l}\) represent the original values and prediction value at point \(l\).

Step 3: According to Metropolis standard, update the location of the solution.

Step 4: Repeat steps 2 and 3 for the specified number of iterations until the iteration stop condition is reached.

Step 5: Stop the iteration and get the optimal parameters of the EWSVM model.

SSA-EWSVM-RNN-GPR Model

As was introduced in the “Introduction” section, this study designed an innovative signal decomposition and interval forecasting-based hybrid model for precise point and reliable interval forecasting of a stock index. Figure 4 shows the flow chart of the proposed SSA-EWSVM-RNN-GPR model. The details of the designed prediction framework are described below.

Fig. 4
figure 4

Flowchart of the SSA-EWSVM-RNN-GPR model

  • Module I : Data decomposition: in this research, the closing price signal of stock index is decomposed into N subseries by SSA method, where the decomposition results include main trend sequence, detail components, and noise signals. In the result of decomposition, the noise component is removed and the remaining sequence is used as the predictive input variable of the next module.

  • Module II : Preliminary prediction: the EWSVM model designed in this paper is used to predict the main trend series and detail components derived from the decomposition of stock index data. Among them, the enhanced weighted support vector machine considers the timing of data and includes an S-shaped weight function. In addition, SAA method is used to optimize the penalty coefficient and threshold error of EWSVM, so as to seek the minimum RMSE of the EWSVM result. The excellent global optimization of the algorithm is helpful to obtain the EWSVM model with the best prediction accuracy and stability.

  • Module III : Nonlinear ensemble prediction: an excellent deep learning method RNN model is selected for the nonlinear ensemble of the proposed stock index prediction framework to achieve accurate point prediction. The input variables of this module are the preliminary prediction results of EWSVM and four stock indexes (opening price, high price, low price, and change). Furthermore, the proposed SSA-EWSVM-RNN model is compared with several benchmark models (including SSA-LSSVM-RNN, SSA-SVM-RNN, SSA-RNN, RNN, LSTM [41], DWT-RNN [42], AHP-LSSVM [43], and WEIGHT-LSSVM [44]) to verify the prediction performance of the proposed model.

  • Module IV : Interval prediction: GPR is used in the interval prediction of the stock index prediction framework designed in this research. Based on the point prediction results obtained by the first three modules, the GPR method is applied to predict the confidence interval, so as to provide more abundant future stock index trend information. In addition, in order to prove that the proposed model has prediction advantages in interval prediction, the proposed SSA-EWSVM-RNN-GPR model is compared with SSA-LSSVM-RNN-GPR, SSA-SVM-RNN-GPR, SSA-RNN-GPR, RNN-GPR, LSTM-GPR, DWT-RNN-GPR, AHP-LSSVM-GPR, and WEIGHT-LSSVM-GPR models.

Case Study

This section describes in detail the data, evaluation indicators, and several experiments that are utilized to evaluate the performance of the SSA-EWSVM-RNN-GPR model.

Data Collection

This study uses two data sets to evaluate the efficiency of the proposed model: the Nikkei 225 Index and the Hang Seng Index. To constitute the data set of the Nikkei 225 Index, 4690 continuous closing price, opening price, high price, low price, and change of stock opening data from January 5th, 2001, to January 16th, 2020, are collected, while 4714 continuous closing price, opening price, high price, low price, and change of stock opening data from December 5th, 2000, to January 16th, 2020, are collected to constitute the data set of the Hang Seng Index. The closing price sequences of the two data sets are plotted in Figs. 5 and 6, respectively. In the following modelling process, \(80\%\) of each data set in the front is used as a training set, while the remaining \(20\%\) of the data set is used as a test set.

Fig. 5
figure 5

Experimental data description of the Nikkei 225 Index

Fig. 6
figure 6

Experimental data description of the Hang Seng Index

Evaluation Indicators

In order to comprehensively evaluate the performance of the SSA-EWSVM-RNN-GPR prediction framework, seven evaluation criteria include mean absolute error (MAE), root mean square error (RMSE), mean absolute percentage error (MAPE), decision coefficient (R2), coverage probability (\({CP}_{\alpha }\)), average width percentage (\({MWP}_{\alpha }\)), and a new design standard \({MC}_{\alpha }\), used in this paper. MAE, RMSE, MAPE, and R2 are used to evaluate the point prediction results, and \({CP}_{\alpha }\),\({MWP}_{\alpha }\), and \({MC}_{\alpha }\) are used to evaluate the interval prediction results. The mathematical formulas of these indicators are shown in Table 1.

Table 1 Evaluation indicators of performance

In these expressions, R denotes the real price, \(\overline{R }\) denotes the mean value of the real data, and P denotes the forecast price, α denotes the confidence, c denotes the number of real prices that fall into the forecasting interval, T is the number of test sets, and up and down are the upper and lower limits of the prediction interval.

Results of Data Decomposition

SSA is introduced to decompose the closing price of stock index into some signal components with different characteristics. SSA algorithm can be used to reduce random data and obtain more stable data. The original data is decomposed into ten signal components, including trend signal, detail component, and noise signal. Considering that the noise signal may have a negative impact on the prediction results, in the decomposition process, the last two components are discarded as noise, and the remaining eight components (including one main trend component and seven detail components) are selected for subsequent experiments. The decomposition results of the Nikkei 225 Index and the Hang Seng Index are shown in Figs. 7 and 8.

Fig. 7
figure 7

Decomposition of the Nikkei 225 Index via SSA

Fig. 8
figure 8

Decomposition of the Hang Seng Index via SSA

Results of Point Prediction

The actual closing price of the stock index is decomposed by the SSA method, and finally eight sub-sequences are obtained. Each sub-sequence is separately input into EWSVM for model construction. Since variables often differ in terms of their units and degrees of variation, by modelling on the original data directly, it is difficult to realize satisfactory forecasting performance. Thus, standardization will be used to eliminate this negative effect. The standardization formula is expressed as follows:

$${x}^{*}=\frac{x-\mu }{\sigma }$$
(23)

In this expression, \(x\) denotes the original stock price, \(\mu\) denotes the average value of \(x\), \(\sigma\) denotes the standard deviation of \(x,\) and \({x}^{*}\) denotes the standardized closing price.

The standardized training set is used to construct SAA-EWSVM model. The role of SAA is to optimize the penalty coefficient and threshold error of EWSVM. In the process of parameter optimization, a search space is established, in which the penalty coefficient follows the uniform distribution on [0.001,5000], and the threshold error follows the uniform distribution on [0.001,100]. The number of iterations of parameter optimization is 1000. In addition, the kernel function of EWSVM is radial basis function. Figure 9 shows the parameter optimization process of Nikkei 225 index and Hang Seng Index. Table 2 shows the parameter optimization results of Nikkei 225 index and Hang Seng Index. In this table, C denotes the punishment coefficient and ε denotes the threshold error.

Fig. 9
figure 9

Part of the process of parameter optimization

Table 2 Optimal parameters of EWSVM that are based on the Nikkei 225 Index and the Hang Seng Index

According to the optimized parameters, the optimal EWSVM model is constructed. Figures 10 and 11 describe the EWSVM results of the Nikkei 225 Index and the Hang Seng Index, including the fitting results of the training set and the prediction results of the test set of eight sub-sequences.

Fig. 10
figure 10

Nikkei 225 Index fitting and forecasting results of EWSVM

Fig. 11
figure 11

Hang Seng Index fitting and forecasting results of EWSVM

The preliminary results of EWSVM are part of the input variables of RNN nonlinear ensemble. In addition, other influencing factors such as opening price, high price, low price, and change are also considered in this research. Multivariable RNN model is used for nonlinear integration of 12 sequences. The RNN model designed in this study includes an input layer and an output layer, and the number of neurons in the input layer and output layer is 100 and 1, respectively. The activation function of this model chooses rectified linear unit function, and the dropout is set to 0.15, and the number of iterations is 500. Furthermore, the lag period of the model is 5 days; that is, the data of the first five days are used to predict the data of the next day. The final point prediction results are shown in Fig. 12. Table 3 shows the point forecast evaluation results of the Nikkei 225 Index and the Hang Seng Index, respectively.

Fig. 12
figure 12

Point forecasting results of nine models for the Nikkei 225 Index and Hang Seng Index

Table 3 Evaluation of the point forecasting result that was obtained with SSA-EWSVM-RNN

Results of Interval Prediction

Based on the previous point prediction results (Figs. 12 and 13), in order to obtain additional uncertainty information, GPR is used for 95% confidence interval prediction of closing price. The kernel function of the Gaussian process uses the optimized radial basis function, and the width range of the radial basis function varies from [0.01, 10000]. The interval forecast results are shown in Fig. 14, and the interval forecast evaluation results of the two data sets of Nikkei 225 Index and Hang Seng Index are given in Table 4.

Fig. 13
figure 13

Evaluation results of point forecasting

Fig. 14
figure 14

Interval forecasting results of nine models for the Nikkei 225 Index and Hang Seng Index

Table 4 Evaluation of the interval forecasting result that was obtained with SSA-EWSVM-RNN-GPR

Comparison and Analysis

In order to clearly prove the prediction advantages of the proposed stock index prediction framework, SSA-EWSVM-RNN-GPR is compared with eight benchmark models from the perspectives of prediction results and running time.

Comparison of Results

In order to evaluate the performance of the proposed model, several groups of comparative experiments are designed to further prove the rationality and superiority of the stock index prediction framework. Figure 13 and Table 5 show the point prediction evaluation results of various models, and Fig. 15 and Table 6 describe the interval prediction results of them.

Table 5 Comparisons of the point forecasting results that were obtained with various models
Fig. 15
figure 15

Evaluation results of interval forecasting

Table 6 Comparisons of the interval forecasting results that were obtained with various models
  1. (a)

    Comparison of SSA-EWSVM-RNN-GPR, SSA-LSSVM-RNN-GPR and SSA-SVM-RNN-GPR.

    Experiment (a) is used to verify the advantages of EWSVM model. By analyzing the point prediction results and interval prediction results of SSA-EWSVM-RNN-GPR, SSA-LSSVM-RNN-GPR, and SSA-SVM-RNN-GPR, it is obvious that the model proposed in this research has achieved the best prediction performance. For example, in the case of the Hang Seng Index, the SSA-EWSVM-RNN-GPR model achieved the optimal MAE, R2, MAPE, RMSE, \({CP}_{95\%}\), \({MWP}_{95\%}\), and \({MC}_{95\%}\) with 79.215, 0.997, 0.007, 96.774, 0.97985, 0.28223, and 0.28803, respectively, which reveals the superiority of the EWSVM model based on this research over other support vector machine models.

  2. (b)

    Comparison of SSA-EWSVM-RNN-GPR and SSA- RNN-GPR.

    Experiment (b) aims to illustrate the role of the EWSVM module in the proposed stock index forecasting framework. Through the prediction results of the SSA-EWSVM-RNN-GPR and SSA-RNN-GPR models, it can be seen that SSA-EWSVM-RNN-GPR has better prediction performance. Therefore, EWSVM is indispensable in this framework and can improve the overall predictive ability of the designed framework.

  3. (c)

    Comparison of SSA-EWSVM-RNN-GPR and RNN-GPR.

    In experiment (c), by analyzing the prediction results of the SSA-EWSVM-RNN-GPR and RNN-GPR models, it can be seen that the prediction ability of the hybrid model under the decomposition integration framework is significantly better than the single model. For example, in the case of the Nikkei 225 Index, the proposed model obtains the optimal MAE, R2, MAPE, RMSE, \({CP}_{95\%}\), \({MWP}_{95\%}\), and \({MC}_{95\%}\) with 66.074, 0.997, 0.007, 80.038, 0.89979, 0.05746, and 0.06385, respectively.

  4. (d)

    Comparison of SSA-EWSVM-RNN-GPR and published models.

    Experiment (d) aims to demonstrate the prediction superiority of the proposed stock index prediction framework, and to prove it by comparing SSA-EWSVM-RNN-GPR with other published models. Since there are very few stock index forecasting models for interval forecasting, this research provides interval forecasting results of other published models based on GPR for comparison and analysis. Based on the point prediction results and interval prediction results of the SSA-EWSVM-RNN-GPR, LSTM-GPR, DWT-RNN-GPR, AHP-LSSVM-GPR, and WEIGHT-LSSVM-GPR models, it is observed that SSA-EWSVM-RNN-GPR has better predictive performance. Therefore, it can be concluded that the prediction framework proposed in this paper is more effective than other models.

Comparison of Running Time

In order to discuss the computational complexity of the model, a comparison of the average running time of various models is given, that is, the time comparison of each iteration of the data in the model, as shown in Table 7.

Table 7 Comparison of the average running time of various models

In the Nikkei 225 Index and Hang Seng Index cases, the average running time of the SSA-EWSVM-RNN-GPR model is 1.0212 and 1.0473, respectively. Compared with other models, the running time ranking of this model is in the middle position. Moreover, the running time of RNN-GPR, LSTM-GPR, and DWT-RNN-GPR is relatively short, and the running time of SSA-SVM-RNN-GPR and SSA-RNN-GPR is close to that of the proposed model. However, the prediction framework proposed in this research is significantly higher than the above models in forecast accuracy, and the time consumed is not disappointing. Therefore, the moderate computational complexity of this model is worthy of acceptance.

Discussion

Table 5 and Table 6 show the performance results of different models in point prediction and interval prediction. Based on these results, the following key points are summarized:

  1. (1)

    According to the comparison between SSA-EWSVM-RNN and SSA-SVM-RNN, SSA-EWSVM-RNN, which improves upon the standard SVM, can be more accurate and more self-correcting when forecasting the original closing price series. The comparison results between SSA-EWSVM-RNN and SSA-LSSVM-RNN prove the prediction superiority of the improved weighted support vector machine method in this research.

  2. (2)

    The prediction results of SSA-EWSVM-RNN-GPR and SSA-RNN-GPR verify the role of EWSVM in the proposed prediction framework, and also show that emphasizing the accuracy of intermediate prediction is helpful to improve the final prediction accuracy.

  3. (3)

    According to the comparison between SSA-EWSVM-RNN-GPR and RNN-GPR, the accuracy difference between the two models shows that the hybrid model based on signal decomposition is better than the single prediction model.

  4. (4)

    From the comparison between SSA-EWSVM-RNN-GPR and eight benchmark models, it can be concluded that the accuracy of point prediction has a great influence on the performance of interval prediction.

  5. (5)

    Compared with other models, the proposed SSA-EWSVM-RNN-GPR model proved to be an effective model for point prediction and interval prediction.

Conclusions

Forecasting stock indices accurately is crucial for investment decision and risk management and is extremely meaningful to investors and financial regulators. In this paper, the SSA-EWSVM-RNN-GPR model is used to forecast the closing prices of stock indices, and it is proven to be efficient in both point and interval forecasting. The SSA-EWSVM-RNN-GPR model utilizes singular spectrum analysis, enhanced weighted support vector machine, the simulated annealing algorithm, a recurrent neutral network, and Gaussian process regression. Singular spectrum analysis is used to decompose the original stock index signals into several components, to extract meaningful components and to discard the noise components. The enhanced weighted support vector machine, which considers the timing of the data, is employed to separately forecast each component that was decomposed via singular spectrum analysis, within which the intelligent simulated annealing algorithm is used to optimize the hyperparameters. To nonlinearly integrate the previous result, a recurrent neutral network is utilized to obtain accurate point forecasting results. Furthermore, to obtain uncertainty information regarding the forecasted closing price, Gaussian process regression is applied for confidence interval forecasting based on the previous point forecasting results. Compared with eight benchmark models, the proposed SSA-EWSVM-RNN-GPR model can be an effective tool for both point and interval forecasting of stock indices.

Although the developed stock index forecast framework shows good forecast accuracy in both point forecast and interval forecast, there are still some limitations that need to be improved. For example, better optimization algorithms in the future can be applied to the stock index prediction model. In addition, this research only considers the closing price, opening price, high price, low price, and change of stock index. In the future research, more factors can be considered under the framework of stock index prediction.