Ritsumeikan University The Graduate School of Science and Engineering Stock Price Forecasting Using Computational Intelligence Approaches Student: Nguyen Lu Dang Khoa (ID: 6124050299-1) Academic Supervisors: Professor Nishikawa Ikuko A Thesis In Partial Fulfilment of the Requirements for The Degree of Master of Engineering July 2007 Abstract This research predicts the US stock index S&P 500 one month in the future using computational intelligence based approaches. The research simulation uses three different monthly data sets with different market characteristics in more than 20 years. Multi-layer feedforward neural networks trained by back propagation with early stopping technique are used as a framework for the prediction. Besides, other techniques are also included to aid neural networks in improving the prediction results: inputs selection using genetic algorithms, the studies of non-standard error functions in back propagation learning with time and profit adjustment factors, the use of recurrent neural networks, and the use of neural network ensembles.
The study shows the predictability of the stock price with the neural network based approach. Neural networks are able to capture the non-linear and chaotic characteristics in the stock price data. The integrations of other techniques into neural networks do improve the prediction ability of neural networks in the stock price forecasting problem. The best profit gained by a prediction model using genetic algorithms to select inputs for neural networks is about 1.79 times higher than the profit gained by a model using all available variables.
The best profit gained by a prediction model using an adjustment factor of both time and profit information in the error function is approximately 1.25 times higher than the profit gained by an ordinary least square training. Moreover, the research shows an effectiveness of a neural network ensemble over a single network when individual networks in the ensemble have different forecasting abilities. It also suggests that in unstable periods of the market, average based methods should be used. In more stable ones, majority vote based methods are a better choice.
The best ensemble predictions using weighted average and majority vote have profits about 1.24 times higher than the average results of single neural network predictions. Finally, simple recurrent neural networks with the ‘time capture’ capabilities have better prediction results than feedforward neural networks. The best profit gained by recurrent neural networks is approximately 1.41 times higher than the profit gained by feedforward neural networks. i Acknowledgements I would like to express my sincere gratitude to my supervisors Professor Nishikawa Ikuko and Professor Kamei Katsuari for their kind guidances, encouragements, advices, and for sharing their valuable time, knowledge, and experiences throughout the research.
I am grateful to the Japan International Cooperation Center (JICE) for financial grant and kind care during my stay in Japan. My sincere thanks are for Dr. Sakakibara Kazutoshi for his valuable suggestions and for providing technical support in the research period. My sincere thanks are also for Noshiki Manabu, Iritani Takeshi, Saidamin Usmanov, Nouno Ikue, Hasegawa Hiroe, and Sakamoto Hirotaka for their comments and suggestions in my research.
I am grateful to all friends and colleagues in Computational Intelligence Laboratory, Ritsumeikan University and Faculty of Computer Science and Engineering, Ho Chi Minh City University of Technology for their help and support. Finally, I thank my parents, my sisters for their support and encouragement during more than two years in Japan. ii Table of Contents Abstract. ii Table of Contents.
iii List of Tables. vi List of Figures. vii Chapter One: Introduction .1 Chapter Two: Stock Price Forecasting Problem .1 Introduction to the Financial Market .3 Literature Review and Problem Analysis .1 Predicting the stock price using neural networks .2 The use of non-standard error functions.3 Inputs selection for neural networks.4 Neural network ensembles .8 Chapter Three: Artificial Neural Networks .1 Structure of Neural Networks .2 Back Propagation Learning .2 Forward propagation step .3 Back propagation step .3 Neural Network Ensembles .1 Motivation of using an ensemble .2 Training an ensemble .3 Ensemble combination methods.4 Applications of Neural Networks .17 Chapter Four: Genetic Algorithms .1 Genetic Algorithm Components .2 A Simple Genetic Algorithm .20 Chapter Five: Sensitivity Analysis .3 Weight Magnitude Analysis Method.4 Variable Perturbation Method .23 Chapter Six: Stock Price Forecasting Using Computational Intelligence Approaches .1 Neural Network Model for the Stock Price Forecasting Problem .3 Model construction and network training.2 Non-standard Error Function with Time and Profit Adjustment Factors .3 Inputs Selection Using Genetic Algorithms .4 Model Enhancement Using Neural Network Ensembles .1 Training an ensemble .2 Ensemble combination methods.33 Chapter Seven: Experimental Results .2 Inputs Selection for Neural Networks .1 Inputs selection using sensitivity analysis.2 Inputs selection using genetic algorithms.3 Comparison of inputs selection models.3 Prediction Using Neural Networks with Time and Profit Adjustment Factors in Error Function.4 Model Enhancement Using Neural Network Ensembles .2 Negative correlation learning .5 Recurrent Neural Networks .53 Chapter Eight: Conclusions and Future Works .2 Limitations of the Research .61 v List of Tables Table 7. Three data sets.
Variable indexes description of the used data sets. Inputs selected by sensitivity analysis techniques (data set 1). Inputs selected by sensitivity analysis (equation method). Input variables selected by genetic algorithms.
Comparisons of three forecast models. Prediction results of training techniques using time and profit adjustment factors. Prediction results using neural network ensembles. Ensemble with negative correlation learning in data set 3 (λ=0).
Ensemble with negative correlation learning in data set 3 (λ=0. Ensemble with negative correlation learning in data set 3 (λ=1). Ensemble with negative correlation learning in data set 1 (λ=0. Ensemble with negative correlation learning in data set 2 (λ=0.
Stock price forecasting using recurrent neural networks.54 vi List of Figures Figure 3. A typical three-layered fully connected neural network. It consists of an input layer, a hidden layer and an output layer. A simple recurrent neural network.
The forward propagation step. Backward error in hidden layer. Reproduction: one-point crossover and single-bit mutation operators. Chromosome representation of neural network inputs.
The S&P 500 monthly chart (data set 1). The S&P 500 monthly chart (data set 2). The S&P 500 monthly chart (data set 3). Weight magnitude analysis method (data set 1).
Variable perturbation method (data set 1). The search process of genetic algorithm in data set 1. The search process of genetic algorithm in data set 2. The search process of genetic algorithm in data set 3.
Prediction results of neural network ensembles of various sizes .50 vii Chapter One: Introduction Stock price forecasting is a hot topic in forecasting financial time series data. Once the forecasting is successful, we could determine a suitable trading strategy and could get a high profit. That is the reason many investors as well as researchers have tried to find advanced methods to predict the stock price systematically. However, predicting the stock price is difficult since it depends on several known and unknown factors, and the data used for forecasting is often noisy, uncertain, and incomplete [21].
Moreover, the ‘random walk’ and the ‘efficient market hypothesis’, two well known theories about the market efficiency, claim that in well functioning markets, prices are unpredictable and any chance for a systematically profitable trading is eliminated. There has been an ongoing debate about the validity of the random walk and efficient market hypothesis, and many researchers have attempted to find methods to validate the predictability of the market. A number of recent studies have successfully developed prediction models for the stock prices using statistical forecasting techniques [18]. Two typically used techniques in stock price analysis are fundamental analysis and technical analysis.
Fundamental analysis involves a focus on economic data such as oil prices, interest rates, consumer price indexes, and foreign rates of exchange, etc. to predict stock market indexes whereas technical analysis relies mainly on market activity itself such as historical prices and volume data, and their derived charts or technical indicators such as moving average, momentum, relative strength index, etc. Most studies using those techniques attempt to capture the relationship between available data and the stock price using linear assumptions. However, the relationship between the stock price, the financial and economic variables is not linear.
Therefore, nonlinear models could produce more reliable and correct predictions of stock prices. Although a number of nonlinear statistical techniques have been used to produce better forecasts of stock prices, most techniques require that the nonlinear models have to be specified before the estimation of parameters can be determined [21]. In recent years, one of the techniques that have been used popularly in this area is artificial neural network. The novelty of neural network is its ability to model a 1 nonlinear system without prior assumptions about the nature of the system.
It is useful in financial domain where there are a lot of assumptions and people know a little about the nature of asset prices [21]. Using back propagation algorithm, the network can be trained with available data to model an arbitrary system. The trained network is then used to predict the prices in the future. White (1988) [23] is the first researcher who used neural networks to predict IBM daily stock returns.
Since then a lot of works have tried to predict the stock price using neural networks [1, 4, 11-14, 17, 22, 24, 25]. They have shown the predictability of the market as well as the superiority of neural networks over traditional statistical methods. However, due to various difficulties in stock price forecasting (e. a selection of relevant inputs for a neural network in the forecasting), and limitations of the neural network itself (e.
a large dependence of network training on initial weights, a danger of over fitting), integrations of the neural network with other methods should be investigated. The objective of this research is to predict the Standard and Poor 500 (S&P 500) stock index one month in the future using computational intelligence approaches. The S&P 500 index is a composite index reflecting stock prices of 500 largest companies in the U. Neural networks are used as a main method to predict the stock price.
Moreover, other methods are also used to aid neural networks in the prediction. From a large set of available financial and economic variables, genetic algorithms are used to select a relevant subset of input variables for neural networks in the prediction of the stock price. Non-standard error functions with time and profit information in training neural networks, and ensembles of many neural networks are also studied to improve the prediction results. All the methods are verified on different data sets with different market characteristics.
The rest of this thesis is organized as follows. Chapter 2 describes the stock price forecasting problem, analyses of the research problem and the literature review. Chapters 3, 4 and 5 are the background about neural networks and neural network ensembles, genetic algorithms, and sensitivity analysis techniques, respectively. 2 Chapter 6 presents the methodology of the research: stock price forecasting using computational intelligence approaches.
The experiments of all methods are shown in Chapter 7. Finally, Chapter 8 is the study conclusion. 3 Chapter Two: Stock Price Forecasting Problem 2.1 Introduction to the Financial Market Stock is a share of ownership in a corporation. It can be bought and sold, usually on a stock exchange, and its owner could get a profit if the stock is sold at a price higher than what the owner paid for it previously.
An aggregate of stock prices such as the FTSE 100 in UK or the S&P 500 in USA measures the overall trends (rises or falls) of the most successful and largest companies in the market. What are the key factors which affect the market? It could be the economic factors, psychological factors or event factors. Usually the psychological and event factors are main reasons causing sudden changes in the market. The feelings of selling up all stocks of investors in the market caused by rumour could drive the prices down very quickly and sharply, and vice versa.