Stock Market Prediction Using Artificial Neural Networks

. In this study we apply back propagation Neural Network models to predict the daily Shanghai Stock Exchange Composite Index. The learning algorithm and gradient search technique are constructed in the models. We evaluate the prediction models and conclude that the Shanghai Stock Exchange Composite Index is predictable in the short term. Empirical study shows that the Neural Network models is successfully applied to predict the daily highest, lowest, and closing value of the Shanghai Stock Exchange Composite Index, but it can not predict the return rate of the Shanghai Stock Exchange Composite Index in short terms


Introduction
Within the last two decades, there have been many attempts to predict stock prices and price fluctuations with neural networks.[1][2][3][4][5][7][8][9].Financial market is a highly complicate nonlinear system.It is not only variation that has its own regulation, but also influenced by many other factors such as politics, economic situation and investors' psychology.Neural network enjoys the virtue of self-organization and adaptability and can learn economical knowledge from historical datasets, so the neural network is suitable implement to predict stock prices and price fluctuations.
According to the efficient market hypothesis, in the financial market, stock prices rapidly adjust to new information once it becomes public, making the prediction of stock market's movements impossible [2].This judgment is correct for traditional studies using multiple linear regression analysis.However, stock prices will become predictable if the dynamic and non-linear relationships in sock markets are shown.This is the motivation for applying neural networks to financial time series analysis.
Until now, application of neural networks to predict the movements of financial markets has attracted many researchers' attention.White [13] proposed neural network modeling and learning techniques to search for and decode nonlinear regularities of asset price movements and predicted IBM daily stock prices, Chenoweth [4] studied the trading system based on the future values of daily S&P 500 index.Zhang [15] carried out various analyses in four kinds Stock including Lujiazui, Fuhua Industrial, Changchun Hualian, Shanghai Petrochemical using BP network with special input data.Wang [12] introduced the sliding window technique and RBF network into non-linear time series, the result was good.Some of these researches merely used the past values of the stock index as the input of neural networks so as to obtain forecast, while others made use of additional financial factors as inputs.
In this study we apply back propagation Neural Network models to predict the daily Shanghai Stock Exchange Composite Index.The learning algorithm and gradient search technique are constructed in the models.We evaluate the prediction models and conclude that the Shanghai Stock Exchange Composite Index is predictable in the short term.Empirical study shows that the Neural Network models is successfully applied to predict the daily highest, lowest, and closing value of the Shanghai Stock Exchange Composite Index, but it can not predict the return rate of the Shanghai Stock Exchange Composite Index in short terms.
This paper is organized as follows.In the next section, we introduce the model of neural networks.Section 3 gives the data description and analysis.In section 4, we evaluate the prediction models.Section 5 summarizes the conclusions.

Models of Neural Networks
In this section we describe general features of applications of the Neural Networks to data analysis.The Neural Network is not a standard tool for statistical analysis, which can be regard as an algorithm for Artificial Intelligence and Machine Learning.
The Neural Network has different styles as connection styles are various.Our study chooses Back Propagation Neural Network which uses error back propagation as weight training, to train and test the sample data.
The BP Neural Network is a kind of one-way transmission of multilayer feed forward neural network, with one or more layers of hidden nodes, besides input and output nodes in its structure.There is no connection between nodes on the same level.We can treat it as a highly nonlinear mapping from input to output.Our model uses learning algorithm, gradient search techniques in the learning process and the error back propagation to modify weights, to achieve the minimum of the output error.The following diagram shows a usual BP neural network model with one hidden layer.g , 2 g correspond to the appropriate activation functions of hidden and output layer.
For a given input pattern µ , the input to hidden unit j is , and the output is Corresponding to any input mode µ and output unit i , the instantaneous error function is defined as and total error function for the output unit i is defined as . The weight learning is to select the appropriate increment as new weight for eachω , so that the conduct of the error function decreases as the iteration, and eventually reach a certain minimum value

1056
Information Technology for Manufacturing Systems III in whole or in part.The gradient descent algorithm can be carried out on the right to learn.For the connection weight matrix W between hidden units and output units and the input mode µ , we can use the rules of the gradient descent to obtain , where 0 η > is the appropriate selection of learning step, and ' 2 ( )( ) . Similarly, for the connection weight matrix between hidden units and input unit w , we can use the chain rule to obtain , where ' 1 ( ) Activation functions 1 g , 2 g shall be single-valued function, to make neurons reversible.Commonly used functions are the Sigmoid function and the log-Sigmoid function, and the mathematical expressions are The main purpose is to predict the daily highest, lowest, closing, and opening prices of individual stock and the daily return.In order to make the information more comprehensive and more predicable, we choose following indicators as the input variables to neural network: for The Shanghai Stock Exchange Composite Index , the input include the daily opening, highest, lowest, and closing prices, trading volume, difference between the highest and lowest prices, and the daily return; and chose the input include the highest, lowest, opening and closing prices, trading volume, difference between the highest/lowest prices and return for one stock.The data should be normalized due to the different dimensions.The normalization method for each variable is to divide its maximum value.Thus, we obtain the normalized data within the limit of [  The input matrix of neural network is t X , and the outputs are as follows: ) , , , (

Neural Network Predicting
Network Settings.The principles of choose the number of hidden nodes are: 2 log (The dimension of input neurons) + 1; (2) Generally, select 0 1 ( ) n n n + + , where 0 n is the number of input neurons, 1 n is the number of output neurons, and n is an integer from 1 to 10 ; (3) The number of nodes in hidden layer = (input nodes + output nodes) / 2 .The network has 75 nodes of input units, one node of output units, and then the number of hidden nodes is 38.We take Access specific data on the training of network test, from Figure 5 to Figure8 we can know that, the relative errors of H , L and C are very small, indicating the accuracy of the network after training is better due to testing, and could be used for prediction.As for R , the relative error is large, indicating that this network after training can not be used to predict.As Figure9, Figure 10, and Figure 11 show, the network after training can fit the original data, and results of forecast are good.Thus, we conclude that the trained neural network is very suitable for predicting the highest price 1t H , lowest price 1t L , opening price 1t O and closing price 1t C of the Shanghai Stock Exchange Composite Index:, but the result for the return t R is bad.

Conclusions
From the present analysis, we can conclude that: (1) The Neural Network model is an appropriate tool to predict the Shanghai Stock Exchange Composite Index, which means that the Chinese Securities Market is not an efficient market.
(2) Based on the history data, the Neural Network model is successfully applied to predict the daily highest/lowest price and Closing price of the Shanghai Stock Exchange Composite Index in short time, but it is ineffective for predicting the return rate of the Shanghai Stock Exchange Composite Index.
(3) The Neural Network model may help in the further research on derivative products pricing, portfolio management and financial risk management.

Fig. 1 .
Fig. 1.Structure of BP Neural Networks Where i O is output unit, i V is the hidden unit, k ξ is input unit, jk w is connection weight from the input unit k to hidden unit j , ij W is connection weight from the hidden unit j to output unit i , ( , ) W w ω = are all the connections weight.µ means different input mode, and p is the number input mode, where 1, 2, , P µ = Number section and subsection headings consecutively in Arabic numbers and type them in bold.Avoid using too many capital letters.If any further subdivision of a subsection is needed the titles should be 10 point and flushed left.The data used in this study are obtained from the web site of Shanghai Stock Exchange.Our data covers the horizon from March 17, 2010 to April 28, 2010, including the daily prices of The Shanghai Stock Exchange Composite Index.