USING NEURAL NETWORKS AND GENETIC ALGORITHMS TO PREDICT STOCK MARKET RETURNS
A THESIS SUBMITTED TO THE UNIVERSITY OF MANCHESTER FOR THE DEGREE OF MASTER OF SCIENCE IN ADVANCED COMPUTER SCIENCE IN THE FACULTY OF SCIENCE AND ENGINEERING
By Efstathios Kalyvas
Department Of Computer Science
Contents
Abstract 6
Declaration 7
Copyright and Ownership 8
Acknowledgments 9
1 Introduction 11
1.1 Aims and Objectives........................................................................................ 11
1.2 Rationale......................................................................................................... 12
1.3 Stock Market Prediction.................................................................................. 12
1.4 Organization of the Study................................................................................ 13
2 Stock Markets and Prediction 15
2.1 The Stock Market ............................................................................................ 15
2.1.1 Investment Theories..................................................................................... 15
2.1.2 Data Related to the Market.......................................................................... 16
2.2 Prediction of the Market.................................................................................. 17
2.2.1 Defining the prediction task......................................................................... 17
2.2.2 Is the Market predictable?........................................................................... 18
2.2.3 Prediction Methods ..................................................................................... 19
2.2.3.1 Technical Analysis............................................................................... 20
2.2.3.2 Fundamental Analysis ......................................................................... 20
2.2.3.3 Traditional Time Series Prediction ...................................................... 21
2.2.3.4 Machine Learning Methods ................................................................. 23
2.2.3.4.1 Nearest Neighbor Techniques ...................................................... 24
2.2.3.4.2 Neural Networks .......................................................................... 24
2.3 Defining The Framework Of Our Prediction Task ........................................... 35
2.3.1 Prediction of the Market on daily Basis....................................................... 35
2.3.2 Defining the Exact Prediction Task ............................................................. 37
2.3.3 Model Selection........................................................................................... 38
2.3.4 Data Selection............................................................................................. 39
3 Data 41
3.1 Data Understanding........................................................................................ 41
3.1.1 Initial Data Collection................................................................................. 41
3.1.2 Data Description......................................................................................... 42
3.1.3 Data Quality ............................................................................................... 43
3.2 Data Preparation ............................................................................................ 44
3.2.1 Data Construction....................................................................................... 44
3.2.2 Data Formation........................................................................................... 46
3.3 Testing For Randomness ................................................................................. 47
3.3.1 Randomness ................................................................................................ 47
3.3.2 Run Test ...................................................................................................... 48
3.3.3 BDS Test ..................................................................................................... 51
4 Models 55
4.1 Traditional Time Series Forecasting ............................................................... 55
4.1.1 Univariate and Multivariate linear regression............................................. 55
4.1.2 Use of Information Criteria to define the optimum lag structure.................. 57
4.1.3 Evaluation of the AR model ......................................................................... 58
4.1.4 Checking the residuals for non-linear patters .............................................. 60
4.1.5 Software...................................................................................................... 61
4.2 Artificial Neural Networks .............................................................................. 61
4.2.1 Description ................................................................................................. 61
4.2.1.1 Neurons............................................................................................... 62
4.2.1.2 Layers ................................................................................................. 62
4.2.1.3 Weights Adjustment ............................................................................. 63
4.2.2 Parameters Setting ...................................................................................... 72
4.2.2.1 Neurons............................................................................................... 72
4.2.2.2 Layers ................................................................................................. 72
4.2.2.3 Weights Adjustment ............................................................................. 73
4.2.3 Genetic Algorithms...................................................................................... 74
4.2.3.1 Description.......................................................................................... 74
4.2.3.2 A Conventional Genetic Algorithm ...................................................... 74
4.2.3.3 A GA that Defines the NN’s Structure .................................................. 77
4.2.4 Evaluation of the NN model......................................................................... 81
4.2.5 Software...................................................................................................... 81
5 Experiments and Results 82
5.1 Experiment I: Prediction Using Autoregressive Models................................... 82
5.1.1 Description ................................................................................................. 82
5.1.2 Application of Akaike and Bayesian Information Criteria............................ 83
5.1.3 AR Model Adjustment.................................................................................. 84
5.1.4 Evaluation of the AR models........................................................................ 84
5.1.5 Investigating for Non-linear Residuals ........................................................ 86
5.2 Experiment II: Prediction Using Neural Networks .......................................... 88
5.2.1 Description ................................................................................................. 88
5.2.2 Search Using the Genetic Algorithm............................................................ 90
5.2.2.1 FTSE ................................................................................................... 92
5.2.2.2 S&P................................................................................................... 104
5.2.3 Selection of the fittest Networks ................................................................. 109
5.2.4 Evaluation of the fittest Networks .............................................................. 112
5.2.5 Discussion of the outcomes of Experiment II ............................................. 114
5.3 Conclusions .................................................................................................. 115
6 Conclusion 118
6.1 Summary of Results....................................................................................... 118
6.2 Conclusions .................................................................................................. 119
6.3 Future Work.................................................................................................. 120
6.3.1 Input Data................................................................................................. 120
6.3.2 Pattern Detection ...................................................................................... 121
6.3.3 Noise Reduction ........................................................................................ 121
Appendix I 122
Appendix II 140
References 163
Abstract
In this study we attempt to predict the daily excess returns of FTSE 500 and S&P 500
indices over the respective Treasury Bill rate returns. Initially, we prove that the excess
returns time series do not fluctuate randomly. Furthermore we apply two different types
of prediction models: Autoregressive (AR) and feed forward Neural Networks (NN) to
predict the excess returns time series using lagged values. For the NN models a Genetic
Algorithm is constructed in order to choose the optimum topology. Finally we evaluate
the prediction models on four different metrics and conclude that they do not manage to
outperform significantly the prediction abilities of naï ve predictors.
附件列表