A Neural Network Model for Predicting Stock Market Prices at the Nairobi Securities Exchange
View/ Open
Date
2014Author
Wanjawa, Barack Wamkaya
Type
ThesisLanguage
enMetadata
Show full item recordAbstract
The Nairobi Securities Exchange (NSE) is a major player in the Kenyan financial sector,
dealing with both debt and equity. The entry capital in the equity sector is usually low, hence
allowing many ordinary Kenyans to invest in this sector. Investors rely on Stockbrokers to
undertake stock trade. Most Stockbrokers use technical, fundamental or time series analysis
when advising their clients. However, these methods do not usually guarantee good returns,
hence the need to provide Stockbrokers with a substitute predictive tool to guide their
decisions. Such a tool can be based on an artificial intelligence (AI) model that trains from
available stocks data, gains intelligence and then uses the acquired knowledge for predicting
future prices.
The research singled out Artificial Neural Network (ANN) as the basis for the model, after
considering various algorithms and their suitability for different problem domains. Through
experimentation, the project developed an ANN model, based on feedforward multi-layer
perceptron (MLP) with error backpropagation. The final model was of configuration
5:21:21:1 i.e. 5 inputs, with two hidden layers each having 21 neurons and 1 output.
To test the model, the research developed a prototype, based on C# programming language
and tested it on data of daily trades at the NSE compiled in the five-year period 2008-2012.
The holdout method was used for training and testing, with 80% data for training and the
balance 20% for testing. The results showed that the model was able to predict the future
trends of three chosen stocks correctly, with a Mean Absolute Percentage Error (MAPE) of
between 0.77% and 1.91%. The performance of the model was also validated by
comparative tests with other open sources tools (Neuroph and Encog) on the same NSE data,
where the comparative Root Mean Square Error (RMSE) were 1.83 (Prototype), 1.94
(Neuroph) and 2.85 (Encog) on one of the test stocks. The model was tested for applicability
to other markets by using data from the New York Stock Exchange, where it achieved a
MAPE of between 0.71% and 2.77% on three selected stocks in the same test period.
The results showed that ANN-based models can be used to develop low RMSE systems,
hence can be used in developing stock market prediction software. This project was done as
an ICT for development (ICT4D) initiative
Citation
Masters of Science in Information SystemsPublisher
University of Nairobi