# Volatility Degree Forecasting of Stock Market by Stochastic Time Strength Neural Network

Authors: Haiyan Mo; Jun Wang
Journal: Mathematical Problems in Engineering
 (2013)

---

## Abstract

In view of the applications of artificial neural networks in economic and financial forecasting, a stochastic time strength function is introduced in the backpropagation neural network model to predict the fluctuations of stock price changes. In this model, stochastic time strength function gives a weight for each historical datum and makes the model have the effect of random movement, and then we investigate and forecast the behavior of volatility degrees of returns for the Chinese stock market indexes and some global market indexes. The empirical research is performed in testing the prediction effect of SSE, SZSE, HSI, DJIA, IXIC, and S&P 500 with different selected volatility degrees in the established model.


---

## Body

## 1. Introduction

Financial analysis of fluctuations of financial market is an active topic in economic research, with applications to the prediction of interest rates, foreign currency risk, stock market volatility, and so forth [1–8]. With the progress of globalized security markets, forecasting stock market volatility has become a significant financial subject, which attracts much increasing attention [9–11]. A key element of financial planning and financial forecasting is the ability to construct models showing the interrelatedness of financial data. Models showing correlation or causation between variables can be employed to improve financial decision making. The popular model of financial time series analysis is the artificial neural network (ANN), which is composed of artificial neurons or nodes. ANN is nonlinear statistical data modeling or decision making method; it can be used to model complex relationships between inputs and outputs or to find patterns in data. Generally, stock price changes can be regarded as a random time sequence with noise and artificial neural network and as a nonparametric method with large-scale processing elements operating in parallel that depend on their own intrinsic link data and can forecast future behaviors by learning the pattern of market variables without any strict theoretical assumption. ANN possesses data-driven, self-learning, and self-adaptive abilities and has strong antijamming capabilities. ANN has been widely used in the financial fields such as prediction of stock or option price, exchange rate, and risk analysis [12–19].In the real markets, the noise of financial time series is usually caused by large volatilities, and it is hard to reflect the market variables directly into the model without any assumptions. Therefore, making accurate forecast is a challenging task due to the inherently noisy and nonstationary nature of stock price. To improve predicting precision, various network architectures and learning algorithms have been developed in the literature [20–24]. Multilayer perceptron (MLP) is one of the most prevalent neural networks, which has the capability of complex mapping between inputs and outputs that makes it possible to approximate nonlinear function [25–28]. The present work applies MLP with a backpropagation algorithm and stochastic time strength function to develop a stock price volatility forecasting model; a stochastic time strength neural network (STNN) and the corresponding learning algorithm are presented. The motivation of modeling the STNN is that the data in the data training set should be time variant, reflecting the different behavior patterns of the markets at different times; if all the data are used to train the network equivalently, the network system may not be consistent with the evolvement of the stock markets. It is difficult to use the historical data of the past to reflect the current stock markets; however, if only the recent data are selected, a lot of useful information, which the early data hold, will be lost. From this consideration, the historical data are given weights depending on their time, and the Brownian motion is introduced in the time strength function in order to make the model have the effect of random movement while maintaining the original trend. In the present paper, we perform the empirical research focusing on the volatility degree’s behaviors of stock returns, and a threshold value q(≥0) is introduced to correspond to the volatility degree. For different threshold values, the volatility degree forecasting is made by STNN model. The empirical data are selected from the global stock indexes, including Shanghai Stock Exchange (SSE) Composite Index, Shenzhen Stock Exchange (SZSE) Component Index, Hong Kong Hang Seng Index (HSI), Dow Jones Industrial Average Index (DJIA), Nasdaq Composite Index (IXIC), Standard & Poor’s 500 Index (S&P 500), and Japan Nikkei 225 Index (N225).


## 2. Methodology for STNN Model

The structure of ANN plays an important role in its performance. In Figure1, we introduce a three-layer multi-input neural network, in which a stochastic time strength function is applied to minimize the error between the network’s prediction and the actual target. The architecture consists of a hidden layer of neurons with nonlinear activation functions and an output layer of neurons with linear activation functions. xit(i=1,…,n) represents the input variable at time t; zjt(j=1,…,m) represents the output of hidden layer neurons at time t; and yt+1 represents the output of the network at time t+1. wij is the weight that connects the node i in the input layer neurons to the node j in the hidden layer. vj is the weight that connects the node j in the hidden layer neurons to the node in the output layer. Hidden layer stage is as follows. The input of all neurons in the hidden layer is calculated by the following equation:
(1)netjt=∑i=1n‍wijxit-θj,i=1,…,n.
The output of hidden neuron is given by (2)zjt=fH(netjt)=fH(∑i=1n‍wijxit-θj),i=1,…,n,
where θj is the threshold of neuron in hidden layer. The sigmoid function in hidden layer is selected as the activation function: fH(x)=1/(1+exp{-x}). Output stage: the output of STNN is given as follows:
(3)yt+1=fT(∑j=1m‍vjzjt-θT),
where θT is the threshold of neuron in output layer and fT(x) is an identity map as the activation function.Figure 1
A three-layer multi-input neural network with one output.The backpropagation algorithm has emerged as one of the most widely used learning procedures for multilayer networks [7, 29, 30]. That is a supervised learning algorithm which minimizes the global error Ek by using the gradient descent method. For the STNN model, we assume that the error of the output is given by ɛtn=dtn-ytn and the error of the sample n is defined as
(4)E(tn)=12ϕ(tn)(dtn-ytn)2,
where tn is the time of the sample n(n=1,…,N), dtn is the actual value, ytn is the output at time tn, and ϕ(tn) is the stochastic time strength function which endows each historical data with a weight depending on the time at which it occurs. We define ϕ(tn) as follows
(5)ϕ(tn)=1βexp{∫t0tn‍μ(t)dt+∫t0tn‍σ(t)dB(t)},
where β>0 is the time strength coefficient, t0 is the time of the newest data in the data training set, and tn is an arbitrary time in the data training set. μ(t) is the drift function, σ(t) is the volatility function, and B(t) is the standard Brownian motion. A Brownian motion is a real valued, continuous stochastic process {X(t),t≥0}, on a probability space (Ω,𝒜,ℙ) with independent and stationary increments, such that Xt-X0 is a normal random variable with mean rt and variance σ2t, where r and σ are constant real numbers. A Brownian motion is standard (we denote it by B(t)) if B(0)=0ℙ-a.s., 𝔼[B(t)]=0, and 𝔼[B(t)]2=t, and the corresponding probability density function is given by ft(x)=(1/2πt)e-x2/2t. The above stochastic time strength function implies that the impact of the historical data on the stock market is a time variable function. Then, the corresponding global error of data training set at kth training iterations is defined as
(6)Ek=1N∑n=1NE(tn).The training objective of STNN is to update the network weights so as to minimize the global error in the data training set. The training algorithm procedure of STNN is described as follows. Step 1 is performing input data normalization. In STNN model, we choose four kinds of stock prices as the input values in the input layer: daily opening price, daily highest price, daily lowest price, and daily closing price. The output layer is the closing price of the next trading day. Step 2 is determining the network structure which isn×m×1 three-layer network model, parameters including learning rate η which is between 0 and 1, the maximum training iterations number K, and initial connective weights. At the beginning of data processing, sets wij0 and vj0 follow the uniform distribution on (-1,1), and let the neural thresholds θj and θT be 0. Step 3 is introducing the stochastic time strength function ϕ(tn) in sample n error E(tn) and the global error Ek, choosing the drift function μ(t) and the volatility function σ(tn), and determining the activation functions fH(x) and fT(x). Step 4 is setting a predefined minimum training threshold ζ. Based on network training objective Ek=(1/N)∑n=1NE(tn), if Ek is below the ζ, go to Step 6; otherwise, go to Step 5. Step 5 is updating the STNN connective weights and applying the error to compute the gradient of the weights wij, Δwijk and the gradient of the weights vj, Δvjk. For the weight nodes in the input layer, the gradient of the connective weight wij is given by
(7)Δwij=-η∂E(tn)∂wij=ηɛtnvjϕ(tn)fH′(netjtn)xitn,
and for the weight nodes in the hidden layer, the gradient of the connective weight vj is given by
(8)Δvj=-η∂E(tn)∂vj=ηɛtnϕ(tn)fH(netjtn),
where η is the learning rate and fH′(netjtn) is the derivative of the activation function. So the update rule for the weight wij and vj is given by
(9)wijk+1=wijk+Δwijk=wijk+ηɛtnvjϕ(tn)fH′(netjtn)xitn,vjk+1=vjk+Δvjk=vjk+ηɛtnϕ(tn)fH(netjtn).
Step 6: until the global error satisfies the predefined minimum training threshold ζ or training times reach the maximum iterations number, output the predictive value yt+1=fT(∑j=1mvjfH(∑i=1nwijxit)).


## 3. Data Selection

### 3.1. Statistical Behaviors of Price Changes and Volatilities

Study of the behaviors of stock price changes and volatilities has long been a focus in economic research. Recent empirical research shows that returns on financial markets are not Gaussian but exhibit excess kurtosis and fatter tails than the normal distribution, which is usually called the “fat-tail” phenomenon [31–33]. Higher kurtosis, which means more of the variance, is due to infrequent extreme deviations rather than frequent modestly sized deviations, indicating that the distribution is more “peaked.” The power-law distribution is an efficient way to study the fat-tail phenomenon. It is a universal property that emerged from complex physics systems and is also observed in economic and financial systems. The empirical evidence has shown that the distribution of logarithmic returns follows the power-law fluctuations P(|r(t)|>x)~x-α (α≈3) [34–36]; the formula of the stock logarithmic return [37, 38] from t-1 to t is as follows:
(10)r(t)=ln𝒮(t)-ln𝒮(t-1),t=1,2,…,T,
where 𝒮(t) denotes the stock daily closing price at time t. In Figure 2, we investigate the behaviors of probability density distributions and power-law distributions of daily returns for SSE, SZSE, HSI, DJIA, IXIC, S&P 500, and N225 in the 21-year period from April 1991 to February 2012, and the corresponding Gaussian distributions are also presented for comparison. Figure 2(a) exhibits that the peak distributions of returns are obvious and that the fat-tail phenomena are also visible. Figure 2(b) shows that the power-law tails of SSE, SZSE, and HSI decay slower than those of IXIC, N225, S&P 500, and DJIA. Besides, all the indexes’ power-law tails decay slower than those of Gaussian distribution. This result illustrates that the fat-tail phenomenon in Chinese financial markets is more obvious than other financial markets of the world. We also study the SSE power-law tail with liner fitting in Figure 2(b) and obtain that α≈2.4862 (which is smaller than α≈3); this reveals that Chinese financial markets have more severe volatilities than other stock markets of the world.Probability density distributions and power-law distributions of returns, respectively, for different indexes and Gaussian distribution.
(a)
(b)


### 3.2. Data Selecting and Processing

Financial market volatility is central to the theory and practice of asset allocation, asset pricing, risk management, and stock return volatility forecasting in the literature [11, 39, 40]. In the present paper, we introduce a threshold value q(≥0) to correspond to the volatility degrees and regard their corresponding index prices as STNN model’s dataset. We use the data samples with a volatility degree range to train the STNN model, and the output will be almost in the same range, providing a new approach to forecast the different volatility degrees. The procedure of STNN model datasets selection is described as follows. (i) Select the stock returns whose absolute returns are greater than a threshold value q; let ℛ(q) denote this corresponding return set which is given by ℛ(q)={r(t):|r(t)|≥q,t=1,…,T}; see Figure 3. (ii) For a fixed threshold value q, we determine the corresponding stock trading dates in return set ℛ(q); that is to say, we determine t values that satisfy |r(t)|≥q, t=1,…,T. In order to reflect the volatility of prices, considering that the return series r(t) is decided by the daily closing price values on (t-1)th and tth trading days (see the formula of r(t) in Section 3.1), we should select the price values at time t-1 as the input variables. The new dates series is also arranged in a chronological order. (iii) Select the daily opening prices, the daily highest prices, the daily lowest prices, and the daily closing prices in those dates that were filtered according to Step 2 as the four input variables. A trading date corresponds to a group of input variables, and the output variable is the daily closing price in the next group of variables. The dataset is divided into two parts, the training set and the testing set. We collect the data in the training set from January 2001 to December 2010 and the data in the testing set from January 2011 to February 2012. In the pretreatment and preprocessing stage, the collected data should be normalized and properly adjusted, in order to reduce the impact of noise in the stock markets; the normalized values of the above-mentioned four kinds of price data can be given as follows:
(11)𝒮^(t)=𝒮(t)-min𝒮(t)max𝒮(t)-min𝒮(t).
In Table 1, the measures of training and test samples for indexes SSE, SZSE, HSI, DJIA, IXIC and S&P 500 are performed for different values of q. The value 0.0119 is the mean of daily absolute returns of SSE from January 2001 to February 2012 for 2692 trading days, and the mean values of daily absolute returns for SZSE, HSI, DJIA, IXIC, and S&P 500 are 0.0133, 0.0111, 0.0086, 0.0118, and 0.0092, respectively. Since the objective of this work is the volatility degree forecasting, we choose some different volatility degrees for the forecasting analysis. Here, we take the mean of absolute returns of SSE as q1=0.0119, and the next five q values (from q2 to q6) are all 0.0003 larger than the former. Then, we can compare the errors of the prediction when q values gradually increase. In order to consider the large volatility prediction effect of STNN model, we take q7=0.0200 and q8=0.0250 into account. For the volatility degrees from q1 to q6, here we take values from q1 to q6 as examples in Table 1. For other different values of q, the corresponding volatility degree forecasting can be made similarly. Table 1 and Figure 3 show that the numbers of absolute returns that exceed 0.0200 or larger are few. Since q7 and q8 belong to large volatilities in the stock market, the events whose absolute returns exceed q7 or q8 do not happen frequently. From Table 1, the quantity of data samples gradually reduces with the increase of value q. When q ranges from 0.0119 to 0.0134, the corresponding numbers descend slowly. However, for q=0.0200 and 0.0250, the numbers of the data decrease sharply because of large volatilities of returns’ relatively rare appearing in the real markets.Table 1
Measures of training and testing samples for indexes with different values ofq.
Index
SSE
SZSE
HSI
DJIA
IXIC
S&P 500
q
Train
Test
Train
Test
Train
Test
Train
Test
Train
Test
Train
Test
q
0
=
0.0000
2418
274
2418
274
2468
279
2515
286
2513
285
2524
286
q
1
=
0.0119
1461
135
1569
161
1356
178
1003
121
1448
162
1074
129
q
2
=
0.0122
1432
135
1541
158
1317
177
960
115
1413
158
1036
127
q
3
=
0.0125
1388
132
1510
158
1279
172
920
110
1396
155
1009
127
q
4
=
0.0128
1372
130
1480
157
1241
168
885
109
1364
151
994
123
q
5
=
0.0131
1352
126
1449
155
1203
165
844
109
1329
150
960
121
q
6
=
0.0134
1325
122
1419
149
1171
164
819
108
1303
145
938
117
q
7
=
0.0200
796
43
926
81
662
70
426
58
786
77
456
63
q
8
=
0.0250
520
30
649
46
416
46
254
30
528
45
285
42Figure 3
Schematic diagram of volatility degrees of returns for different values ofq.


## 3.1. Statistical Behaviors of Price Changes and Volatilities

Study of the behaviors of stock price changes and volatilities has long been a focus in economic research. Recent empirical research shows that returns on financial markets are not Gaussian but exhibit excess kurtosis and fatter tails than the normal distribution, which is usually called the “fat-tail” phenomenon [31–33]. Higher kurtosis, which means more of the variance, is due to infrequent extreme deviations rather than frequent modestly sized deviations, indicating that the distribution is more “peaked.” The power-law distribution is an efficient way to study the fat-tail phenomenon. It is a universal property that emerged from complex physics systems and is also observed in economic and financial systems. The empirical evidence has shown that the distribution of logarithmic returns follows the power-law fluctuations P(|r(t)|>x)~x-α (α≈3) [34–36]; the formula of the stock logarithmic return [37, 38] from t-1 to t is as follows:
(10)r(t)=ln𝒮(t)-ln𝒮(t-1),t=1,2,…,T,
where 𝒮(t) denotes the stock daily closing price at time t. In Figure 2, we investigate the behaviors of probability density distributions and power-law distributions of daily returns for SSE, SZSE, HSI, DJIA, IXIC, S&P 500, and N225 in the 21-year period from April 1991 to February 2012, and the corresponding Gaussian distributions are also presented for comparison. Figure 2(a) exhibits that the peak distributions of returns are obvious and that the fat-tail phenomena are also visible. Figure 2(b) shows that the power-law tails of SSE, SZSE, and HSI decay slower than those of IXIC, N225, S&P 500, and DJIA. Besides, all the indexes’ power-law tails decay slower than those of Gaussian distribution. This result illustrates that the fat-tail phenomenon in Chinese financial markets is more obvious than other financial markets of the world. We also study the SSE power-law tail with liner fitting in Figure 2(b) and obtain that α≈2.4862 (which is smaller than α≈3); this reveals that Chinese financial markets have more severe volatilities than other stock markets of the world.Probability density distributions and power-law distributions of returns, respectively, for different indexes and Gaussian distribution.
(a)
(b)


## 3.2. Data Selecting and Processing

Financial market volatility is central to the theory and practice of asset allocation, asset pricing, risk management, and stock return volatility forecasting in the literature [11, 39, 40]. In the present paper, we introduce a threshold value q(≥0) to correspond to the volatility degrees and regard their corresponding index prices as STNN model’s dataset. We use the data samples with a volatility degree range to train the STNN model, and the output will be almost in the same range, providing a new approach to forecast the different volatility degrees. The procedure of STNN model datasets selection is described as follows. (i) Select the stock returns whose absolute returns are greater than a threshold value q; let ℛ(q) denote this corresponding return set which is given by ℛ(q)={r(t):|r(t)|≥q,t=1,…,T}; see Figure 3. (ii) For a fixed threshold value q, we determine the corresponding stock trading dates in return set ℛ(q); that is to say, we determine t values that satisfy |r(t)|≥q, t=1,…,T. In order to reflect the volatility of prices, considering that the return series r(t) is decided by the daily closing price values on (t-1)th and tth trading days (see the formula of r(t) in Section 3.1), we should select the price values at time t-1 as the input variables. The new dates series is also arranged in a chronological order. (iii) Select the daily opening prices, the daily highest prices, the daily lowest prices, and the daily closing prices in those dates that were filtered according to Step 2 as the four input variables. A trading date corresponds to a group of input variables, and the output variable is the daily closing price in the next group of variables. The dataset is divided into two parts, the training set and the testing set. We collect the data in the training set from January 2001 to December 2010 and the data in the testing set from January 2011 to February 2012. In the pretreatment and preprocessing stage, the collected data should be normalized and properly adjusted, in order to reduce the impact of noise in the stock markets; the normalized values of the above-mentioned four kinds of price data can be given as follows:
(11)𝒮^(t)=𝒮(t)-min𝒮(t)max𝒮(t)-min𝒮(t).
In Table 1, the measures of training and test samples for indexes SSE, SZSE, HSI, DJIA, IXIC and S&P 500 are performed for different values of q. The value 0.0119 is the mean of daily absolute returns of SSE from January 2001 to February 2012 for 2692 trading days, and the mean values of daily absolute returns for SZSE, HSI, DJIA, IXIC, and S&P 500 are 0.0133, 0.0111, 0.0086, 0.0118, and 0.0092, respectively. Since the objective of this work is the volatility degree forecasting, we choose some different volatility degrees for the forecasting analysis. Here, we take the mean of absolute returns of SSE as q1=0.0119, and the next five q values (from q2 to q6) are all 0.0003 larger than the former. Then, we can compare the errors of the prediction when q values gradually increase. In order to consider the large volatility prediction effect of STNN model, we take q7=0.0200 and q8=0.0250 into account. For the volatility degrees from q1 to q6, here we take values from q1 to q6 as examples in Table 1. For other different values of q, the corresponding volatility degree forecasting can be made similarly. Table 1 and Figure 3 show that the numbers of absolute returns that exceed 0.0200 or larger are few. Since q7 and q8 belong to large volatilities in the stock market, the events whose absolute returns exceed q7 or q8 do not happen frequently. From Table 1, the quantity of data samples gradually reduces with the increase of value q. When q ranges from 0.0119 to 0.0134, the corresponding numbers descend slowly. However, for q=0.0200 and 0.0250, the numbers of the data decrease sharply because of large volatilities of returns’ relatively rare appearing in the real markets.Table 1
Measures of training and testing samples for indexes with different values ofq.
Index
SSE
SZSE
HSI
DJIA
IXIC
S&P 500
q
Train
Test
Train
Test
Train
Test
Train
Test
Train
Test
Train
Test
q
0
=
0.0000
2418
274
2418
274
2468
279
2515
286
2513
285
2524
286
q
1
=
0.0119
1461
135
1569
161
1356
178
1003
121
1448
162
1074
129
q
2
=
0.0122
1432
135
1541
158
1317
177
960
115
1413
158
1036
127
q
3
=
0.0125
1388
132
1510
158
1279
172
920
110
1396
155
1009
127
q
4
=
0.0128
1372
130
1480
157
1241
168
885
109
1364
151
994
123
q
5
=
0.0131
1352
126
1449
155
1203
165
844
109
1329
150
960
121
q
6
=
0.0134
1325
122
1419
149
1171
164
819
108
1303
145
938
117
q
7
=
0.0200
796
43
926
81
662
70
426
58
786
77
456
63
q
8
=
0.0250
520
30
649
46
416
46
254
30
528
45
285
42Figure 3
Schematic diagram of volatility degrees of returns for different values ofq.


## 4. Forecasting Analysis

### 4.1. Parameters Determining of STNN Model

In the STNN model, the proper number of the hidden layer nodes requires validation techniques to avoid underfitting (too few neurons) and overfitting (too many neurons). According to the procedures of the three-layer network introduced in Section2, we chose the 4×8×1 neural network structure in which the number of neural nodes in the input layer is 4, the number of neural nodes in the hidden layer is 8, the number of neural nodes in the output layer is 1, the maximum training iterations number K=200, η=0.01, and the predefined minimum training threshold ζ=10-5. When using STNN model to predict the daily closing price of stock index, we assume μ(t) (the drift function) and σ(t) (the volatility function) are as follows:
(12)μ(t)=1(c-t)3,σ(t)=[1N-1∑i=1N‍(xi-x¯)2]1/2,
where c is the parameter which is equal to the number of sample in the datasets, β=1.25, and x¯ is the mean of the sample data. Then the stochastic time strength function is given by (see Section 2)
(13)ϕ(tn)=11.25exp{[1N-1∑i=1N‍(xi-x¯)2]1/2∫t0tn‍1(c-t)3dt+∫t0tn‍[1N-1∑i=1N‍(xi-x¯)2]1/2dB(t)[1N-1∑i=1N‍(xi-x¯)2]1/2}.To evaluate the forecasting performance of the STNN model, we use the following error evaluation criteria, absolute error (AE), relative error (RE), and mean absolute error (MAE), root mean-square error (RMSE), mean absolute percentage error (MAPE). These measures are defined as follows:(14)AE=dt-yt,RE=dt-ytdt,MAE=1N∑t=1N‍|dt-yt|,RMSE=[1N∑t=1N‍(dt-yt)2]1/2,MAPE=100×1N∑t=1N‍|dt-ytdt|,
where dt and yt are the actual and prediction values at time t, respectively, and N is the sample size. Noting that AE, RE, MAE, RMSE, and MAPE are measures of the deviation between prediction and actual values, the prediction performance is better when the values of these evaluation criteria are smaller. However, if the results are not consistent among these criteria, we choose the MAPE as the benchmark since MAPE is relatively more stable than other criteria [41].


### 4.2. Forecasting Results

In Section3, the method of selecting datasets of STNN model is put forward, and the database is presented. For the different values of q, the training and testing datasets including the quantity and corresponding prices date of sample are various. Next, we predict the fluctuation behaviors of stock prices by the proposed model with different threshold values of q. (1) For q=0, the selected datasets are the original daily price series. Forecasting results of SSE and S&P 500 by STNN are displayed in Figures 4 and 5, respectively.Figure 4
Comparison of forecasting result by STNN model and the daily closing prices of SSE and the corresponding errors’ plots.Figure 5
Comparison of forecasting result by STNN model and the daily closing prices of S&P 500 and the corresponding errors’ plots.Figures4 and 5 exhibit that the predictive values by STNN model and the actual values are close, and the relative errors are almost below 5%. Compared with traditional backpropagation neural network (BPNN), the forecasting results are presented in Table 2, where the MAPE(100) stands for the latest 100 days of MAPE in the testing data. Table 2 shows that the evaluation criteria by STNN model are almost smaller than those by BPNN. Besides, the values of MAPE(100) are smaller than those of MAPE in all stock indexes. Therefore, the short-term prediction outperforms the long-term prediction. In order to comparatively study the effect of fluctuation prediction for the STNN model and the BPNN model, we perform the paired-sample t-test and the nonparametric Wilcoxon signed rank test on two absolute AE value vectors of STNN and BPNN models (see Section 4.1). The corresponding statistical test results of six indexes are presented in Table 3. For indexes SZSE, HSI, DJIA, IXIC, and S&P 500, the values of double-tailed test p in two test methods approach 0, much smaller than the significance level 0.05, and the values of H are all 1. Thus, the null hypothesis is rejected that the predicted errors of STNN and BPNN models have significant difference. Besides, in Table 2, the error evaluation criteria MAE, RMSE, and MAPE by STNN are all smaller than those by BPNN for the above indexes. This shows that the effect of price fluctuation forecasting of STNN model is superior to that of BPNN model for these five indexes. Only for SSE index, the values of H in two test methods are 0 and the values of double-tailed test p are larger than 0.05. Thus, the null hypothesis is accepted that the predicted errors by STNN and BPNN models have no significant difference for SSE index.Table 2
Comparisons of indexes’ prediction by BPNN and STNN forq=0.
Index
SSE
SZSE
HSI
Errors
BPNN
STNN
BPNN
STNN
BPNN
STNN
MAE
28.3115
28.3190
174.6668
165.4092
317.6058
297.8046
RMSE
35.1332
35.1219
215.7711
204.0298
419.4783
394.2751
MAPE
1.0922
1.0925
1.6163
1.5212
1.5714
1.4660
MAPE (100)
0.9919
0.9922
1.2572
1.2518
0.9475
0.9699
Index
DJIA
IXIC
S&P 500
Errors
BPNN
STNN
BPNN
STNN
BPNN
STNN
MAE
215.9167
210.2087
52.3185
50.3318
19.2175
19.0905
RMSE
248.7886
242.2453
61.8688
59.9015
22.7849
22.5809
MAPE
1.7796
1.7345
1.9288
1.8581
1.5155
1.5058
MAPE (100)
1.6742
1.6164
1.9579
1.8446
1.4190
1.3931Table 3
Significant test of errors by STNN and BPNN models for indexes withq=0.
SSE
SZSE
HSI
DJIA
IXIC
S&P 500
t
H
0
1
1
1
1
1
t-value
0.2909
−6.7094
−7.5285
−9.4370
−12.2114
−6.6909
Prob.P
0.7714
1.1243
e
-
010
7.2526
e
-
013
1.4218
e
-
018
7.5248
e
-
028
1.1727
e
-
010
W
H
0
1
1
1
1
1
z-value
−0.3793
−6.2424
−7.1109
−8.5639
−11.1696
−6.8902
Prob.P
0.7044
4.3084
e
-
010
1.1529
e
-
012
1.0916
e
-
017
5.7430
e
-
029
5.5731
e
-
012
t means t-test and W means Wilcoxon signed rank test.(2) Letq range from 0.0119 (the mean of absolute returns of SSE from January 2001 to February 2012) to 0.0250. The experiment analysis of the prediction is performed by STNN for indexes SSE, SZSE, HSI, DJIA, IXIC, and S&P 500. Figures 6 and 7 show the volatility degree forecasting of SSE and S&P 500 by STNN model with different values of q, and they illustrate the effectiveness of the corresponding forecasting. When q is small, such as q=0.0119 in Figure 6(a) and q=0.0125 in Figure 6(b), the better performance of volatility prediction is revealed by the empirical results; that is, the predictive values and the actual values in Figures 6(a) and 6(b) are closer than those in Figures 6(c) and 6(d). Similar results are also indicated in Figure 7.Volatility degree prediction of SSE by STNN with different values ofq.
(a)
(b)
(c)
(d)Volatility degree prediction of S&P 500 by STNN with different values ofq.
(a)
(b)
(c)
(d)In order to comparatively investigate the volatility degree forecasting results for the other stock indexes more clearly, we present the same forecasting for SZSE, HSI, DJIA, and IXIC. Table4 shows the prediction performance by STNN model. The MAPE of the prediction becomes gradually larger with the increasing of q, and the experiment results exhibit that the volatility degree forecasting by STNN model is feasible.Table 4
MAPE of indexes’ prediction by STNN with different values ofq.
MAPE
SSE
SZSE
HSI
DJIA
IXIC
S&P 500
q
1
=
0.0119
1.6330
1.9462
1.7611
1.9304
2.3165
1.8847
q
2
=
0.0122
1.6312
1.9424
1.7759
1.9365
2.3367
1.9184
q
3
=
0.0125
1.6559
1.9504
1.8220
1.9441
2.3533
1.9365
q
4
=
0.0128
1.6585
1.9555
1.8483
1.9478
2.3757
1.9812
q
5
=
0.0131
1.6897
2.0314
1.8829
1.9486
2.4019
2.0058
q
6
=
0.0134
1.7227
2.0025
1.9212
1.9543
2.4074
2.0302
q
7
=
0.0200
2.8781
2.6260
2.5884
2.3541
2.9259
2.5139
q
8
=
0.0250
3.2507
3.2702
2.9770
3.3216
3.6744
3.2173


### 4.3. Further Evaluation of Forecasting Performance

To further evaluate the forecasting performance, we employ three statistical analysis methods including directional symmetry (DS), correct up (CP) trend, and correct down (CD) trend [42]. CP and CD provide the correctness of predicted up trend and predicted down trend indexes in terms of percentage, respectively. The forecasting of change direction will be more precise when the values of three statistical metrics become larger. The definitions of the three statistical methods are given as follows:
(15)DS=100N1∑t=1N1‍at,at={1if(yt-yt-1)(dt-dt-1)≥0,0otherwise,
where N1 is the number of training (testing) samples;
(16)DP=100N2∑t=1N2‍at,at={1if(yt-yt-1)>0,(yt-yt-1)(dt-dt-1)≥0,0otherwise,
where N2 is the number of training (testing) samples for (yt-yt-1)>0;
(17)CD=100N3∑t=1N3‍at,at={1if(yt-yt-1)<0,(yt-yt-1)(dt-dt-1)≥0,0otherwise,
where N3 is the number of training (testing) samples for (yt-yt-1)<0.Table5 gives the numerical forecasting results for SSE, SZSE, HSI, DJIA, IXIC, and S&P 500. All the stock indexes change a little when q varies from q1 to q6. The direction forecasting effect of IXIC index is the best from q1 to q6 since the values of DS, CP, and CD all exceed 50. When q=q7, some criteria change sharply; for example, for SSE index, the values of DS and CP decrease from 51.24 and 43.40 (for q=q6) to 46.51 and 36.84 (for q=q7), respectively. The value of CD of S&P 500 increases, but its value of CP reduces when q varies from q6 to q7, and HSI index has the adverse result. From Table 5, we can conclude that the direction forecasting by STNN model has little difference when q is small but may cause obvious changes when q is large.Table 5
Statistical metrics for testing data with different values ofq.
Index
SSE
SZSE
HSI
q
DS
CP
CD
DS
CP
CD
DS
CP
CD
q
1
=
0.0119
49.25
41.94
55.56
44.38
36.23
50.55
46.33
46.67
45.98
q
2
=
0.0122
49.62
41.94
56.34
44.30
34.62
50.67
46.59
47.19
45.98
q
3
=
0.0125
50.38
42.62
57.14
44.09
35.82
50.00
47.37
47.67
47.06
q
4
=
0.0128
51.16
44.07
57.14
43.95
36.76
50.00
47.31
46.99
47.62
q
5
=
0.0131
52.00
44.64
57.97
44.81
36.92
50.56
46.34
45.68
46.99
q
6
=
0.0134
51.24
43.40
57.35
46.95
38.10
51.76
46.01
45.68
46.34
q
7
=
0.0200
46.51
36.84
54.17
46.25
36.36
53.19
47.82
52.78
42.42
Index
DJIA
IXIC
S&P 500
q
DS
CP
CD
DS
CP
CD
DS
CP
CD
q
1
=
0.0119
48.33
47.76
49.06
52.80
52.87
52.70
45.31
43.66
47.37
q
2
=
0.0122
45.61
44.44
47.06
51.59
50.00
53.42
44.44
43.48
45.61
q
3
=
0.0125
44.55
42.37
47.06
51.95
51.22
52.78
44.44
43.48
45.61
q
4
=
0.0128
44.95
43.10
47.32
52.00
51.85
52.17
46.72
45.45
48.21
q
5
=
0.0131
45.04
42.37
48.08
51.01
51.25
50.72
47.50
46.15
49.09
q
6
=
0.0134
44.95
42.11
47.06
51.39
51.28
51.52
48.28
47.54
49.09
q
7
=
0.0200
45.61
41.38
50.00
42.11
36.11
47.50
45.16
38.71
51.61


## 4.1. Parameters Determining of STNN Model

In the STNN model, the proper number of the hidden layer nodes requires validation techniques to avoid underfitting (too few neurons) and overfitting (too many neurons). According to the procedures of the three-layer network introduced in Section2, we chose the 4×8×1 neural network structure in which the number of neural nodes in the input layer is 4, the number of neural nodes in the hidden layer is 8, the number of neural nodes in the output layer is 1, the maximum training iterations number K=200, η=0.01, and the predefined minimum training threshold ζ=10-5. When using STNN model to predict the daily closing price of stock index, we assume μ(t) (the drift function) and σ(t) (the volatility function) are as follows:
(12)μ(t)=1(c-t)3,σ(t)=[1N-1∑i=1N‍(xi-x¯)2]1/2,
where c is the parameter which is equal to the number of sample in the datasets, β=1.25, and x¯ is the mean of the sample data. Then the stochastic time strength function is given by (see Section 2)
(13)ϕ(tn)=11.25exp{[1N-1∑i=1N‍(xi-x¯)2]1/2∫t0tn‍1(c-t)3dt+∫t0tn‍[1N-1∑i=1N‍(xi-x¯)2]1/2dB(t)[1N-1∑i=1N‍(xi-x¯)2]1/2}.To evaluate the forecasting performance of the STNN model, we use the following error evaluation criteria, absolute error (AE), relative error (RE), and mean absolute error (MAE), root mean-square error (RMSE), mean absolute percentage error (MAPE). These measures are defined as follows:(14)AE=dt-yt,RE=dt-ytdt,MAE=1N∑t=1N‍|dt-yt|,RMSE=[1N∑t=1N‍(dt-yt)2]1/2,MAPE=100×1N∑t=1N‍|dt-ytdt|,
where dt and yt are the actual and prediction values at time t, respectively, and N is the sample size. Noting that AE, RE, MAE, RMSE, and MAPE are measures of the deviation between prediction and actual values, the prediction performance is better when the values of these evaluation criteria are smaller. However, if the results are not consistent among these criteria, we choose the MAPE as the benchmark since MAPE is relatively more stable than other criteria [41].


## 4.2. Forecasting Results

In Section3, the method of selecting datasets of STNN model is put forward, and the database is presented. For the different values of q, the training and testing datasets including the quantity and corresponding prices date of sample are various. Next, we predict the fluctuation behaviors of stock prices by the proposed model with different threshold values of q. (1) For q=0, the selected datasets are the original daily price series. Forecasting results of SSE and S&P 500 by STNN are displayed in Figures 4 and 5, respectively.Figure 4
Comparison of forecasting result by STNN model and the daily closing prices of SSE and the corresponding errors’ plots.Figure 5
Comparison of forecasting result by STNN model and the daily closing prices of S&P 500 and the corresponding errors’ plots.Figures4 and 5 exhibit that the predictive values by STNN model and the actual values are close, and the relative errors are almost below 5%. Compared with traditional backpropagation neural network (BPNN), the forecasting results are presented in Table 2, where the MAPE(100) stands for the latest 100 days of MAPE in the testing data. Table 2 shows that the evaluation criteria by STNN model are almost smaller than those by BPNN. Besides, the values of MAPE(100) are smaller than those of MAPE in all stock indexes. Therefore, the short-term prediction outperforms the long-term prediction. In order to comparatively study the effect of fluctuation prediction for the STNN model and the BPNN model, we perform the paired-sample t-test and the nonparametric Wilcoxon signed rank test on two absolute AE value vectors of STNN and BPNN models (see Section 4.1). The corresponding statistical test results of six indexes are presented in Table 3. For indexes SZSE, HSI, DJIA, IXIC, and S&P 500, the values of double-tailed test p in two test methods approach 0, much smaller than the significance level 0.05, and the values of H are all 1. Thus, the null hypothesis is rejected that the predicted errors of STNN and BPNN models have significant difference. Besides, in Table 2, the error evaluation criteria MAE, RMSE, and MAPE by STNN are all smaller than those by BPNN for the above indexes. This shows that the effect of price fluctuation forecasting of STNN model is superior to that of BPNN model for these five indexes. Only for SSE index, the values of H in two test methods are 0 and the values of double-tailed test p are larger than 0.05. Thus, the null hypothesis is accepted that the predicted errors by STNN and BPNN models have no significant difference for SSE index.Table 2
Comparisons of indexes’ prediction by BPNN and STNN forq=0.
Index
SSE
SZSE
HSI
Errors
BPNN
STNN
BPNN
STNN
BPNN
STNN
MAE
28.3115
28.3190
174.6668
165.4092
317.6058
297.8046
RMSE
35.1332
35.1219
215.7711
204.0298
419.4783
394.2751
MAPE
1.0922
1.0925
1.6163
1.5212
1.5714
1.4660
MAPE (100)
0.9919
0.9922
1.2572
1.2518
0.9475
0.9699
Index
DJIA
IXIC
S&P 500
Errors
BPNN
STNN
BPNN
STNN
BPNN
STNN
MAE
215.9167
210.2087
52.3185
50.3318
19.2175
19.0905
RMSE
248.7886
242.2453
61.8688
59.9015
22.7849
22.5809
MAPE
1.7796
1.7345
1.9288
1.8581
1.5155
1.5058
MAPE (100)
1.6742
1.6164
1.9579
1.8446
1.4190
1.3931Table 3
Significant test of errors by STNN and BPNN models for indexes withq=0.
SSE
SZSE
HSI
DJIA
IXIC
S&P 500
t
H
0
1
1
1
1
1
t-value
0.2909
−6.7094
−7.5285
−9.4370
−12.2114
−6.6909
Prob.P
0.7714
1.1243
e
-
010
7.2526
e
-
013
1.4218
e
-
018
7.5248
e
-
028
1.1727
e
-
010
W
H
0
1
1
1
1
1
z-value
−0.3793
−6.2424
−7.1109
−8.5639
−11.1696
−6.8902
Prob.P
0.7044
4.3084
e
-
010
1.1529
e
-
012
1.0916
e
-
017
5.7430
e
-
029
5.5731
e
-
012
t means t-test and W means Wilcoxon signed rank test.(2) Letq range from 0.0119 (the mean of absolute returns of SSE from January 2001 to February 2012) to 0.0250. The experiment analysis of the prediction is performed by STNN for indexes SSE, SZSE, HSI, DJIA, IXIC, and S&P 500. Figures 6 and 7 show the volatility degree forecasting of SSE and S&P 500 by STNN model with different values of q, and they illustrate the effectiveness of the corresponding forecasting. When q is small, such as q=0.0119 in Figure 6(a) and q=0.0125 in Figure 6(b), the better performance of volatility prediction is revealed by the empirical results; that is, the predictive values and the actual values in Figures 6(a) and 6(b) are closer than those in Figures 6(c) and 6(d). Similar results are also indicated in Figure 7.Volatility degree prediction of SSE by STNN with different values ofq.
(a)
(b)
(c)
(d)Volatility degree prediction of S&P 500 by STNN with different values ofq.
(a)
(b)
(c)
(d)In order to comparatively investigate the volatility degree forecasting results for the other stock indexes more clearly, we present the same forecasting for SZSE, HSI, DJIA, and IXIC. Table4 shows the prediction performance by STNN model. The MAPE of the prediction becomes gradually larger with the increasing of q, and the experiment results exhibit that the volatility degree forecasting by STNN model is feasible.Table 4
MAPE of indexes’ prediction by STNN with different values ofq.
MAPE
SSE
SZSE
HSI
DJIA
IXIC
S&P 500
q
1
=
0.0119
1.6330
1.9462
1.7611
1.9304
2.3165
1.8847
q
2
=
0.0122
1.6312
1.9424
1.7759
1.9365
2.3367
1.9184
q
3
=
0.0125
1.6559
1.9504
1.8220
1.9441
2.3533
1.9365
q
4
=
0.0128
1.6585
1.9555
1.8483
1.9478
2.3757
1.9812
q
5
=
0.0131
1.6897
2.0314
1.8829
1.9486
2.4019
2.0058
q
6
=
0.0134
1.7227
2.0025
1.9212
1.9543
2.4074
2.0302
q
7
=
0.0200
2.8781
2.6260
2.5884
2.3541
2.9259
2.5139
q
8
=
0.0250
3.2507
3.2702
2.9770
3.3216
3.6744
3.2173


## 4.3. Further Evaluation of Forecasting Performance

To further evaluate the forecasting performance, we employ three statistical analysis methods including directional symmetry (DS), correct up (CP) trend, and correct down (CD) trend [42]. CP and CD provide the correctness of predicted up trend and predicted down trend indexes in terms of percentage, respectively. The forecasting of change direction will be more precise when the values of three statistical metrics become larger. The definitions of the three statistical methods are given as follows:
(15)DS=100N1∑t=1N1‍at,at={1if(yt-yt-1)(dt-dt-1)≥0,0otherwise,
where N1 is the number of training (testing) samples;
(16)DP=100N2∑t=1N2‍at,at={1if(yt-yt-1)>0,(yt-yt-1)(dt-dt-1)≥0,0otherwise,
where N2 is the number of training (testing) samples for (yt-yt-1)>0;
(17)CD=100N3∑t=1N3‍at,at={1if(yt-yt-1)<0,(yt-yt-1)(dt-dt-1)≥0,0otherwise,
where N3 is the number of training (testing) samples for (yt-yt-1)<0.Table5 gives the numerical forecasting results for SSE, SZSE, HSI, DJIA, IXIC, and S&P 500. All the stock indexes change a little when q varies from q1 to q6. The direction forecasting effect of IXIC index is the best from q1 to q6 since the values of DS, CP, and CD all exceed 50. When q=q7, some criteria change sharply; for example, for SSE index, the values of DS and CP decrease from 51.24 and 43.40 (for q=q6) to 46.51 and 36.84 (for q=q7), respectively. The value of CD of S&P 500 increases, but its value of CP reduces when q varies from q6 to q7, and HSI index has the adverse result. From Table 5, we can conclude that the direction forecasting by STNN model has little difference when q is small but may cause obvious changes when q is large.Table 5
Statistical metrics for testing data with different values ofq.
Index
SSE
SZSE
HSI
q
DS
CP
CD
DS
CP
CD
DS
CP
CD
q
1
=
0.0119
49.25
41.94
55.56
44.38
36.23
50.55
46.33
46.67
45.98
q
2
=
0.0122
49.62
41.94
56.34
44.30
34.62
50.67
46.59
47.19
45.98
q
3
=
0.0125
50.38
42.62
57.14
44.09
35.82
50.00
47.37
47.67
47.06
q
4
=
0.0128
51.16
44.07
57.14
43.95
36.76
50.00
47.31
46.99
47.62
q
5
=
0.0131
52.00
44.64
57.97
44.81
36.92
50.56
46.34
45.68
46.99
q
6
=
0.0134
51.24
43.40
57.35
46.95
38.10
51.76
46.01
45.68
46.34
q
7
=
0.0200
46.51
36.84
54.17
46.25
36.36
53.19
47.82
52.78
42.42
Index
DJIA
IXIC
S&P 500
q
DS
CP
CD
DS
CP
CD
DS
CP
CD
q
1
=
0.0119
48.33
47.76
49.06
52.80
52.87
52.70
45.31
43.66
47.37
q
2
=
0.0122
45.61
44.44
47.06
51.59
50.00
53.42
44.44
43.48
45.61
q
3
=
0.0125
44.55
42.37
47.06
51.95
51.22
52.78
44.44
43.48
45.61
q
4
=
0.0128
44.95
43.10
47.32
52.00
51.85
52.17
46.72
45.45
48.21
q
5
=
0.0131
45.04
42.37
48.08
51.01
51.25
50.72
47.50
46.15
49.09
q
6
=
0.0134
44.95
42.11
47.06
51.39
51.28
51.52
48.28
47.54
49.09
q
7
=
0.0200
45.61
41.38
50.00
42.11
36.11
47.50
45.16
38.71
51.61


## 5. Conclusion

In the present paper, we develop a neural network with the stochastic time strength function to forecast the volatility degrees of stock market indexes. The effectiveness of STNN model has been analyzed by performing the numerical experiments on the price data of SSE, SZSE, HSI, DJIA, IXIC, and S&P 500. We also investigate the statistical behaviors of the tail distributions (or volatilities) for SSE, SZSE, and other global indexes by comparison, revealing that the Chinese financial markets have more severe fluctuations than other stock markets of the world. We select different volatility degrees for different threshold values ofq, and the corresponding training and testing databases are introduced. The empirical research of this work indicates that some prediction results have been improved by STNN model, and the forecasting effect will decline as q becomes larger. We hope this new approach can make some contributions to financial market volatility forecasting.



---

*Source: 436795-2013-10-30.xml*