Upload
others
View
0
Download
0
Embed Size (px)
Citation preview
DEVELOPMENT OF SENTAMAL: A SENTIMENT ANALYSIS MACHINE
LEARNING HYBRID FOR PREDICTING STOCK MARKETS
by
SHERRENE BOGLE
(Under the Direction of WD Potter)
ABSTRACT
The Jamaica Stock Exchange (JSE) has been defined by Standard and Poor's as a
frontier market. It has undergone periods where trading gains exceeded that of major
markets such as the London Stock Exchange. The randomness of the JSE was
investigated over the period 2001 - 2014, using statistical tests and the Hurst exponent to
reveal periods when the JSE did not follow a random walk. This dissertation focuses on
machine learning algorithms including decision trees, neural networks and support vector
machines used to predict the JSE. Selected algorithms were applied to trading data over a
22 month period for price and trend forecasting and a 12-year period for volume
forecasts. Experimental results show 90% accuracy in the movement prediction with
mean absolute error of 0.4 and 0.95 correlation coefficient for price prediction. Volume
predictions were enhanced by a discretization method and support vector machine to
yield over 70% accuracy.
Being aware of the rapid impact social media comments have in the past had on
stock markets, we decided to develop a model that incorporated social media input. This
dissertation investigates the sentiments expressed on the social media platform Twitter
and their predictive impact on the Jamaica Stock Exchange. A hybrid predictive model of
sentiment analysis and machine learning algorithms including decision trees, neural
networks and support vector machines are used to predict the Jamaica Stock Exchange.
The architecture created, SentAMaL, investigated the impact of sentiments on medical
marijuana legalization on relevant stock indices. Due to the unstructured nature of tweets,
a customized pre-processing routine was developed prior to determining sentiment and to
perform the prediction. Experimental results show 87% accuracy in the movement
prediction and a 0.99 correlation coefficient and reduced mean absolute error of 0.2 for
price prediction.
INDEX WORDS: machine learning, stock prediction, pre-processing, sentiment
analysis, Jamaica
DEVELOPMENT OF SENTAMAL: A SENTIMENT ANALYSIS MACHINE
LEARNING HYBRID FOR PREDICTING STOCK MARKETS
by
SHERRENE BOGLE
BSc., University of Technology, Jamaica, 2002
MSc., University of the West of England, United Kingdom, 2005
A Dissertation Submitted to the Graduate Faculty of the University of Georgia in Partial
Fulfillment of the Requirements for the Degree
DOCTOR OF PHILOSOPHY
ATHENS, GEORGIA
2015
© 2015
SHERRENE BOGLE
All Rights Reserved
DEVELOPMENT OF SENTAMAL: A SENTIMENT ANALYSIS MACHINE
LEARNING HYBRID FOR PREDICTING STOCK MARKETS
by
SHERRENE BOGLE
Major Professor: Walter Potter
Committee: Tianming Liu
Budak Arpinar
Khaled Rasheed
Electronic Version Approved:
Suzanne Barbour
Dean of the Graduate School
The University of Georgia
December 2015
iv
DEDICATION
To my parents: Mr. and Mrs. Icah and Janet Bogle
v
ACKNOWLEDGEMENTS
I thank everyone that helped to make this venture a success. The journey has been
challenging and many hurdles have been encountered along the way. Special thanks to
my major professor Don Potter and members of my committee: Tianming Liu, Budak
Arpinar and Khaled Rasheed.
The journey was jump started by a LASPAU Faculty Fulbright scholarship from the US
Embassy in Jamaica. Without that scholarship, this degree and dissertation may not have
begun.
vi
TABLE OF CONTENTS
Page
ACKNOWLEDGEMENTS ................................................................................................ v
LIST OF TABLES ............................................................................................................. ix
LIST OF FIGURES ......................................................................................................... xii
CHAPTER 1: INTRODUCTION ........................................................................................1
1.1 Background of the Problem....................................................................................... 1
1.2 Statement of the Problem .......................................................................................... 2
1.3 Purpose of the Study ................................................................................................. 3
1.4 Research Hypotheses................................................................................................. 3
1.5 Importance of the Study ............................................................................................ 3
1.6 Scope of the Study..................................................................................................... 4
1.7 Definition of Terms ................................................................................................... 5
1.8 Contribution .............................................................................................................. 6
1.9 Summary ................................................................................................................... 7
CHAPTER 2: LITERATURE REVIEW .............................................................................9
2.1 Introduction ............................................................................................................... 9
2.2 Historical Overview of Stock Predictions ............................................................... 11
2.3 Overview of Major Global Stock Exchanges .......................................................... 12
2.4 Negative Stock Indicators ....................................................................................... 15
2.5 Forecasting Methods used by Jamaican Financial Firms ........................................ 18
vii
2.6 Stock Theories: Random Walk and the Efficient Market Hypothesis .................... 19
2.7 Overview of Financial Forecasting Approaches ..................................................... 22
2.8 Statistical approaches .............................................................................................. 22
2.9 Machine Learning Approaches ............................................................................... 24
2.10 Case Studies ....................................................................................................... 33
2.11 Statistical Approaches versus Machine Learning Methods .................................. 38
2.12 Summary ............................................................................................................... 38
CHAPTER 3: SURVEY OF SEMANTIC WEB ARCHITECTURES FOR STOCK
PREDICTION ....................................................................................................................41
3.1. Sentiment Analysis for Stock Prediction ........................................................... 41
3.2. Semantic Web Architectures .............................................................................. 45
3.3. Summary ............................................................................................................ 48
CHAPTER 4: METHODOLOGY .....................................................................................49
4.1. Research Design ................................................................................................. 49
4.2 Description of SentAMaL ....................................................................................... 53
4.3 Assumptions of the Study ....................................................................................... 57
4.4 Limitations of the Study .......................................................................................... 57
4.5 Summary ................................................................................................................. 57
CHAPTER 5: RANDOM WALK TEST ...........................................................................58
5.1 Background ............................................................................................................. 58
5.2 Tests of Randomness ............................................................................................... 59
5.3 Results ..................................................................................................................... 60
5.4 Hurst Exponent & Periods of Predictability ............................................................ 85
5.5 Analysis of Results .................................................................................................. 92
5.6 Summary ................................................................................................................. 93
viii
CHAPTER 6: EXPERIMENTAL RESULTS I - Statistical vs Machine Learning Methods94
6.1 Introduction ............................................................................................................. 94
6.2 Results ..................................................................................................................... 97
6.3 Analysis of Results ................................................................................................ 100
6.4 Conclusion/Summary ............................................................................................ 103
6.5 Confusion Matrices ............................................................................................... 104
6.6 Acknowledgment .................................................................................................. 105
CHAPTER 7: EXPERIMENTAL RESULTS II SentAMaL- A Sentiment Analysis
Machine Learning Stock Predictive Model .....................................................................106
7.1 Overview ............................................................................................................... 106
7.2 Results ................................................................................................................... 106
7.3 Conclusion ............................................................................................................. 108
7.4 Acknowledgment .................................................................................................. 109
CHAPTER 8: CONCLUSION ........................................................................................110
8.1 Major Contributions .............................................................................................. 110
8.2 Hypotheses ............................................................................................................ 111
8.3 Future Study /Recommendation ............................................................................ 112
BIBLIOGRAPHY ............................................................................................................114
APPENDIX ......................................................................................................................121
A: INTERVIEW QUESTIONS .................................................................................. 122
ix
LIST OF TABLES
Page
Table 2.1 Selected Sovereign States, Stock Market Type and their S&P Rating .....16
Table 2.2 Summary of Stock Forecasting Studies.....................................................40
Table 5.1 Statistical comparison of CAR closing prices vs differences .................62
Table 5.2 Runs Test for CAR stock prices 2001-2009 .............................................62
Table 5.3 Statistical comparison of CCC closing prices vs difference....................63
Table 5.4 Runs Test for CCC stock prices 2001-2009 .............................................64
Table 5.5 Statistical comparison of DG closing prices vs differences....................66
Table 5.6 Runs Test for DG stock prices 2001-2009 ...............................................66
Table 5.7 Statistical comparison of GK closing prices vs differences ....................68
Table 5.8 Runs Test Results for GK stock prices 2001-9 .......................................68
Table 5.9 Statistical comparison of GLNR closing prices vs differences ...............70
Table 5.10 Runs Test for GLNR stock prices 2001-2009 ..........................................70
Table 5.11 Statistical comparison of JBG closing prices vs differences ...................72
Table 5.12 Runs Test for JBG stock prices 2001-2009 ..............................................72
Table 5.13 Statistical comparison of JMMB closing prices vs differences ...............73
Table 5.14 Runs Test for JMMB stock prices 2001-2009 ..........................................74
Table 5:15 Statistical comparison of JP closing prices vs differences ......................75
Table 5.16 Runs Test for JP stock prices 2001-2009 .................................................76
Table 5.17 Statistical comparison of LIME closing prices vs differences ................77
x
Table 5.18 Runs Test for LIME stock prices 2001-2009 ............................................78
Table 5.19 Statistical comparison of NCB closing prices vs differences ..................79
Table 5.20 Runs Test Results for NCB stock prices 2001-9 .....................................80
Table 5.21 Runs Test Results for CAR stock prices 2010-14 ....................................81
Table 5.22 Runs Test Results for CCC stock prices 2010-14 ...................................81
Table 5.23 Runs Test Results for DG stock prices 2010-14 .....................................82
Table 5.24 Runs Test Results for GK stock prices 2010-14 .....................................82
Table 5.25 Runs Test Results for GLNR stock prices 2010-14 .................................83
Table 5.26 Runs Test Results for JBG stock prices 2010-14 .....................................83
Table 5.27 Runs Test Results for JMMB stock prices 2010-14 ................................84
Table 5.28 Runs Test Results for JP stock prices 2010-14 ........................................84
Table 5.29 Runs Test for LIME stock prices 2010-2014 ............................................85
Table 5.30 Runs Test for NCB stock prices 2010-2014 .............................................85
Table 5.31 Runs Test Results for CAR stock prices 2001-4......................................89
Table 6.1 Price Prediction of Various Companies on the JSE...................................95
Table 6.2 Movement prediction of various indices of all and main JSE index........97
Table 6.3 Movement prediction of JSE Select (2), All Jamaican Composite (3),
Cross Listed Index(4), Junior Market Index(5), Combined Index (6) and
US Equities Index (7)...............................................................................97
Table 6.4 JMMB Select Blue Chip stocks................................................................99
Table 6.5 Categories of Volume Indices..................................................................101
Table 6.6 Results of Ten Blue Chip Company Volume Predictions using Neural
Networks with Tenfold Cross Validation.............................................102
xi
Table 6.7 Volume Predictions of Blue Chip Companies Using SMO SVM
Polykernel................................................................................................102
Table 6.8 Confusion matrix for CCC.......................................................................104
Table 6.9 Confusion matrix for Grace Kennedy Conglomerate.............................104
Table 6.10 Confusion matrix for Jampro Conglomerate..........................................105
Table 7.1 Price Prediction of All Companies on the JSE........................................107
Table 7.2 Price Prediction of Drug Related Companies on the JSE......................107
Table 7.3 SentAMaL Movement prediction of various JSE indices ......................108
xii
LIST OF FIGURES
Page
Figure 3.1 Stockwatcher architecture, Micu et al........................................................46
Figure 3.2 Architecture of a news based stock prediction system, Nikfarjam et al...46
Figure 3.3 AZFinText System, Schumaker et al .......................................................47
Figure 4.1 Architectural Diagram of SentAMaL........................................................53
Figure 4.2 Tweet Cleaning Function Code Snippet ...................................................55
Figure 4.3 Samples of Tweets Cleaned using R Programming Application.............55
Figure 5.1 Scatter Plot of CAR closing prices...........................................................61
Figure 5.2 Scatter Plot of CAR differences in closing prices....................................62
Figure 5.3 Scatter Plot of CCC closing prices...........................................................63
Figure 5.4 Scatter Plot of CCC differences in closing prices....................................64
Figure 5.5 Scatter Plot of DG closing prices.............................................................65
Figure 5.6 Scatter Plot of DG differences in closing prices......................................66
Figure 5.7 Scatter Plot of GK closing prices.............................................................67
Figure 5.8 Scatter Plot of GK differences in closing prices....................................68
Figure 5.9 Scatter Plot of GLNR closing prices.......................................................69
Figure 5.10 Scatter Plot of GLNR differences in closing prices................................70
Figure 5.11 Scatter Plot of JBG closing prices...........................................................71
Figure 5.12 Scatter Plot of JBG differences in closing prices..................................72
Figure 5.13 Scatter Plot of JMMB closing prices.........................................................73
xiii
Figure 5.14 Scatter Plot of JMMB differences in closing prices.................................74
Figure 5.15 Scatter Plot of JP closing prices..............................................................75
Figure 5.16 Scatter Plot of JP differences in closing prices........................................76
Figure 5.17 Scatter Plot of LIME closing prices.........................................................77
Figure 5.18 Scatter Plot of LIME differences in closing prices.................................78
Figure 5.19 Scatter Plot of NCB closing prices............................................................79
Figure 5.20 Scatter Plot of NCB differences in closing prices.....................................80
Figure 5.21 Hurst Exponent of NCB closing prices for 2008......................................86
Figure 5.22 Hurst Exponent of LIME closing prices for 2001...................................87
Figure 5.23 Hurst Exponent of LIME closing prices for 2002....................................87
Figure 5.24 Hurst Exponent of LIME closing prices for 2003....................................88
Figure 5.25 Hurst Exponent of LIME closing prices for 2004....................................88
Figure 5.26 Scatter plot of CAR over the sub-period 2001-2004...................................89
Figure 5.27 Hurst Exponent of CAR closing prices for 2002......................................90
Figure 5.28 Hurst Exponent of CAR closing prices for 2004.......................................91
Figure 5.29 Hurst Exponent on close prices for the GLNR stock in 2002 ...................92
1
CHAPTER 1: INTRODUCTION
This chapter outlines the background for the problem, purpose of the study, research
hypotheses and defines a few finance terms that will be used throughout the paper.
1.1 Background of the Problem
Legislation for the Jamaican dollar (J$) was passed in 1968 and the currency went into
circulation the following year. The Jamaica Stock Exchange (JSE) was incorporated as a
private limited company in August 1968 and the stock market began operations in
February 1969. Currently, the exchange rate for the Jamaican dollar to the US dollar is
119:1.
The JSE is an auction type of market. It has an electronic communication network (ECN)
where brokers are identified by an identification number. Naked access trading- a
controversial trading practice via high speed traders where they often do not know the
identity of the firms using sponsored access since the only way to identify the firm is
through computer code- is not permitted.
For a company's securities to be listed on the JSE, the minimum requirements noted by
JSE (2011) are:
• Total issued share and loan capital of at least $200,000; the share capital portion
being at least $100,000.
2
• In the case of ordinary shares, a minimum of 100 shareholders holding in their
own right not less than 20% of the issued ordinary capital (such percentage being
not less than $50,000 nominal value) excluding the holding of at least one
controlling share.
Companies that are registered in Jamaica are listed by one of the following methods:
• Prospectus Issue: an offer to the public, by or on behalf of a company at a fixed
price.
• Offer for Sale: an offer to the public, by or on behalf of a third party at a fixed
price.
• Offer by Tender: an offer to the public, by or on behalf of a company or a third
party by tender.
• Placing: an offer through broker-members of the Exchange to sell the securities of
a company to the public.
• Introduction: where none of the company's securities is being offered to the
public.
1.2 Statement of the Problem
This study addresses the problem of predicting stock movement and prices on the JSE
index, which is a minor or frontier market. Stock prediction and analysis is an interesting
century old problem that keeps evolving. Predicting stocks is a challenging problem
because it is not an exact science and patterns are not necessarily consistent. Therefore,
we cannot always make correct inferences from them. Among financial markets, stocks
have been perceived as the most glamorous and yet the least understood. While many
3
articles and books prior to the 1990s have suggested that it is easy for individual investors
to apply simple rules and make substantial returns, the scientific literature suggests
otherwise. Lorie, Dodd and Kimpton (1985) outlines why simple investing rules alone
cannot be expected to produce significant gains. The lengths of historical data to factor in
or the impact an event will have on the market are not known for certainty, not even by
stock experts.
1.3 Purpose of the Study
This study aims to analyze and predict the blue chip stocks trading on JSE. It will
determine the best machine learning (ML) hybrid model that can be used to predict future
stocks. A hybrid ML model, SentAMaL, is proposed that utilizes both machine learning
algorithms and sentiment analysis from relevant tweets, along with historical data to
predict stock prices and movement.
1.4 Research Hypotheses
JSE main index follows a random walk.
Machine learning approaches are superior to statistical approaches for forecasting
JSE data.
Hybrid machine learning approaches are more accurate than individual ones.
1.5 Importance of the Study
It has been posited that Jamaica’s macroeconomics differs from the rest of the world.
This study will be the first published work on applying machine learning approaches to
the JSE data. Previous studies have used economic and statistical approaches for the first
4
twenty years of trading. This study will be based on selected time periods from the 46
years of trading and seeks to create a hybrid model of the long term trades that can be
used for future forecasts. Given Jamaica’s struggling economy, with current debt at 140%
of GDP based on IMF calculations (Jamaica Gleaner, 2012), if the market is accurately
predicted, investors stand to reap maximum earnings and this could help stimulate growth
in the economy as well as attract more external investors.
There is value in studying the JSE as although it is not a major market, there have been
periods when it has outperformed London and New York markets such as 1981-1985
(Kitchen, 1986). The JSE also performed well in 1992. At the end of trading on
December 29, market capitalization grew 245 percent over the previous year, closing at
US$3.45 billion. In 1992, it was ranked among the top ten world equity markets by the
International Finance Corporation based on performance of the common index in 1991
(Agbeyegbe, 1994) .
1.6 Scope of the Study
The study analyzed 14 years of historical data and used selected five to twelve year
periods, to test the hypotheses and predict movement, price and volume of selected
indices on the JSE.
This study assumes that the market is weak form, based on the efficient market
hypothesis, defined in the next section.
5
1.7 Definition of Terms
Efficient market theory states that it is practically impossible to infer a long term global
forecasting model from historical stock trading data, that is, the price determination for
each economic variable is a random walk (Kovalerchuk & Vityaev, 2000).
Efficient market hypothesis
The three versions of the efficient market hypothesis are defined by Bodie, Kane and
Marcus (2011) below:
Weak form stock prices already reflect all information that can be derived by
examining market trading data.
In Semi-strong form hypothesis, all publicly available information as it relates to
the future prospects of the firm must be already reflected in the stock price.
In Strong form hypothesis, the stock price reflects all information relevant to the
firm, including information that is available only to company insiders.
ECN – a computer operated trading network offering an alternative to formal stock
exchanges or dealer markets for trading securities. It allows participants to post market
and limit orders over the network where the limit book order is available to all traders.
Price weighted average – It is a stock index in which each stock influences the index in
proportion to its price per share. It is computed by adding the prices of each of the stocks
in the index and dividing them by the total number of stocks. Higher price stocks are
given more weight and therefore will have a greater influence on the performance of the
index such as the Dow Jones Industrial Average.
Market weighted average - This is also called capital weighted index. It is a stock index
calculated by the weighted average of the returns of each security in the index such that
6
the weights are proportional to its market value. Examples include NASDAQ Composite
Index, S&P 500 and Wilshire 5000 Equity Index.
Beta rating – This measures the risk of a stock in relation to the market. The market’s
beta value is set at one. If a stock’s beta is above one (1), it means the stock’s volatility is
greater than the market. For example, a stock issued with a beta of 1.25 has a level of
volatility 25% greater than the market average, and would be considered slightly risky.
1.8 Contribution
Although the JSE is a frontier market, there have been periods when it has outperformed
the London and New York markets such as 1981-1985 (Kitchen, 1986). Previous studies
on the JSE have only used statistical approaches to test the efficiency of the JSE in
relation to the efficient market hypothesis (EMH). Agbeyegbe (1994) used the serial
correlation of stock returns to test efficiency of the JSE while Kitchen (1986) gave a
historical analysis of the market between 1969 and 1985 focusing on returns with
associated risk as per beta coefficient in comparison with the US and UK markets. Koot,
Miles & Heitmann (1989) tested for randomness of returns in the earlier years. Chapter
five identifies periods of randomness between 2001 and 2014 for which no previous
studies were found.
The experimental results in this study, detailed in Chapter six, have far exceeded those of
the statistical models used in previous works which did not focus on prediction accuracy.
This study will be the first published work on applying machine learning approaches to
the JSE data (Bogle & Potter, 2015a). It shows that supervised learning algorithms such as
7
SVM and ANN are more accurate than generic statistical models such as regression and
presents a more accurate stock prediction model on the JSE dataset (JSE, 2011).
Social media is inherently assistive in predicting stock trading volumes since it captures
the views of many within the population and tweets and posts often go viral in very
miniature increments of time. While studies such as Koot, Miles, & Heitmann, (1989) and
Merton (1995) show that volume shifts can be correlated with price movements, text
mining prediction studies have not generally focused on the regression problem of
predicting prices. Also, while social data have been used to predict economical outcomes
in studies such as Kovalerchuk & Vityaev (2000), these predictions are not in the context
of financial markets. The SentAMaL architecture developed in this study is a hybrid of
sentiment analysis and machine learning techniques used for stock prediction. The
SentAMaL architecture and experimental results are detailed in Chapter seven (Bogle &
Potter, 2015b).
1.9 Summary
This chapter outlined the background of the JSE, research hypotheses, contribution and
scope of the study. Chapter two will examine a survey of the literature including an
overview of global stock markets and exchanges and case studies of non-ML approaches
used for predicting the JSE and ML approaches used in predicting comparable stock
exchanges such as those in Karachi, Pakistan and Amman, Jordan. Chapter three gives a
survey of related literature on semantic web architectures for stock prediction. Chapter
four focuses on the methodology and outlines the research design, tools and analysis
methods that were used in the study. Chapter five uses the Hurst exponent to identify
8
periods of predictability and performs random walk test on a 14 year dataset. Chapter six
compares a variety of statistical and machine learning algorithms. It also utilized the
discretization method to improve the prediction accuracy. Chapter seven details the
SentAMaL architecture which accepts qualitative input in the form tweets as well as
quantitative factors to predict movement and prices. Chapter eight summarizes the main
contributions of this research and gives recommendations for future study.
9
CHAPTER 2: LITERATURE REVIEW
This section gives a general introduction to the stock market, basic concepts and major
theories; a historical background of prediction methods used; an overview of global stock
market and indices and describes where the JSE falls in the context of global and
emerging markets. It will outline general forecasting methods used in stock prediction,
give a comprehensive review of machine learning methods and hybrid approaches used to
predict other stock exchanges, and appraise their strengths and weaknesses.
2.1 Introduction
There are four types of markets for trading financial assets of which the stock market is
the most popular. 1) Stocks, also called equities, have been the financial asset that
historically has gained the highest yield. The other types of financial assets are 2) fixed
income: such as bonds, 3) money market: such as treasury bills and 4) derivatives which
include options and future contracts (Bodie et al, 2011). Historically, stocks have been
perceived as the most attractive and yet the least understood among financial markets.
Prior to the 1990s it was believed that it was easy for individual investors to apply simple
rules and make substantial returns. However, the scientific literature suggests otherwise
(Lorie, Dodd & Kimpton, 1985). Although time series analysis methods are used to
10
predict the stock market, they are not a panacea for gaining a fortune in the short or even
long term.
Kovalerchuk and Vityaev (2000) highlight the unpredictability of the stock market by
citing Mark Twain’s 1984 aphorism of the January stock calendar effect. Twain said
October. This is one of the peculiarly dangerous months to speculate stocks…The others
are July, January , September, April, November, May, March, June December August
and February (p 1)
Similarly, Burton suggested that a blindfolded monkey throwing darts at a newspaper's
financial pages was just as effective in selecting a portfolio as the experts (Kuepper,
2011). While historical data can improve prediction accuracy, the stock market remains
difficult to predict and while patterns may be detected with the aid of statistical and
computing tools, interpretation of the patterns is a challenging task even with economic,
financial and scientific forecasting and time series experts.
Studies in technical analysis and forecasting of the stock market have been more
successful in identifying trends which is much easier than forecasting prices
(Kovalerchuk & Vityaev, 2000). While trend prediction can bring capital gains, the
ability to forecast future prices with significant accuracy is crucial to being able to
maximize on those gains.
The volatility of the stock market is due to its susceptibility to a variety of qualitative and
quantitative factors. Qualitative factors include political events such as elections and
coup, global recession and firms’ policies. Stock variables such as open rate, close rate,
high rate and low rate for individual stocks are among quantitative factors that impact the
equities market (Padhiary & Mishra, 2011).
11
Lorie, Dodd and Kimpton (1985) state three major determinants of stock prices: the
expected level of earnings, the degree of investor uncertainty in estimating what future
earnings will be and the rate at which a prospective stream of certain earnings is
discounted to reflect its present value.
2.2 Historical Overview of Stock Predictions
Due to the impact of time and uncertainty on the financial markets, predictions are at best
a good estimate and accuracy cannot be validated until the time has elapsed. Prior to the
1960s, mathematical models were not used extensively in financial forecasting. The
historically low volatility in the period, steady rise of the stock market after the
depression, stable interest rates and fixed foreign exchange rates created a relatively
simple market environment where old rules of thumb and simple regression models were
used. Qualitative factors such as double digit inflation and interest rates in the US, world
oil price crisis in the Middle East and a major stock decline in 1973/4 led to more robust
forecasting methods being used in the 1970s (Merton, 1995). The proliferation of
computers, the World Wide Web, low cost memory and processors, further developed the
electronic trading platforms and increased the development and utilization of data mining
methods for analysis.
The Capital Asset Pricing Model by Sharpe and Lintner in 1964/5 became the
quantitative model for measuring the risk of a security and the benchmark for appraising
investment performance of professional money managers. While the mathematics of the
model is precise, the models are imprecise, and merely an approximation to the complex
real world (Merton, 1995). This means that a qualitative approach is often useful to
complement or explain a quantitative model.
12
2.2.1 Challenges of Stock Predictions
Knowledge representation framework is important to the success of data mining for stock
trends and predictions. It requires proper problem formulation and effective
representation to enable learning and reduce intractability (Kovalerchuk & Vityaev,
2000). A good knowledge representation framework will include background knowledge
such as qualitative factors, complex real world data and hybrid systems to leverage the
advantage of multiple approaches while eliminating their shortfalls.
An accurate framework is a challenging task given the vulnerability of the stock market.
Predicting market volatility has traditionally been done by scientific methods including
K-line diagram analysis, point data diagram and moving average convergence. Yet, it has
also been done by less robust methods including coin tossing and fortune telling (Yu &
Shaorong, 2010).
2.3 Overview of Major Global Stock Exchanges
Bodie et al (2011) outline the major stock averages and indices in the US market and the
wider world. The United States has the largest market globally. It includes the Dow Jones
Industrial Average (DJIA), National Association of Securities Dealers (NASDAQ), New
York Stock Exchange (NYSE), Standard and Poor’s Composite (S&P 500) and Wilshire
5000.
The NYSE is the largest stock exchange in the USA. The DJIA, often shortened to the
DOW, is a price weighted average for 30 large blue chip companies in the USA.
13
Standard and Poor’s Composite (S&P 500) is a more broadly based market weighted
index of 500 firms. It was first published in 1957 and is often viewed as the best single
measure of the performance of equities from large corporations.
The National Association of Securities Dealers (NASDAQ) lists about 3,200 firms and
offers three listing options. They are the NASDAQ Global Select market, the NASDAQ
Global market and the NASDAQ Capital market in decreasing tier order. The Capital
market has the least stringent requirements and disclosures. As company earnings and
liquidity decrease, they may be downgraded to the next tier. As earnings increase, they
may reapply for an upgrade to the Global market, or Global Select market.
Wilshire 5000 index is the broadest index of US equities and now includes over 6000
actively traded stocks. It is a comprehensive index that includes most US companies that
trade equities.
London, Euronext and Tokyo are three of the largest non-US stock markets. Euronext is
the first integrated cross-border exchange, combining the major stock exchanges of
Belgium, France, Netherlands, Portugal, and the United Kingdom into a single market.
Euronext is an alliance with the NYSE designed to compete against the London Stock
Exchange. TOPIX is the chief Tokyo stock exchange price index.
2.3.1 Stock Indexes versus Stock Averages
Indexes are generally composed of more stocks than averages, and the stocks represent
greater business diversity. Dalton (1993) lists several other widely used indexes. The
indexes indicate the trend of economic activity of specific companies as well as among
groups of companies.
14
2.3.2 Emerging Markets
The JSE is a minor market on the global trading exchange. Jamaica has a population of
2.7 million, so its market is very small. It is not among the list of top 23 developed
markets and 25 emerging market exchanges published by Morgan Stanley Capital
International (MSCI). Of the 25 emerging markets, six countries are from Latin America.
They are Argentina, Brazil Chile, Colombia, Mexico and Peru.
2.3.3 S & P Frontier Broad Market Index
Frontier markets have been described as investable markets with lower market
capitalization and liquidity than emerging markets. They are characterized by high, long
term returns and low correlations with other markets. The JSE outperforming London and
NY markets during the period 1981-1985, shows the potential of high rewards in frontier
markets, despite the assertions of the efficient market hypothesis (EMH).
Jamaica is listed among 37 frontier markets designated by Standard & Poor’s. Others
include: Jordan, Qatar, Pakistan, Slovakia, Trinidad and Tobago, Argentina, Tunisia and
UAE. Previous studies on Jordan and Pakistan are outlined in sections 2.10.4 and 2.10.6
respectively.
To contextualize the JSE in relation to other markets, Table 1 compares S&P ratings for
selected countries. No ratings were available for Iran. By mid 2015, Standard & Poor’s
upgraded Jamaica's rating to B with a stable outlook, while Greece was downgraded to a
CCC rating, with a negative outlook. This illustrates that although developed markets are
generally considered more stable and likely to repay creditors; debt default is possible
even in developed markets.
15
2.4 Negative Stock Indicators
Worldwide, there have been several instances where negligence, unfortunate
circumstance or auditing errors have led to larger corporations’ stock price falling rapidly
and in some cases eventually going bankrupt. For example, WorldCom overstated profits
of at least $3.8M by incorrectly classifying expenses as investments, Enron used “special
purpose entities” to move debt off its books, and the Italian dairy firm Parmalat had a
$4.8M bank account that didn’t exist (Bodie et al, 2011).
In Jamaica, Dyoll Insurance went down after Hurricane Ivan in 2004. While the major
damage to Jamaica was limited to specific sectors such as agriculture, the damage in the
Cayman Islands was much worse (Jamaica Gleaner, 2005). Being much flatter than
Jamaica, the entire island was flooded and all motor vehicles were damaged. The
company was negligent in renewing their contract on time, and the hurricane struck
during their uninsured period, leading them to make massive payouts from which they
could not recover (Jamaica Gleaner, 2011).
Other companies listed on the JSE that have gone bankrupt include former
telecommunications monopoly, LIME (a subsidiary of Cable & Wireless) , which had a
$15M negative equity figure and Carib Cement that incurred debt competing with
imported cement (S. Gooden, personal communication, 4th
June, 2012).
Over the years, some events have had a negative impact on stock trading. These include
major hurricanes such as Gilbert in 1988, Ivan in 2004 and Sandy in 2012. The damage
incurred by natural disasters resulted in the government having to increase spending
which usually has a negative impact on the market. The Jamaica Debt Exchange of 2010
created uncertainty which like any debt swap reduces investor confidence in the market.
16
Table 2.1 Selected Sovereign States, Stock Market Type and their S&P Rating
Country Type of Market S&P Rating for
Local Currency
S&P Rating for
Foreign Currency
S&P
T&C
Assessment
Japan (unsolicited
ratings)
Developed AA- AA- AAA
Korea Developed AA- A+ AA
Singapore(unsolicited
ratings)
Developed AAA AAA AAA
USA Developed AA+ AA+ AAA
Greece Developed CCC CCC AAA
China Emerging AA A+ AA
Turkey Emerging BBB- BB BBB-
Argentina
(unsolicited ratings)
Frontier B B B
Jamaica Frontier B- B- B
Jordan Frontier BB BB BBB-
Pakistan Frontier B- B- B-
Qatar Frontier AA AA AA+
Slovakia Frontier A A AAA
Trinidad &Tobago Frontier A A AA
According to Jamaica Gleaner (2012), the gains from the debt exchange were eroded with
increased public sector wage payments. This is a stance taken by the International
Monetary Fund (IMF).
Strikes usually have a negative impact on the market and when prolonged they have a
ripple effect impacting other sectors. Impending elections usually make the market quiet
as investors are reluctant to buy new stocks because of the uncertainty with regards to
possible change of government and fear of loose spending that will impact government
deficit and interest rates.
Other events such as an impromptu declared holiday in 1997 when Jamaica’s football
(soccer) team qualified for their first FIFA World Cup in France did not have much
influence on the stock market, although some businesses openly expressed
disappointment with the loss of a work day.
17
2.5.1 Proxy fights
Yahoo versus Microsoft: Carl Icahn, the billionaire investor, attempted to overthrow
Yahoo's board of directors in the hopes of brokering a buyout by Microsoft. Yahoo’s
share increased by 8% and Microsoft’s by 1%, the trading day after Icahn’s
announcement. In summer 2008, he dropped his proxy bid to replace Yahoo’s directors in
exchange for three seats on an expanded board.
There have been few instances of proxy fight in Jamaica similar to Carl Icahn in Yahoo
versus Microsoft. The largest involved Grace Kennedy, Lascelles and Kingston Wharves.
Two hundred million (200,000,000) Kingston Wharves stocks which were held by
Lascelles, a competitor of Grace Kennedy, was sold over the counter to Transocean
Shipping, the Jamaica Producers Group Pension Fund, Kingston Port Workers
Superannuation Fund, Shipping Association of Jamaica Property, Lannaman & Morris,
Jamaica Freight & Shipping Pension Fund, and Maritime & Transport.
The over-the-counter sale, capped more than $270 million or $1.35 per share, and was
sold at a discount of 30 cents per share below the previous day’s price on the Jamaica
Stock Exchange (JSE). Although over-the-counter sales of shares attracted transfer tax of
7.5 per cent as well as stamp duty, and those sold on the Stock Exchange attracted a total
levy of less than two per cent and are not subject to transfer tax, Lascelles mysteriously
took the more expensive route (Jamaica Gleaner, 2002). This did not please the Grace
Kennedy conglomerate- a major competitor of Lascelles.
Don Wehby, financial director of Grace Kennedy, questioned why Lascelles accepted 30
cents below the market on the shares when there were orders for $1.65 the previous day.
18
Grace owns 42 per cent of Kingston Wharves’ shares, so they were discontented.
However, Mr. McConnell, group managing director of Lascelles, said the company had
been in negotiations with potential buyers for some time and was prepared to accept a
discount based on the volume of the stocks. He further explained that they didn't want to
fragment the big block of shares and the sale was not conducted on the JSE at the request
of the purchasers.
2.5 Forecasting Methods used by Jamaican Financial Firms
In forecasting Blue Chip stocks, historical data for three to five years is usually used to
project one to three years. The forecasting methods employed by financial firms in
predicting the JSE main and combined indices are relatively simple. Most use a form of
annual earnings projection due to the small market as opposed to advanced statistical or
machine learning methods.
Jamaican companies have generally used a fundamental approach, focusing on the price-
earnings (P/E) ratio to value firms. The P/E ratio compares a stock’s price with the
company’s earnings per share. To illustrate: if a company makes $500,000 total profit,
and has one million shares issued and outstanding, its earnings will be ($500,000 / one
million shares) or 50 cents per share. If the stock is selling for $10, the P/E ratio becomes
$10 / 50c i.e. current market price / earnings per share, which equals 20:1. This ratio is
higher than average and would therefore be considered a growth stock. It implies that
earnings significantly outweigh current market price by 20 to 1 and the profit is expected
to increase as the company’s earning power grows over time.
19
A P/E ratio of 20 also implies that investors are willing to pay $20 for a claim on $1 of
earnings. This is because the stock price also reflects expected cash flows from future
earnings. A high P/E ratio can be due to significantly low earnings in a particular year
where investors expect a quick recovery or a general expectation of growth in future
earnings. P/E ratios are usually compared for companies in similar sectors (Parrino &
Kidwell, 2009).
Alternatively, markets may be on the rise and the stock is being swayed by a market up
trend. To evaluate a stock’s growth potential, investors also need to establish how much
of the ratio is due to the stock’s actual potential. Large, even profitable corporations tend
to have lower P/E ratios because their growth phase is almost over and the stock value
reflects actual current earnings as opposed to potential future gains (Dalton, 1993). In
the Jamaican context, large conglomerates like Grace Kennedy may have a lower P/E
ratio than newer companies because of relatively lower growth potential, although it
continues to expand and has some scope for future potential earnings growth as well.
2.6 Stock Theories: Random Walk and the Efficient Market Hypothesis
Due to the uncertainty in predicting stock prices based on the efficient market hypothesis
(EMH), stock prices are said to take a random walk. Therefore the EMH is also called the
Random Walk theory. To make big profits, brokerage firms and diligent individual
investors need to be able to predict prices relatively precisely in the short to medium term
(Dalton, 1993). While significant gains can be made from long term investments, it also
has a greater probability for a big loss.
20
The evidence on the random walk hypothesis in emerging markets has been two fold
(Kiani 2006). Studies such as Fama and French (1988), Porteba and Summers (1988) and
Bailey et al 1990 indicate a violation of the random walk hypothesis in emerging
markets. Conversely, later studies such as Divecha, Drach and Stefak (1992) and Wilcox
(1992) revealed that high volatility exists in stock returns in these markets, thus
upholding the hypothesis.
Studies have shown that the financial data market is not random and the efficient market
hypothesis is a subset of the chaotic market hypothesis (Kovalerchuk & Vityaev, 2000).
The efficient market hypothesis implies that it is futile to use historical data or public
economic forecasts to predict future security prices including stocks (Merton, 1995).
Mcqueen and Thorley (1991) used Markov chains to test the random walk hypothesis of
prices on the NYSE for the period 1947-1987. The hypothesis restricted the transition
probabilities of each state to equal, despite prior years. This restriction seems to influence
the nonrandom walk behavior of annual real returns. In the post war period it was found
that high returns followed runs of low returns and vice versa.
The efficient market theory also suggests that the job of market speculators is obsolete.
However, it is consistent in asserting that it is difficult to predict the market accurately in
a consistent manner. Therefore, the experts will be wrong at times and lose money for
both themselves and those they advise (Harding, 1995).
In the strictest sense, the EMH implies a study like the one proposed herein, is futile
unless the market is not efficient. It also asserts that the existing inefficiencies will not
last for a prolonged period, as the market will correct itself over time. Hence, the EMH
21
has been viewed skeptically by many researchers in the recent past (Padhiary & Mishra,
2011).
Skabar and Cloete (2001) used a genetic algorithm based weight optimization procedure
to train neural networks indirectly to determine buy and sell points for commodities
traded on the DJIA, Australian All Ordinaries, S&P 500 and the NASDAQ. The returns
from this approach were compared with returns achieved on random walk data derived
from each of the four series using a bootstrapping procedure. The bootstrapped samples
were similar distributions of daily returns as the original series lacked serial dependence.
It was shown that on the DJIA, the returns achieved on the four year testing period were
significantly greater than the randomized bootstrapped returns. This conflicts with the
EMH and proves that some financial series are not entirely random.
Other Stock theories:
The Dow Theory, outlined by Dalton (1993), states there are three types of price
movements in the stock market that are simultaneous:
3.1 Narrow movement: This represents day to day fluctuations.
3.2 Short swing: consisting of trends from two weeks to about one month.
3.3 The main movement: bull or bear, is the long term trend that lasts at least four years.
The theory is intended to mark trend reversals rather than predict trend duration. Given
the volatility of the market and the premise of the hypothesis, the experts and great
speculators will be those who are right most of the time and make a significant net gain.
22
2.7 Overview of Financial Forecasting Approaches
These include mathematical, economic and machine learning methods. Data mining
methods used for financial analysis and forecasting include regression, neural networks,
genetic algorithms, k-nearest neighbors, Markov chains, decision trees, univariate
models, hybrid methods and relational data mining (RDM) (Kovalerchuk & Vityaev,
2000). The learning paradigms used in machine learning approaches are neural networks,
classifier systems, instance based learning, genetic algorithms, rule induction paradigms
and analytical learning based on rules in first order such as prolog horn clauses.
2.7.1 Financial forecasting: fundamental analysis versus technical analysis
From a financial or economic perspective, there are two basic types of stock market
analysis: fundamentals and technical. Fundamental analysts also called fundamentalists
focus on economic variables to determine what to buy or sell. Technical analysts also
called chartists use bar charts, and point and figure charts to follow price movements
(Dalton, 1993). The P/E ratio used by Jamaica, outlined earlier, is a fundamentalist
approach. The other type of fundamental approach uses discounted cash analysis.
2.8 Statistical approaches
Statistical approaches include auto-regressive integrated moving average (ARIMA),
autoregressive–moving-average (ARMA), Bayesian analysis, exponential smoothing,
Kalman filters, regression, auto regressive conditional heteroscedastic models (ARCH),
generalized autoregressive conditional heteroskedasticity (GARCH), case based
reasoning, evolving least squares support vector machine (LSSVM) learning paradigm,
regime switching models, statespace models and VARIMA (Vector Auto-Regressive
23
Integrated Moving Average). Economic models include multiple regression and rolling
average models.
2.8.1 ARIMA
The ARIMA model applies the Box-Jenkins methodology in the model building process.
It is generally efficient but has shortcomings like correlation analysis, which is,
establishing correlation among variables doesn’t prove a cause and effect relationship
among the variables. There is consensus in the literature that some ARIMA models give
similar forecast to linear exponential smoothing methods. Hyndman proved that Simple
Exponential Smoothing (SES) outperformed ARIMA models when data are non-normal
because it is not very susceptible to model selection problems. A 1960 study by Muth
showed that SES provides the optimal forecast for a random walk plus noise (Gooijer,
2006).
2.8.2 Autocorrelation Tests on the JSE and the EMH
The JSE is the largest stock market in the English speaking Caribbean. Robinson (2005)
used statistical tests on trading data from January 1992 to December 2001, to investigate
the weak form efficiency of the JSE. Auto correlation tests and run tests revealed that
hypothesis for randomness was consistent with 65 % of the stocks listed and therefore
that the JSE is not weak form market efficient. Tests for a day of the week effect and tests
for a month of the year effect found that seasonal patterns common in developed markets
are absent from the JSE. He focused on all listed stocks and not merely the market index.
It can be argued that the market gained efficiency during the period 1977 -1986 since this
subset of the larger period 1969-1986 had random stock price changes. Stock prices for
the main period and subset 1969-1976 were not random.
24
Koot, Miles and Heitman (1989) tested the efficient market hypothesis by observing price
differences for the 18 year period to determine if differences were serially independent. A
non-parametric statistical test, runs test, was used for randomness of the price differences.
The runs test involves regression analysis.
A correlation study by Agebeyegbe (1994) revealed that JSE prices temporarily drift
away from fundamentals. Given the low statistical power of the test used, it was
inconclusive as to the efficiency of the market or lack thereof. Based on monthly prices
and treasury bills rates for the period January 1977 to December 1992, it was concluded
that stock returns are weakly negatively correlated over long periods and tend to be
positively correlated at high frequency. The lagged short term interest rates were also
found to be positively correlated with excess returns.
2.9 Machine Learning Approaches
Relational data mining (RDM) is a hybrid method including inductive logic
programming, probabilistic inference and representative measurement theory. RDM
algorithms do not assume the existence of derivatives nor that a functional form for the
relationship being modeled, is known in advance. Therefore, they train on numerical data
of financial time series inputted and automatically learn symbolic relations (Kovalerchuk
& Vityaev, 2000).
2.9.1 Neural networks
Globally, neural networks are the most popular financial forecasting method. They are
modeled from human neurons. A variety of neural networks have been discussed in the
literature for stock predictions. These include artificial neural networks (ANN), back
25
propagation neural networks (BNN), functional link artificial neural networks (FLANN),
procedural neural networks (PNN), and hybrid approaches. Neural networks can learn
nonlinear relationships between multiple inputs and desired outputs (Kohara, Ishikawa, &
Fukuhara, 1997).
Padhiary and Mishra (2011) used a FLANN architecture for both long and short term
stock forecasting. They utilized a standard least mean square algorithm with search-then-
converge scheduling to compute a learning rate parameter that changes temporally and
requires less training experiments. The removal of hidden layers in FLANN improves
simplicity and computational efficiency as it reaches global minima easily. Liang, Song
and Wang (2011) used a PNN to process spatial and temporal information synchronously
without a sliding time window.
Most studies on neural network stock prediction have focused on quantitative factors and
ignored the impact of political and international events. One approach inputs prior
knowledge into the network structure and refines it with learning by examples.
Alternatively, prior knowledge can be represented in the form of error measurements for
training networks. Both approaches are only effective when prior knowledge is
deterministic and can be represented in a rule based system (Kohara et al, 1997) .
Kohara et al (1997) developed a multivariate model to improve Tokyo stock price
prediction using non-deterministic prior knowledge and a neural network. Prior
knowledge includes stock price predictions and newspaper information on domestic and
foreign events.
Description of prediction method: Five factors used as inputs to the neural network were
TOPIX closing prices, exchange rate, interest rate, crude oil prices and the Dow-Jones
26
average of closing prices of 30 industrial stocks. Six prior knowledge rules were used,
three qualitative and three quantitative. The first qualitative rule was “If the domestic
political situation deteriorates, stock prices tend to decrease and vice versa.” A numeric
economic rule was “If the price of crude oil increases, stock prices tend to decrease and
vice versa”. Event knowledge was divided into positive and negative, prior to input.
2.9.1.1 Survey of neural network variations and hybrids
Wu and Lu (2012) did a survey study on individual and hybrid computational intelligence
methods, using the Taiwan Stock Exchange Capitalization Weighted Stock Index
(TAIEX) dataset over the four year period 2007 to 2011 to compare the root mean square
error (RMSE), mean absolute difference (MAD) and mean absolute percent error
(MAPE) of each method. The methods included a self-organizing polynomial neural
network (SOPNN) based on a statistical learning algorithm, cerebellar model articulation
controller NN, standard back propagation NN (BPNN) with the steepest descent method
(BPNN-GD), BPNN with scaled conjugate gradient (SCG) method, artificial immune
algorithm-based BPNN (AIA-BPNN), advanced simulated annealing-based BPNN
(ASA-BPNN), cerebellar model articulation controller NN (CMAC NN), BPNN with
scaled conjugate gradient learning algorithm (BPNN-SCG) and adaptive network based
fuzzy inference system (ANFIS) method.
Experimental results revealed that the best SOPNN, CMAC NN, BPNN-SCG, AIA-
BPNN, ASA-BPNN and ANFIS had identical training and test accuracies. AIA-BPNN
and ASA-BPNN had the lowest test RMSE, MAD and MAPE. These results indicate the
variation of neural networks and their hybrids have only marginal differences in
performance.
27
Hsu (2011) also used a hybrid of SOM NN and GP to improve stock price predictions on
the TAIEX finance and insurance sub-index over the period March 1996 to September
2009.
2.9.1.2 Appraisal of neural net and other machine learning methods for Stock
Prediction
Padhiary and Mishra (2011) suggest neural networks are suitable for extracting patterns
and detecting trends that are too complex to be identified by humans and other computing
techniques. They also suggest they have good generalization capability and are noise
tolerant. Probabilistic neural networks are also cited. However, these are not frequently
used due to their bulky nature inherent to the large training data. Kim and Han (2000)
mention a few limitations of artificial neural networks in learning stock patterns because
of the high noise, non-stationary characteristics and complex dimensionality of stock
market data. The large amounts of data sometimes inhibit pattern learning. This can be
overcome by feature discretization which uses thresholds to convert continuous values to
discrete ones.
Liang et al (2011) compared procedural neural networks (PNN), back propagation neural
networks (BNN), hidden Markov models (HMM) and support vector machines (SVM).
The PNN outperformed BNN, HMM and SVM in predicting daily stock price and was
more time efficient. The stock volume was found to be more dependent on the previous
day’s price than partial data for the current day. The training process of PNN was similar
to BNN although PNN had larger input dimensions. There remains scope for
improvement in the ability of PNN to generalize. Kovalerchuk and Vityaev (2000)
highlight limitations of neural networks for forecasting stock prices with regards to
28
explicability, usage of logical relations, scalability and tolerance for sparse data. The
scalability issue has been handled by combining with genetic algorithms to improve the
tractability. There are mixed views on the suitability of neural networks for
generalizations. While they are robust at identifying non-linear trends, their
generalization ability can be enhanced by preprocessing techniques such as discretization
or combination with genetic algorithms.
2.9.2 Support Vector Machines
Lee (2009) developed a hybrid stock trend prediction model based on support vector
machines and an f-score supported sequential forward search. It used 29 technical indices
as the whole feature set to predict the daily direction of the NASDAQ index. According
to Liang et al (2011), the SVM has been the best individual classifier in forecasting
weekly movement direction.
2.9.3 Fuzzy Logic
Srinivasa, Venugopal and Patnaik (2006) tested a fuzzy based neuro-genetic algorithm
for stock prediction. The algorithm outperformed their back propagation ANN and
regression in predicting accurate share values. A Kohonen network was used to map
input vector patterns of multiple dimensions onto a discrete map with only one or two
dimensions. The Kohonen layer is composed on competing neurons that are
neighborhood based. The further a neighbor is from the winner the smaller its change in
weight. The Kohonen algorithm with BNN is used to determine features for predicting
market share. Genetic algorithms are used that adapt through the epochs of the Kohonen
network. The genetic algorithms make the weights closer to the learning peak and
improve prediction. The learning rate for an individual neuron is fuzzily decided using
29
the number of epochs and the rank of the winner under consideration. This improves the
convergence rate.
2.9.3.1 Fuzzy hybrids Price Prediction
Zarandi, Hadavandi and Turksen (2012) developed the fuzzy multiagent system (FMAS)
architecture to predict next day stock prices of IT and airline companies: namely- IBM,
Dell, British Airways and Ryanair. The four layer architecture used a genetic algorithm to
extract the knowledge base of predictor fuzzy systems. Three protocols were used to send
results from layers one to four respectively: SendMD(1-2), SendC(2-3), SendEFS(3-4).
The first layer uses expert knowledge to extract relevant data from external sources to
create metadata. The second layer receives the metadata via a SendMD protocol to
perform feature selection using stepwise regression analysis and modularizing prediction
problems from self-organizing map neural network clustering. The self-organizing map
cluster used by Zarandi et al is a similar approach used by Hsu to predict prices on the
Taiwan stock exchange capitalization weighted stock index. The third layer built a model
for each cluster using genetic fuzzy systems and selects the best fuzzy system among
evolved models for each cluster. The final layer does model analysis, sensitivity analysis,
stock price prediction and real time generation of alternative scenarios in a what-if
analysis process. It outperformed HMM, ARIMA, ANN and two hybrids (Hybrid 1-
HMM, ANN, Hybrid 2- GA, HMM & FL). The four predictor price variables used were
open, close, high and low. The dataset for the airline companies were for different
periods. While for the IT companies training data included 400 objects from Feb 10, 2003
to Sept 10, 2004. The testing dataset of 91 objects ranged from September 2004 to
January 2005.
30
Enke, Grauer and Mehdiyev (2011) used a three phase hybrid model consisting of
multiple regression analysis, differential evolution optimization based fuzzy type-2
clustering and a fuzzy type-2 neural network. Multiple regression analysis was done on
25 financial and economic indicators over a 30 year period ending January 2009, to
reduce dimensionality and identify the variables most strongly related to the market price
of the S&P 500 index. An equation for predicting the price level for the next month was
derived from the analysis, which included only six input variables. The model derived
explained 99.4% variation of future prices. The fuzzy type-2 clustering method had a
highly accurate location of cluster center which resulted in a better modeling of the
uncertainty and high robustness against data imprecision. The hybrid fuzzy type-2
approach had a lower root mean square error than its fuzzy type-1 counterpart.
2.9.4 Genetic Algorithms
In financial forecasting, genetic algorithms (GAs) have been used to acquire technical
trading rules both for foreign exchange trading and the stock market. The greedy
algorithm is both time and space consuming. It is effective at testing parameters
individually to find the most profitable in a trading rule. The genetic algorithms
significantly reduce the run time of the greedy algorithm and lose very little precision
(Lin, Cao, Wang & Zhang, 2002).
Genetic algorithms utilize Darwin's theory of natural selection to find the best solution
for a real world problem. Genetic algorithms are used in two main ways: Firstly, to select
parameters for optimization and optimize the parameter based on historical data.
Secondly, they are also used for optimizing the values for parameters that are previously
specified. They are mostly used to determine the best combination of parameters in a
31
trading rule. They are often embedded in ANN models designed to choose stocks and
identify trades. Similar to neural networks, genetic algorithms have the undesired
potential for over fitting. However, it may be prevented by testing several indicators to
identify the one that best correlates with major market turns versus designing the system
around historical data and not identifying repeatable behavior (Kuepper, 2011).
Lin et al (2002) attempted to find the maximum profit combination of parameters from
the Australian stock exchange over a three year period, using filter rules with genetic
algorithms. A plethora of technical trading rules exist, eighty two of which are detailed in
(Schwager, 1999). Categories include entering trades, exiting trades, holding and exiting
winning trades, market patterns, analysis and review. Examples of technical trading rules
include filter rules, moving average, support and resistance and abnormal return.
Examples of parameters in trading rules are moving average convergence divergence
(MACD), exponential moving average (EMA) and stochastics (Kuepper, 2011).
2.9.4 Other Machine Learning Methods
Other machine learning methods include decision trees and Bayesian classifiers. In the
preliminary study of the JSE using historical data for a 22 month period, detailed in
Chapter 6, decision trees were found to have 99% accuracy in predicting movements of
all seven indices. Naïve Bayes’ accuracy ranged from 76% to 93% and neural networks
had 91% on the combined index and only 46% on the junior market index. Neural
networks outperformed decision tress and linear regression in predicting price and
volume trades, whereas decision trees and Naïve Bayes were more accurate in the binary
movement prediction.
32
Takahashi et al (2007) analyzed the impact of headline news text on stock price returns
using a Naïve Bayesian classifier and stock price return analysis by Welch test. This
analysis is helpful in determining how information is reflected in the stock price and
ultimately the level of efficiency in the market. It could also be used as part of a
qualitative - quantitative hybrid model to determine the impact a future news item will
have on a stock.
2.9.4.1 Bagging
Bagging is an abbreviation for bootstrap aggregating. It is a technique that uses multiple
ML methods to improve the performance of the classifier by decreasing prediction
variance.
2.9.4.2 Boosting
Like bagging, boosting is also based on meta-algorithms. It improves performance by
calculating the output of multiple learning algorithms and then averages the result using a
weighted average approach.
2.9.4.3 Stacking
Stacking is similar to boosting. It uses results from one algorithm to create improved
predictions in another. It does a comparative analysis on various models to identify the
best weights and input parameters to create the most accurate output.
2.9.4.4 SMO
Sequential minimal optimization (SMO) is an algorithm used in support vector machines
for solving the optimization problem efficiently.
33
2.9.4.5 M5P
This is a hybrid of decision tress and linear regression.
2.10 Case Studies
2.10.1 Tehran Stock Exchange
Abounoori and Tazehabadi (2009) used macro-economic variables to predict stock prices
of the Tehran stock exchange which is small and volatile. The variables include consumer
price index, interest rate, exchange rate and money volume. The dataset consisted of
monthly data for twelve and a half years ending March 2006 and was used on
Autoregressive Distributed Lag (ARDL), Autoregressive Integrated Moving Average
(ARIMA) and an Artificial Neural Network (ANN) separately and then on a hybrid
model of the three. ARDL (1,0,0,0,0) was used followed by ARIMA (1,1,1) on 150
months of training data to forecast residuals which were then fed into a neural network.
The best ANN model had four inputs with two hidden layers with 10 and 12 hidden units.
Consumer price index, interest rate, exchange rate and money volume were used to
predict the stock price. Seventy five percent of the dataset was used for training and the
remaining twenty five percent for prediction. Results indicated that the hybrid model had
less error: mean absolute error (MAD), mean square error (MSE) and mean absolute
percentage error (MAPE). The hybrid model proved to be quicker, more efficient and less
error prone.
34
2.10.2 Istanbul Stock Exchange: Neural Network and Regression
Senol and Ozturan (2008) used historical data from the Istanbul Stock Exchange (ISE) in
Turkey to prove that an ANN statistically outperforms a logistic regression methodology
and the ISE 30 is not weak form efficient. The best prediction model was obtained using
a stochastic indicator for 14 days and stochastic moving average of three percent. Results
also indicated the best ANN topology was 3.11.1 - three inputs, 11 hidden neurons in a
single hidden layer and one output.
2.10.3 Korea and Singapore Stock Exchanges: Genetic Algorithms & Neural Network
Kim and Han (2000) used neural networks and genetic algorithms to predict the Korea
composite stock exchange index with 82% accuracy. Ten years of data covering 2928
trading days from January 1989 to December 1998 was used. A genetic algorithm was
used to reduce dimensionality by feature discretization to enhance the generalizability of
the classifier from the empirical results.
Phua, Ming and Lin (2001) used neural networks and genetic algorithms to predict the
movement of the Singapore Stock Exchange index with 81% accuracy.
Neural networks and genetic algorithm hybrids have not just been used to forecast trend
and indices, but also to predict stock returns. Skolpadungket, Dahal and Harnpornchai
(2009) used nonlinear approximation models to create a genetic algorithm to select
relevant input variables for ANNs. The feature selection reduced the number of input
variables from 120 to between 20 and 70, with improved accuracy of stock return
prediction for nine out of ten US stocks sampled. This genetic algorithm model was
found to be faster than an evolutionary algorithm approach which took about 36 hours for
a generation (Skolpadungket, Dahal & Harnpornchai 2008).
35
The data set included monthly dividends and split adjusted return series from 1971 to
2007 on company stocks including Alcoa, Boeing, Caterpillar, IBM, General Electric and
General Motors. Disney is the only stock where the feature selection did not improve the
prediction over the original 120 variables used.
In their previous study using the evolutionary algorithm approach four methods were
tested: Least Square Regression (LS), Back propagation Neural network (BPN), Elman
Recurrent neural networks (RANs) and Evolutionary ANN (EANN) for the same ten
stock returns. It was found that BPNs had better performances in all stock return forecasts
than those of LS and Elman RANs. Only the GM forecast did not show an improvement
on the EANNs, over the BPNs (Skolpadungket et al 2008).
2.10.4 Amman Stock Exchange: Fuzzy Logic & Neural Network Hybrid
Rahamneh, Reyalat, Sheta and Aljahdali (2007) performed a comparative study by using
fuzzy logic and neural networks to forecast the Amman stock exchange (ASE) from 200
data samples. The ASE is a non-profit private entity established in 1999 that manages the
trading of securities. Its membership includes Jordans’ 52 brokerage firms. The study
predicted closing price of companies based on previous prices over a time series which
was not explicitly stated. The models were compared based on MSE and VAF (Variance
Accounted-For). The VAF is a measure used to assess the quality of a model by
comparing true output with output of the proposed model.
In addition to stocks, fuzzy logic has also been used to forecast other financial time series
such as exchange rates, commodities and improve the performance of neural networks.
The ability of fuzzy algorithms to combine quantitative and qualitative knowledge and
make definite inferences from imprecise information makes them suitable for stock
36
forecasting. In comparison to other ML techniques it has two advantages. Firstly, it is
understandable and transparent as it mimics the human process using linguistic terms.
Secondly, as a universal modeling technique, it can estimate a nonlinear complex system
with quantified precision.
2.10.5 Titan Oil prices: Pattern Matching & Neural Network Hybrid
Yu and Shaorong (2010) used three layer neural networks and pattern matching to
forecast the stock price of Titan Oil. The training set was 165 trading days between
August 2006 and May 2007, while the testing set was consecutive 100 training days
following the training period. The pattern matching algorithm is based on selecting the
time series, coding the time series and matching it with the closest time sequence
proceeded by forecasting the price based on the closest time series match.
Where a set of n time series are used ie X= {x1,x2,..xn}, the algorithm aims to predict the
future value xn+1. Based on historical observations on the time series xn-k+1,x n-k+2,..xn .
Experimental trials revealed best values for n lie between 250 and 400, and k has best
values between 2 and 6.
The hybrid system was found to have a quicker convergent rate, and greater precision and
accuracy than each of its constituent methods. Despite the superior ability of neural
networks for arbitrary nonlinear function approximation to other methods, its slow
convergence rate and vulnerability to fall into local optimum are major limitations.
Pattern matching minimizes these limitations by fully utilizing historical data’s rules of
changing and not limiting prediction based on immediate prior nodes. In the hybrid
method the weights of the network are trained by time sequences closest to the test
sequence.
37
2.10.6 Karachi Stock Exchange (KSE 100): Non-Gaussian State Space Model
The KSE is the largest and most liquid stock exchange in Pakistan. Kiani (2006) used a
non-Gaussian state space model to predict monthly KSE100 index excess returns. Spikes
in different time periods showed volatility towards stock market crashes. It was shown
the KSE index was greatly impacted due to sudden external shocks in 1992, 1998, and
2001-2, although the S&P CNX 500 Indian price index, which represents over 90% of
India’s stock exchange, was not as negatively impacted.
2.10.7 Price Prediction and Feature Selection Using Evolutionary Techniques
Bonde and Rasheed (2012a) used data for the last five years for eight IT companies on
the NASDAQ and S&P 500 to predict the movement of the next day’s price. The
companies are Adobe, Apple, Google, IBM, Microsoft, Oracle, Sony and Symantec. The
input parameters were opening price, closing price, highest price, lowest price, volume,
adjusted closing price for each company as well as for the NASDAQ and S&P 500.
Genetic algorithms (GAs) and evolutionary strategies (ES) were used to find the
connection weight for each attribute. A second data set was used for verification of the
weights derived. It was found that GAs and evolutionary strategies had similar
performance. The GA had an accuracy of 73.87% while the ES had 71.77%.
Bonde and Rasheed (2012b) used a similar data set to Bonde and Rasheed (2012a) for the
same companies. Unlike the previous study that focused on price direction, this one
aimed to identify best features for actual price prediction. A sequential feature set
extraction approach and four machine learning methods were tested. They are neural
networks, sequential minimal optimization (SMO), bagging and M5P. It was found that
SMO and bagging using SMO were the best ML methods and the best features were
38
Volume + Company as well as Nasdaq + S&P + Company. Neural networks did not
perform well on this data set and the results were significantly different from the other
three methods.
2.11 Statistical Approaches versus Machine Learning Methods
The nonlinear nature of the stock market makes it poorly suited to the linear multiple
regression model. Also, the high variance of estimated coefficients reduces the
generalizability of the results (Srinivasa et al, 2006). Due to the static nature of classical
mathematical models like auto regression, they have not been as effective as neural
networks and machine learning methods in stock predictions. While BNN has the
limitation of not being able to efficiently extract useful correlations from raw stock data,
this can be boosted by clustering. Temporal models such as genetic algorithms with
neural networks preserve time sequence but limit system performance due to lack of
clustering (Srinivasa et al, 2006).
2.12 Summary
Price prediction has proved more challenging with lower accuracy and is more critical to
assessing overall stocks returns. Table 2 summarizes the quantitative stock prediction
studies reviewed in this chapter. While studies such as Yu and Shaorong, Enke et al and
Rahamneh et al had over 90% accuracy, the data sets were relatively small ranging from
a few months to three years. Studies covering longer periods such as Kim and Han,
Bonde and Rasheed still reported reasonable accuracies of over 70%. They also indicate
39
hybrid methods have higher accuracies than non-hybrids. While the error was not
available for some of the studies, it shows the general levels of accuracy that have been
obtained using a range of hybrid and hybrid machine learning methods. In the fuzzy
hybrid by Zarandi, the larger data set used for IBM and Dell, had significantly lower
MAPE than British Airways and RyanAir. This shows that using a larger historical
dataset can greatly improve accuracy.
A range of statistical and machine learning approaches has been used to successfully
predict various stock exchanges worldwide. ARIMA is the most dominantly used
statistical approach. While several machine learning methods have been used, ranging
from ANNs to SVM, neural networks have been most popular due to noise tolerance and
ability to handle the complicated data that is chaotic in nature. Neural networks and
genetic algorithms have gained over 80% accuracy in predicting the Singapore and
Korean indices. Prediction of movement has generally had a high level of accuracy due to
its binary output. Genetic Algorithms has been proven to reduce computational
complexity and run time. Hybrid approaches have been very successful as they combine
the strengths of multiple methods while reducing weakness such as over fitting and
computational complexity.
The next chapter outlines related work on semantic web and sentiment based approaches
used for stock prediction.
40
Table 2.2: Summary of Stock Forecasting Studies
Stock Exchange DataSet Study Method Accuracy(%) Error
NASDAQ 5 years of stock
data from 8 IT
companies
Bonde &
Rasheed 2012 a
GA
ES
73.87
71.77
NASDAQ 5 years of stock
data from 8 IT
companies
Bonde &
Rasheed 2012 b
Bagging & MP5 RAE 0.5-
12 %
Korea 10 years ending
December 1998
(2928 trading days)
Kim & Han Hybrid :GA & NN 82
NASDAQ 6 years daily data
ending Nov 2007
Lee Hybrid :SVM
&Score search
85.4
IBM& Dell
British Airways
& RyanAir
400 objects : 19
months
91 objects: 5
months
Zarandi FMAS 0.63,
0.42
1.44,
1.24
MAPE
Titan Oil prices 165 trading days
ending May 2007
Yu & Shaorang NN & PM ~90 <0.005
topix 408 trading days
ending march 1991
Kohara Hybrid :Prior
knowledge & NNs
Cc 0.57 15.5
TAIEX finance/insurance
sub-index
Mar 1996-Sept
2009
Hsu Hybrid :NN&GP 92.7 * RMSE
19.44
MAE
14.2
MAPE
1.44 X
10-2
S&P 500 361 months ending
January 2009
Enke Regression
Hybrid : Regression,
Fuzzy, NN
99.4 SEE 35.5
RMSE
0.909
Amman 200 data samples Rahmaneh FL
NN
VAF 99.9892
99.9775
MSE
1.28241
X 10-3
Taiwan 2007-2011 Wu & Lu NN hybrids MAPE
1.106-
1.112
Singapore 360 samples from
Aug 1998- Jan
2000
Phua et al NN&GA 81
Istanbul 2255 days Jan 98-
Dec 2005
Senol, Ozturan NN& Regression 95
41
CHAPTER 3: SURVEY OF SEMANTIC WEB ARCHITECTURES FOR
STOCK PREDICTION
This chapter outlines the research to date on sentiment analysis of social media data and
use of semantic web architectures for stock prediction.
3.1. Sentiment Analysis for Stock Prediction
Social media is inherently assistive in predicting stock trading volumes since it captures
the views of many within the population and tweets and posts often go viral in very
miniature increments of time. While studies (Podobnik et al, 2009; Plerou et al, 2000;
Yamasaki et al, 2005) show that volume shifts can be correlated with price movements,
the semantic web knowledge base (KB) prediction studies have not generally focused on
the regression problem of predicting prices. Also, while social data have been used to
predict economical outcomes in studies such as Asur & Huberman (2010), these
predictions are not in the context of financial markets.
Wüthrich et al (1998) analyzed news articles, collected from five popular financial
websites, available before the opening of the Hong Kong stock market with text mining
techniques including k-nearest-neighbor and a variety of neural networks. In predicting
the trend of the Hong Kong market, they achieved an average accuracy of 46%, which
proved better than the accuracy of a random predictor, which achieved a maximum 33%
42
accuracy. Mittermayer (2004) designed News Categorization and Trading System
(NewsCATS), to predict stock price trends for the time immediately after the publication
of press releases and achieved an average weighted recall of 54%. These accuracy values
are low in comparison to most ML-based studies which report between 80%-90%
accuracy on binary predictions of market trends.
Wang et al (2008) developed an ontology for knowledge about news in financial
instrument markets and suggested the framework can be used as input to stock price
prediction algorithms. In their later work (Wang et al, 2011), which utilized the previous
ontology, an expert reasoning system was designed to integrate the domain knowledge in
the data mining process through building data mining models consisting of multi news
variables with certain financial instrument trading activity and suggesting the potential
polar (“positive”, “neural”, “negative”) effect of each news variable, on trading activities.
However, no results were presented regarding accuracy of actual price predictions based
on the model. Most web mining or ontology based approaches including Orell (2011), do
not report accuracy of predictions, nor error rates, which is typical of statistical and
machine learning papers. This makes the comparison between the models challenging as
standard benchmarks are necessary for comparative analysis. However, a conceptual or
qualitative analysis is given in the proceeding section since quantitative measures are not
available from most semantic related financial forecasting studies.
3.1.1. Comparison of Machine Learning and Semantic Web Approaches
The semantic web knowledge based approach heavily incorporates human perceptions
and inklings and is similar to fuzzy based reasoning on degrees of uncertainty. Unlike
43
other ML approaches that take a non-human like approach to learning focusing mainly on
the numbers, the semantic web knowledge base approach favorably considers non-
quantitative factors which often have a quick and direct impact on trading. Markets will
react quicker based on the efficient market hypothesis since the investor knowledge and
intentions are publicized on the web. This is evident by a false tweet, posted April 23rd
when the Associated Press Twitter account was hacked, which alluded to two explosions
at the White House and President Obama being hurt. This caused the market to plunge
within minutes (Blaine, 2013; CNN, 2013). Fortunately however, it reacted after
Associated Press denounced the false tweet. Although the USA market is strong form
efficient based on the efficient market hypothesis, the market did not correct itself
momentarily after the information went public. This is critical with electronic trading as it
could have resulted in market crashes since trades are executed within nanoseconds and
several minutes passed before it was corrected. CNN reported that built in circuits to
facilitate ‘trading halts,’ failed to execute. According to Subrahmanyam (1995): “under
reasonable conditions, discretionary [or] randomized, trading halts may be less
susceptible than rule-based halts to ‘gravitational’ or ‘magnet’ effects which occur when
traders concerned about an impending closure accelerate their orders (p.1)”. The real time
impact of the semantic web model can serve as an informant to markets so they can
reflect factors with immediate impact.
One of the advantages of this model to others in Chapter 2 is that the semantic KB model
considers qualitative factors which are missing from most ML models in the literature.
However, the SentAMaL approach developed has similarities to the prior knowledge
ANN used by Kohara et al (1997) and to a lesser extent the qualitative ANN approach
44
used by Padiary & Mishary (2011), based on its use of qualitative input. Padiary and
Mishary used a FLANN architecture for both long and short term stock forecasting. It
utilized a standard least mean square algorithm with search-then-converge scheduling to
compute a learning rate parameter that changes temporally and required less training
experiments. Kohara et al focused on the impact of qualitative factors including social
and economic change and was less rigorous on the quantitative factors.
As evidenced by the instantaneous impact of the false tweet, Bordino et al (2012) concurs
that semantic stock prediction models provide identification of early warnings of
financial systemic risk, based on the activity of users of the WWW and the query volume
dynamics which emerges from the collective but seemingly uncoordinated activity of
many users.
The ML models in Chapter 2 are likely to outperform the semantic model if there are no
major social or economic changes, since as lengthy supervised learning approaches they
place greater emphasis on the relations between quantitative factors over a time series.
The semantic approach would generate predictions more quickly than ML approaches
which usually takes several hours or days.
The semantic web KB model is likely to be more accurate in short term forecasting whilst
ML approaches, especially those that incorporate qualitative factors, may be more
accurate on long term forecasts. If ML hybrid approaches were to include the real time
inputs from the semantic approach, then the accuracy is expected to improve as long as it
is not given a false positive like the hacked tweet in Blaine (2013).
Antweiler and Frank (2004) examined the nature of messages, and found that Web talk
does not predict stock movements, although it is a good predictor of volatility. Semantic
45
KB predictions models may be more accurate in predicting trends than actual prices.
Compared to other approaches, ML approaches have gained superior accuracy in
predicting several stock attributes: trend, price and volumes. For example if a company is
at the brink of crisis, such as: the loss of a law suit, explosion on the compounds or is
approaching bankruptcy; this is likely to be spread rapidly by social media or the
Jamaican blog and traders using the semantic model would be able to react more quickly
by selling off the stock than if they relied on an ML based predictor.
In summary, the semantic knowledge based approach is able to offer faster predictions
than traditional ML based approaches as well as give a good indication of volatility in the
markets and predict potential trading volumes with reasonable accuracy. Although their
learning or processing time is lower than semantic approaches, ML based approaches are
better able to handle regression problems and give a good prediction not just on volume
traded or market trends, but also on stock prices which is key to determining potential
profits. Semantic web knowledge based model seems better suited for short term forecast
while machine learning approaches will likely outperform them on long term forecasts.
3.2. Semantic Web Architectures
Bordino et al (2012) show a semantic web approach to establish a correlation between
daily trading volumes of stocks traded and volumes of queries related to the same stocks
in NASDAQ-100. Micu et al (2009) outlines an OWL based application, Stockwatcher,
that tracks relevant news items on the NASDAQ-100 and predicts one of three possible
effects it will have on the company: positive, negative or neutral. The news items are
extracted from RSS feeds. The Stockwatcher architecture is shown in Figure 3.1 and it
46
utilizes natural language processing (NLP) and text mining techniques such as tagging
and morphologic analysis.
Figure 3.1 Stockwatcher architecture (Micu et al, 2009 pg 319)
Figure 3.2 Architecture of a news based stock prediction system (Nikfarjam et al, 2010
pg 258)
Nikfarjam et al( 2010) also outline a generic news based stock prediction system using
tagging and classification as shown in Figure 3.2. Feature selection and features
weighting are performed on the categorized news and the weighted vectors inputted to
the classifier. A survey of eight developed classifier systems were compared. The
47
classifiers used were SVM or a SVM-variant and decision trees. The datasets ranged
from one month to eight years. The most accurate classifier among that survey was
decision trees with 82% on 3 month dataset in the system developed by Rachlin et al
2007. SVM had a directional accuracy of 70% on a 15 month dataset used by Zhai et al
2007.
Figure 3.3 AZFinText System by Schumaker et al (2012 pg 11)
Schumaker et al (2012) designed the AzFinText system to determine whether subjectivity
and objectivity impact stock news article prediction. The high level architecture is shown
in Figure 3.3 If the database, identified by DB, shown in the AzFinText system was
replaced by an ontology it would be more semantic web related. Based on sentiment
analysis it was found that subjective news articles were easier to predict in price direction
by 9%, while articles with a negative sentiment were easiest to predict by 1%.
Doshi et al (2010) used variants of dynamic social network analysis to predict movie
stock values on the Hollywood Stock Exchange (HSX) . They predicted the daily changes
in prices and explored the effectiveness of sentiment analysis and web matrices in
48
predicting trends. No explicit measure of accuracy or value was given for predicting
stock price.
3.3. Summary
As discussed, a variety of architectures emerged within the last five years on semantic
web and sentiment analysis to predict stocks. However, except for the AzFinText system,
most have not focused on price prediction. The proceeding chapter will focus on the
experimental and architectural design of the study, while the results are outlined in
Chapters 6 and 7.
49
CHAPTER 4: METHODOLOGY
This chapter outlines the research design, tools and data processing and analysis methods
that were used to undertake the study.
4.1. Research Design
This section will define some of the experiments and data sets that were used to test the
hypotheses and accomplish the aim of the study. Feature selection and time series filters
were used for all ML experiments to identify key predictors and eliminate over fitting.
The experiments have been divided into six categories although each category required
several trials and often multiple methods. A variety of parameters were tested for each
ML approach.
Hypotheses
1. JSE main index follows a random walk.
2. Machine learning approaches are superior to statistical approaches for forecasting
JSE data.
3. Hybrid machine learning approaches are more accurate than individual ones.
4.1.1. Experiment 1: Random Walk Test
This experiment tested hypothesis one using similar methods to Robinson’s study.
The data set will be 2001-2014 with two subset periods of
50
2001-2010
2010-2014
The distinction is made in the split of the dataset because of the debt exchanges that
occurred in early 2010 and 2013 when the successive governments sought public
compromise to reduce the contractual interest on bonds. These results are discussed in
Chapter 5.
4.1.2. Experiment 2: Statistical Trend Predictions
This experiment used statistical approaches such as regression to predict movement
over selected two year periods from the last ten years. It tested hypothesis two. The
input variables included:
o ValueDate
o Value
o ValueChange
o PercentageChange
o VolumeTraded
o YearHigh
o YearLow
o YearToDate
o QuarterToDate
o MonthToDate
o WeekToDate
o NASDAQtrend
51
o S&Ptrend
o Movement
Similar to the approach used by Bonde and Rasheed (2012b), similar parameters from
the NASDAQ and S&P were also used to test the impact of major exchanges on the
frontier market.
4.1.3. Experiment 3: ML Trend Predictions
This experiment used a range of ML approaches (neural nets, SVM, bagging,
Decision trees, SMOs) to predict movement over selected two year periods from the
last ten years. It tested hypothesis two. The input variables were the same as
experiment 4.
4.1.4. Experiment 4: Statistical Price Predictions
This experiment used statistical approaches to predict prices. It tested hypothesis two.
The input variables included:
o StockCode
o ValueDate
o LastPrice
o PreviousPrice
o PriceChange
o PercentageChange
o VolumeTraded
o TodaysHigh
o TodaysLow
o YearHigh
52
o YearLow
o NASDAQtrend
o S&Ptrend
o ClosingAsk
The trend values from the NASDAQ and S&P were also used to test the impact of
major exchanges on the frontier market.
4.1.5. Experiment 5: ML Price Predictions
This experiment used a range of ML approaches (neural nets, SVM, bagging, decision
trees, SMOs) to predict prices. It tested hypothesis two. The input variables were the
same as experiment 4.
4.1.6. Experiment 5: ML Volume Predictions
This experiment used a range of ML approaches (neural nets, SVM, bagging, decision
trees, SMOs) to predict volume for the 13 year period 2001-2013. It tested hypothesis
two. The input variables were similar to experiment 4, except that price was replaced with
volume traded. The methods and results for experiments two to five are outlined in
Chapter 6.
4.1.7. Experiment 6: Hybrid Predictions
Based on results of individual methods used in experiments 2-5, the alternative hybrid
approach SentAMaL was developed and used to predict stocks based on social sentiment
extracted from tweets. A hybrid (qualitative and quantitative) research approach was
employed in the design of SentAMaL. Machine learning algorithms are used both to
53
classify sentiments from social media mining as well as to predict stocks based on
qualitative and quantitative inputs, denoted by the shaded objects. SentAMaL was used
to test hypothesis three. This is the major contribution of this study. Figure 4.1 shows the
architectural design of SentAMaL.
4.2 Description of SentAMaL
The qualitative data acquisition involves collecting data from the Twitter social network
using a customized software package developed in the open source R programming
language and the Twitter application programming interface (API). Of note, the data on
Twitter was fairly readily available through a connection to its API barring the
restrictions on its API. A function was created and used to extract tweets from relevant
Twitter timelines using hashtags, for example #marijuana, screen names (@tvj and
keywords, for example, “weed” and “legalize”.
Figure 4.1: Architectural Diagram of SentAMaL
54
4.2.1 Cleaning of Tweets
Figure 4.2 shows snippets of code used to perform qualitative data pre-processing.
The procedures used in this study compared three machine learning classifiers by
utilizing a supervised classification approach. The classifier that was best suited for the
problem was used to analyze the tweets obtained from Twitter between January and
February 2015, in order to determine the sentiments being expressed about marijuana and
its legalization.
The qualitative data pre-processing involves removal of duplicate tweets, numbers,
punctuation and symbols. A pre-processing function developed in R, allowed for the
initial filtering of unwanted or unnecessary verbiage from the tweets, while being
extracted from Twitter. It also included replacing certain emoticons with words (e.g. :-)
with “happy”). Figure 4.3 shows samples of tweets cleaned using the R programming
application. The tweets downloaded were stored as comma separated values (.csv) files
for further processing.
4.2.2 Normalizing Tweets
The normalizing tweets function used in a spreadsheet application, entailed the
removal of duplicate tweets. This was done by comparing two rows of tweets at a time to
determine whether they were similar. If so, then a user-defined identifier was used to
mark one of them and this record was subsequently removed from the dataset.
The quantitative aspect of the analysis was realized using data classification tools that
quantified and classified data instances based on the sentiments expressed in each tweet.
The analysis was conducted predominantly based on the establishment of sentiment
polarity (positive, negative or neutral) of the tweets.
55
The quantitative data acquisition involves historical data from S&P 500, NASDAQ and
JSE over the trading period that the tweets were acquired.
Figure 4.2: Tweet Cleaning Function Code Snippet
utech receives machine to advance medical marijuana research jamaica legalizes medical marijuana amp decriminalizes all weed legalize jamaica legalizes marijuana jamaica rt weedfeed jamaica legalized medical marijuana on bob marleys birthday
jamaica legalized medical marijuana on bob marleys birthday rt whaxyapp jamaica legalized medical marijuana amp decriminalized possession on bob marleys bday†jamaica legalized medical marijuana amp decriminalized possession on bob marleys bday€ jamaica legalizes medical marijuana amp decriminalizes all weed medical marijuana could be jamaica’s economic legacy says businessman joe issa theradioshow itsyourlifestyle florida and pennsylvania work on new medical marijuana bills and jamaica makes history on bob marleys birthday
Figure 4.3: Samples of Tweets Cleaned using R Programming Application
4.2.3 Population and Sample
The population for the SentAMaL study was comprised of a corpus of
approximately 1941 tweets that were extracted from Twitter pages between January and
February 2015.
56
This population represented a sample of tweets expressing polarities of possible
positive, negative or neutral sentiments about the legalization of medical marijuana. A
stratified random sampling method was used to select approximately 1000 tweets from
the entire corpus for building the classification models. From this, ten-fold cross
validation was used to classify the dataset.
Of the training dataset, the positive tweets were approximately six times less than
those deemed to be negative or neutral. In order to balance the polarity representation, a
Synthetic Minority Oversampling Technique (SMOTE) filter was applied to stabilize the
unbalanced data instances with synthetic data. Thus, a more equitable classification
model was expected to be derived for use in determining the sentiment polarity of new
data instances.
4.2.4 Data Pre-processing
Further pre-processing of the tweets was conducted to remove values not captured
by the R tweet cleaner. This involved conversion of the data string into vectors of words
by applying a StringToWordVector filter. This filter converts string attributes into a set of
attributes representing word occurrence (depending on the tokenizer). It also sets
parameters that were relevant to the information being retrieved. Such parameters include
limits placed on the number of terms repeated (term frequency); the number of words to
output (word count); the tokenizer which delimits words within the string; and stemmer
that facilitates conversion of terms to their base forms, for example, the base term love
for the words like lovely, lovable, loving.
57
4.2.5 Sentiment Classification
In order to determine sentiment of tweets, several machine learning classifiers
were evaluated to identify the data mining classification model that is best suited for the
problem. Three machine learning classifiers were explored : the Naive Bayes
Multinomial Text Classifier, the Support Vector Machine (SVM), and the J48 Decision
Tree, which are all said to work well on text categorization.
After training the three classification models to correctly categorize the tweets
into positive, negative and neutral classes they were explored to validate their accuracy as
well as their efficiency. Naive Bayes Multinomial Text emerged as the best performing
model derived from these classifiers and was applied to unknown instances of tweets that
were extracted from Twitter. These results are detailed in Chapter seven.
4.3 Assumptions of the Study
The JSE is weak form efficient.
4.4 Limitations of the Study
There are companies who may have delisted for a portion of the time frame considered or
started trading after the period. These companies will not be considered in the data set,
except for JMMB which was used in the random walk test despite not trading in 2001.
4.5 Summary
The validity of hypothesis 1, 2 and 3 is discussed in Chapters 5, 6 and 7 respectively.
Chapter 8 summarizes the hypotheses.
58
CHAPTER 5: RANDOM WALK TEST
This chapter outlines the results of the first experiment which tested hypothesis one using
similar methods to Robinson (2005) and Qian & Rasheed (2004). The dataset consisted
of 2001-2014 with two subset periods of
2001-2010
2010-2014
The distinction is made in the split of the dataset because of two debt exchanges that
occurred in early 2010 and 2013 when successive governments sought public
compromise to reduce the contractual interest on bonds.
5.1 Background
Koot, Miles & Heitmann (1989) tested for randomness of returns in the earlier years,
using the runs test. It was found that the JSE did not follow a random walk between the
periods 1969 - 1986 and 1969 -1976. However, the random walk hypotheses could not be
rejected for the sub-period 1977-1986.
59
5.2 Tests of Randomness
A variety of tests for randomness of time series exist. These range from a mere visual
examination of time series plot to a runs test (Chatfield, 2004). Robinson (2005)
proposed statistical tests such as the runs test to determine whether stock returns conform
to the random walk model. Qian & Rasheed (2004) used the Hurst exponent, calculated
by the rescaled range analysis, to determine periods of predictability. To ascertain
whether the time series of stock prices for the selected blue chip companies on the JSE
follows a random walk a visual test and a runs test were performed and the Hurst
exponent was calculated.
Visual Test
For the visual test, a scatter plot of the closing prices for the time period was plotted. The
difference was also calculated for the time series and plotted. The standard deviation of
the closing prices and differences were compared. A random walk was indicated by a
meandering of the closing price plot, differences that follow a random process and the
standard deviation of the closing prices being larger than the standard deviation of the
differences.
Runs Test
The runs test is a statistical non-parametric test based on runs of observations. A run is
defined where an observed value is greater than or less than an average value, and is
recorded for the duration of the time series. The average can be the median or mean. This
method may ascertain short term correlation. Under the null hypothesis of randomness,
the expected number of runs are compared with the recorded number of runs (Chatfield,
2004). For this study, a significance value of less than 0.05 accepts the null hypothesis of
60
randomness i.e. the stock is assumed to follow the random walk model. For a significance
value greater than 0.05, it rejects the hypothesis of randomness.
Hurst exponent
Qian & Rasheed (2004) describes an algorithm for estimating the Hurst exponent of a
time series using rescaled range analysis. The Hurst exponent ranges between zero and
one. A Hurst value of 0.5 indicates randomness and values closer to one indicate greater
predictability since the period would reject the random walk model. A Hurst value closer
to one indicates a persistent series, whereas a Hurst value less than 0.5 indicates an anti-
persistent series. An anti-persistent series is often described as “mean-reverting”, which
values alternate above and below the mean consistently.
A macro was developed to calculate the Hurst exponent from the rescaled range time
series using the algorithm outlined by Qian & Rasheed (2004, p2).
5.3 Results
The closing prices of ten blue chip stocks were tested for randomness over the period
January 1, 2001 to June 30, 2014. This included 3,392 trading days. The results are
shown below for each of the two periods:
i. 1st January 2001- 31st December 2009 (Period I: 2,263 days)
ii. 1st January 2010 -30th June 2014 (Period II: 1,129 days)
The ten blue chip stocks were selected from those in Table 6.4 used by a local stock
broker, who also trades on the JSE. They are CAR, CCC, DG, GK, GLNR, JBG, JMMB,
JP, LIME and NCBJ. LIME is the rebranded trading name for CWJ listed in Table 6.4.
61
5.3.1 Period I: 2001-2009
Figure 5.1 shows the closing prices for the CAR stock meanders and the differences plot
in Figure 5.2 also seem to follow a random process. This is confirmed by the standard
deviation of the closing prices being larger than the standard deviation of the differences
shown in Table 5.1 and further validated by significance value of the runs test being less
than 0.05, shown in Table 5.2.
Figure 5.1 Scatter Plot of CAR closing prices
0
10
20
30
40
50
60
70
80
90
100
06
/12
/19
99
19
/04
/20
01
01
/09
/20
02
14
/01
/20
04
28
/05
/20
05
10
/10
/20
06
22
/02
/20
08
06
/07
/20
09
18
/11
/20
10
Closing Price $
Day
CAR:ClosePrice
62
Table 5.1 : Statistical comparison of CAR closing prices vs differences Statistic ClosePrice Differences
Mean 41.66702 0.000893
Standard Error 0.297095 0.025525
Median 36.5 0
Mode 33 0
Std Deviation 14.13309 1.214002
Figure 5.2 : Scatter Plot of CAR differences in closing prices
Table 5.2 Runs Test for CAR stock prices 2001-2009 performed on a)Median b)Mean
ClosePrice
Test Value(a) 37
Cases < Test Value 1131
Cases >= Test Value 1132
Total Cases 2263
Number of Runs 57
Z -45.227
Asymp. Sig. (2-tailed) .000
Runs Test a) Median
ClosePrice
Test Value(a) 41.67
Cases < Test Value 1501
Cases >= Test Value 762
Total Cases 2263
Number of Runs 41
Z -45.701
Asymp. Sig. (2-tailed) .000
Runs Test b) Mean
-10
-5
0
5
10
15
06
/12
/19
99
19
/04
/20
01
01
/09
/20
02
14
/01
/20
04
28
/05
/20
05
10
/10
/20
06
22
/02
/20
08
06
/07
/20
09
18
/11
/20
10
Difference
63
Figure 5.3 shows the closing prices for the CCC stock meanders and the differences plot
in Figure 5.4 also seem to follow a random process. This is confirmed by the standard
deviation of the closing prices being larger than the standard deviation of the differences
shown in Table 5.3 and further validated by significance value of the runs test being less
than 0.05, shown in Table 5.4
Figure 5.3 : Scatter Plot of CCC closing prices
Table 5.3 : Statistical comparison of CCC closing prices vs differences Statistic ClosePrice Differences
Mean 6.37 0.00
Standard Error 0.08 0.01
Median 4.51 0.00
Mode 3.00 0.00
Std. Deviation 3.83 0.25
0
2
4
6
8
10
12
14
16
18
20
06
/12
/19
99
00
:00
19
/04
/20
01
00
:00
01
/09
/20
02
00
:00
14
/01
/20
04
00
:00
28
/05
/20
05
00
:00
10
/10
/20
06
00
:00
22
/02
/20
08
00
:00
06
/07
/20
09
00
:00
18
/11
/20
10
00
:00
Closing Price $
Day
CCC:ClosePrice
64
Figure 5.4 : Scatter Plot of CCC differences in closing prices
Table 5.4 Runs Test for CCC stock prices 2001-2009 performed on a)Median b)Mean
ClosePrice
Test Value(a) 16.20
Cases < Test Value 1126
Cases >= Test Value 1137
Total Cases 2263
Number of Runs 43
Z -45.815
Asymp. Sig. (2-tailed) .000
Runs Test a) Median
ClosePrice
Test Value(a) 15.5254
Cases < Test Value 1081
Cases >= Test Value 1182
Total Cases 2263
Number of Runs 24
Z -46.612
Asymp. Sig. (2-tailed) .000
Runs Test b) Mean
-2
-1.5
-1
-0.5
0
0.5
1
1.5
2
2.5
06
/12
/19
99
00
:00
19
/04
/20
01
00
:00
01
/09
/20
02
00
:00
14
/01
/20
04
00
:00
28
/05
/20
05
00
:00
10
/10
/20
06
00
:00
22
/02
/20
08
00
:00
06
/07
/20
09
00
:00
18
/11
/20
10
00
:00
Differences
65
Figure 5.5 shows the closing prices for the DG stock meanders and the differences plot in
Figure 5.6 also seem to follow a random process. This is confirmed by the standard
deviation of the closing prices being larger than the standard deviation of the differences
shown in Table 5.5 and further validated by significance value of the runs test being less
than 0.05, shown in Table 5.6
Figure 5.5 : Scatter Plot of DG closing prices
0
2
4
6
8
10
12
06
/12
/19
99
19
/04
/20
01
01
/09
/20
02
14
/01
/20
04
28
/05
/20
05
10
/10
/20
06
22
/02
/20
08
06
/07
/20
09
18
/11
/20
10
Close price $
Day
DG: Close Price
66
Table 5.5 : Statistical comparison of DG closing prices vs differences
Statistic ClosePrice Differences
Mean 6.75 0.00
Standard Error 0.03 0.00
Median 7.00 0.00
Mode 7.00 0.00
Std Deviation 1.65 0.20
Figure 5.6 : Scatter Plot of DG differences in closing prices
Table 5.6 Runs Test for DG stock prices 2001-2009 performed on a)Median b)Mean
ClosePrice
Test Value(a) 7.0
Cases < Test Value 1050
Cases >= Test Value 1213
Total Cases 2263
Number of Runs 57
Z -45.214
Asymp. Sig. (2-tailed) .000
Runs Test a) Median
ClosePrice
Test Value(a) 6.749
Cases < Test Value 928
Cases >= Test Value 1335
Total Cases 2263
Number of Runs 27
Z -46.452
Asymp. Sig. (2-tailed) .000
Runs Test b) Mean
-2.5
-2
-1.5
-1
-0.5
0
0.5
1
1.5
06
/12
/19
99
19
/04
/20
01
01
/09
/20
02
14
/01
/20
04
28
/05
/20
05
10
/10
/20
06
22
/02
/20
08
06
/07
/20
09
18
/11
/20
10
Difference
67
Figure 5.7 shows the closing prices for the GK stock meanders and the differences plot in
Figure 5.8 also seem to follow a random process. This is confirmed by the standard
deviation of the closing prices being larger than the standard deviation of the differences
shown in Table 5.7 The significance value of the runs test is less than 0.05, shown in
Table 5.8, further validating conformance to the random walk model.
Figure 5.7 : Scatter Plot of GK closing prices
0
20
40
60
80
100
120
140
19
99
-12
-06
20
01
-04
-19
20
02
-09
-01
20
04
-01
-14
20
05
-05
-28
20
06
-10
-10
20
08
-02
-22
20
09
-07
-06
20
10
-11
-18
Closing Price $
Day
GK:ClosePrice
68
Table 5.7 : Statistical comparison of GK closing prices vs differences
Statistic ClosePrice Difference
Mean 60.56202828 0.009973475
Std Error 0.595254623 0.027992494
Median 57 0
Mode 42 0
Std Deviation 28.31685742 1.331336666
Figure 5.8 : Scatter Plot of GK differences in closing prices
Table 5.8 Runs Test Results for GK stock prices 2001-9 performed on a)Median b)Mean
ClosePrice
Test Value(a) 57.00
Cases < Test Value
1123
Cases >= Test Value
1140
Total Cases 2263
Number of Runs 21
Z -46.740
Asymp. Sig. (2-tailed)
.000
Runs Test a) Median
ClosePrice
Test Value(a) 60.5620
Cases < Test Value
1315
Cases >= Test Value
948
Total Cases 2263
Number of Runs 35
Z -46.114
Asymp. Sig. (2-tailed)
.000
Runs Test b) Mean
-15
-10
-5
0
5
10
15
20
19
99
-12
-06
20
01
-04
-19
20
02
-09
-01
20
04
-01
-14
20
05
-05
-28
20
06
-10
-10
20
08
-02
-22
20
09
-07
-06
20
10
-11
-18
GK:Difference
69
Figure 5.9 shows the closing prices for the GLNR stock meanders and the differences
plot in Figure 5.10 also seem to follow a random process. This is confirmed by the
standard deviation of the closing prices, 0.61, being larger than the standard deviation of
the differences shown in Table 5.9 and further validated by significance value of the runs
test being less than 0.05, shown in Table 5.10
Figure 5.9 : Scatter Plot of GLNR closing prices
0
0.5
1
1.5
2
2.5
3
3.5
4
4.5
5
06
/12
/19
99
19
/04
/20
01
01
/09
/20
02
14
/01
/20
04
28
/05
/20
05
10
/10
/20
06
22
/02
/20
08
06
/07
/20
09
18
/11
/20
10
Close Price $
Day
GLNR ClosePrice
70
Table 5.9 : Statistical comparison of GLNR closing prices vs differences
Statistic ClosePrice Differences
Mean 2.09 0.00
Standard Error 0.01 0.00
Median 2.00 0.00
Mode 2.00 0.00
Std Deviation 0.61 0.09
Figure 5.10 : Scatter Plot of GLNR differences in closing prices
Table 5.10 Runs Test for GLNR stock prices 2001-2009 performed on a)Median b)Mean
ClosePrice
Test Value(a) 2.00
Cases < Test Value 1076
Cases >= Test Value 1187
Total Cases 2263
Number of Runs 93
Z -43.703
Asymp. Sig. (2-tailed) .000
Runs Test a) Median
ClosePrice
Test Value(a) 2.0855
Cases < Test Value 1369
Cases >= Test Value 894
Total Cases 2263
Number of Runs 105
Z -43.007
Asymp. Sig. (2-tailed) .000
Runs Test b) Mean
-0.8
-0.6
-0.4
-0.2
0
0.2
0.4
0.6
0.8
06
/12
/19
99
19
/04
/20
01
01
/09
/20
02
14
/01
/20
04
28
/05
/20
05
10
/10
/20
06
22
/02
/20
08
06
/07
/20
09
18
/11
/20
10
Difference
71
Figure 5.11 shows the closing prices for the JBG stock meanders and the differences plot
in Figure 5.12 also seem to follow a random process. This is confirmed by the standard
deviation of the closing prices being larger than the standard deviation of the differences
shown in Table 5.11 and further validated by significance value of the runs test being less
than 0.05, shown in Table 5.12
Figure 5.11 : Scatter Plot of JBG closing prices
0
1
2
3
4
5
6
7
8
06
/12
/19
99
19
/04
/20
01
01
/09
/20
02
14
/01
/20
04
28
/05
/20
05
10
/10
/20
06
22
/02
/20
08
06
/07
/20
09
18
/11
/20
10
C
l
o
s
i
n
g
p
r
i
c
e
$
Day
JBG:ClosePrice
72
Table 5.11 : Statistical comparison of JBG closing prices vs differences
Statistic ClosePrice Differences
Mean 3.42 0.00
Standard Error 0.03 0.00
Median 3.48 0.00
Mode 3.50 0.00
Std Deviation 1.38 0.12
Figure 5.12 : Scatter Plot of JBG differences in closing prices
Table 5.12 Runs Test for JBG stock prices 2001-2009 performed on a) Median b) Mean
ClosePrice
Test Value(a) 3.5
Cases < Test Value 1126
Cases >= Test Value 1137
Total Cases 2263
Number of Runs 70
Z -44.680
Asymp. Sig. (2-tailed) .000
Runs Test a) Median
ClosePrice
Test Value(a) 3.416
Cases < Test Value 1100
Cases >= Test Value 1163
Total Cases 2263
Number of Runs 64
Z -44.930
Asymp. Sig. (2-tailed) .000
Runs Test b) Mean
-1.2
-1
-0.8
-0.6
-0.4
-0.2
0
0.2
0.4
0.6
0.8
1
06
/12
/19
99
19
/04
/20
01
01
/09
/20
02
14
/01
/20
04
28
/05
/20
05
10
/10
/20
06
22
/02
/20
08
06
/07
/20
09
18
/11
/20
10
Difference
73
Figure 5.13 shows the closing prices for the JMMB stock meanders and the differences
plot in Figure 5.14 also seem to follow a random process. This is confirmed by the
standard deviation of the closing prices being larger than the standard deviation of the
differences shown in Table 5.13 and further validated by significance value of the runs
test being less than 0.05, shown in Table 5.14
Figure 5.13 : Scatter Plot of JMMB closing prices
Table 5.13 : Statistical comparison of JMMB closing prices vs differences
Statistic ClosePrice Differences
Mean 11.05 0.00
Standard Error 0.10 0.01
Median 10.61 0.00
Mode 11.00 0.00
Std Deviation 4.23 0.34
0
5
10
15
20
25
19
/04
/20
01
01
/09
/20
02
14
/01
/20
04
28
/05
/20
05
10
/10
/20
06
22
/02
/20
08
06
/07
/20
09
18
/11
/20
10
Closing Price $
Day
JMMB:ClosePrice
74
Figure 5.14 : Scatter Plot of JMMB differences in closing prices
Table 5.14 Runs Test for JMMB stock prices 2001-2009 performed on a)Median b)Mean
ClosePrice
Test Value(a) 10.61
Cases < Test Value 883
Cases >= Test Value 883
Total Cases 1766
Number of Runs 43
Z -40.036
Asymp. Sig. (2-tailed) .000
Runs Test a) Median
ClosePrice
Test Value(a) 11.0451
Cases < Test Value 985
Cases >= Test Value 781
Total Cases 1766
Number of Runs 21
Z -41.071
Asymp. Sig. (2-tailed) .000
Runs Test b) Mean
-2.5
-2
-1.5
-1
-0.5
0
0.5
1
1.5
2
2.5
3
19
/04
/20
01
01
/09
/20
02
14
/01
/20
04
28
/05
/20
05
10
/10
/20
06
22
/02
/20
08
06
/07
/20
09
18
/11
/20
10
Difference
75
Figure 5.15 shows the closing prices for JP stock meanders and the differences plot in
5.16 also seem to follow a random process. This is confirmed by the standard deviation
of the closing prices being larger than the standard deviation of the differences shown in
Table 5.15 and further validated by significance value of the runs test being less than
0.05, shown in Table 5.16
Figure 5.15 : Scatter Plot of JP closing prices
Table 15. : Statistical comparison of JP closing prices vs differences
Statistic ClosePrice Differences
Mean 6.37 0.00
Standard Error 0.08 0.01
Median 4.51 0.00
Mode 3.00 0.00
Std. Deviation 3.83 0.25
0
10
20
30
40
50
60
06
/12
/19
99
19
/04
/20
01
01
/09
/20
02
14
/01
/20
04
28
/05
/20
05
10
/10
/20
06
22
/02
/20
08
06
/07
/20
09
18
/11
/20
10
Closing Price $
Day
JP:ClosePrice
76
Figure 5.16 : Scatter Plot of JP differences in closing prices
Table 5.16 Runs Test for JP stock prices 2001-2009 performed on a)Median b)Mean
ClosePrice
Test Value(a) 26.50
Cases < Test Value 1122
Cases >= Test Value 1141
Total Cases 2263
Number of Runs 41
Z -45.899
Asymp. Sig. (2-tailed) .000
Runs Test a) Median
ClosePrice
Test Value(a) 24.1051
Cases < Test Value 982
Cases >= Test Value 1281
Total Cases 2263
Number of Runs 48
Z -45.570
Asymp. Sig. (2-tailed) .000
Runs Test b) Mean
-8
-6
-4
-2
0
2
4
6
8
06
/12
/19
99
19
/04
/20
01
01
/09
/20
02
14
/01
/20
04
28
/05
/20
05
10
/10
/20
06
22
/02
/20
08
06
/07
/20
09
18
/11
/20
10
Diff
77
Figure 5.17 shows the closing prices for the LIME stock meanders and the differences
plot in Figure 5.18 also seem to follow a random process. This is confirmed by the
standard deviation of the closing prices being larger than the standard deviation of the
differences shown in Table 5.17 and further validated by significance value of the runs
test being less than 0.05, shown in Table 5.18
Figure 5.17 : Scatter Plot of LIME closing prices
Table 5.17 : Statistical comparison of LIME closing prices vs differences
Statistic ClosePrice Differences
Mean 1.09 0.00
Standard Error 0.01 0.00
Median 0.99 0.00
Mode 0.80 0.00
Std Deviation 0.44 0.04
0
0.5
1
1.5
2
2.5
3
06
/12
/19
99
19
/04
/20
01
01
/09
/20
02
14
/01
/20
04
28
/05
/20
05
10
/10
/20
06
22
/02
/20
08
06
/07
/20
09
18
/11
/20
10
Close price $
Day
LIME ClosePrice
78
Figure 5.18 : Scatter Plot of LIME differences in closing prices
Table 5.18 Runs Test for LIME stock prices 2001-2009 performed on a)Median b)Mean
ClosePrice
Test Value(a) .99
Cases < Test Value 1123
Cases >= Test Value 1140
Total Cases 2263
Number of Runs 48
Z -45.605
Asymp. Sig. (2-tailed) .000
Runs Test a) Median Runs Test b) Mean
ClosePrice
Test Value(a) 1.0861
Cases < Test Value 1285
Cases >= Test Value 978
Total Cases 2263
Number of Runs 40
Z -45.911
Asymp. Sig. (2-tailed) .000
-1
-0.8
-0.6
-0.4
-0.2
0
0.2
0.4
0.6
0.8
1
06
/12
/19
99
19
/04
/20
01
01
/09
/20
02
14
/01
/20
04
28
/05
/20
05
10
/10
/20
06
22
/02
/20
08
06
/07
/20
09
18
/11
/20
10
Differences
79
Figure 5.19 shows the closing prices for the NCB stock meanders and the differences plot
in Figure 5.20 also seem to follow a random process. This is confirmed by the standard
deviation of the closing prices being larger than the standard deviation of the differences
shown in Table 5.19 The significance value of the runs test is less than 0.05, shown in
Table 5.20, further validating conformance to the random walk model.
Figure 5.19 : Scatter Plot of NCB closing prices
Table 5.19 : Statistical comparison of NCB closing prices vs differences
Statistic ClosePrice Difference
Mean 15.52543526 0.005411141
Standard Error 0.144136104 0.009032501
Median 16.2 0
Mode 23 0
Standard Deviation 6.856698544 0.429590163
0
5
10
15
20
25
30
35
06
/12
/19
99
00
:00
19
/04
/20
01
00
:00
01
/09
/20
02
00
:00
14
/01
/20
04
00
:00
28
/05
/20
05
00
:00
10
/10
/20
06
00
:00
22
/02
/20
08
00
:00
06
/07
/20
09
00
:00
18
/11
/20
10
00
:00
Closing Price $
Day
NCB:ClosePrice
80
Figure 5.20 : Scatter Plot of NCB differences in closing prices
Table 5.20 Runs Test for NCB stock prices 2001-9 performed on a)Median b)Mean
ClosePrice
Test Value(a) 16.20
Cases < Test Value 1126
Cases >= Test Value 1137
Total Cases 2263
Number of Runs 43
Z -45.815
Asymp. Sig. (2-tailed) .000
Runs Test a) Median
ClosePrice
Test Value(a) 15.5254
Cases < Test Value 1081
Cases >= Test Value 1182
Total Cases 2263
Number of Runs 24
Z -46.612
Asymp. Sig. (2-tailed) .000
Runs Test b) Mean
-4
-3
-2
-1
0
1
2
3
4
06
/12
/19
99
00
:00
19
/04
/20
01
00
:00
01
/09
/20
02
00
:00
14
/01
/20
04
00
:00
28
/05
/20
05
00
:00
10
/10
/20
06
00
:00
22
/02
/20
08
00
:00
06
/07
/20
09
00
:00
18
/11
/20
10
00
:00
NCB: Difference
81
5.3.2 Period II: 2010-2014
This section shows the runs test results for the ten stocks in period II. All had a
significance value less than 0.05 and therefore conformed to the random walk model. The
results are shown in Tables 5.21-5.31 for each stock.
CAR
Table 5.21 Runs Test Results for CAR stock prices 2010-14 performed on
a)Median b)Mean
ClosePrice
Test Value(a) 53.02
Cases < Test Value 564
Cases >= Test Value 565
Total Cases 1129
Number of Runs 27
Z -32.067
Asymp. Sig. (2-tailed) .000
Runs Test a) Median
ClosePrice
Test Value(a) 52.3376
Cases < Test Value 513
Cases >= Test Value 616
Total Cases 1129
Number of Runs 31
Z -31.814
Asymp. Sig. (2-tailed) .000
Runs Test b) Mean
CCC
Table 5.22 Runs Test Results for CCC stock prices 2010-14 performed on
a)Median b)Mean
ClosePrice
Test Value(a) 2.51
Cases < Test Value 558
Cases >= Test Value 571
Total Cases 1129
Number of Runs 22
Z -32.365
Asymp. Sig. (2-tailed) .000
Runs Test a) Median
ClosePrice
Test Value(a) 2.5602
Cases < Test Value 582
Cases >= Test Value 547
Total Cases 1129
Number of Runs 28
Z -32.006
Asymp. Sig. (2-tailed) .000
Runs Test b) Mean
82
DG
Table 5.23 Runs Test Results for DG stock prices 2010-14 performed on
a)Median b)Mean
ClosePrice
Test Value(a) 4.20
Cases < Test Value 564
Cases >= Test Value 579
Total Cases 1143
Number of Runs 40
Z -31.515
Asymp. Sig. (2-tailed) .000
Runs Test a) Median
ClosePrice
Test Value(a) 4.1986
Cases < Test Value 564
Cases >= Test Value 579
Total Cases 1143
Number of Runs 40
Z -31.515
Asymp. Sig. (2-tailed) .000
Runs Test b) Mean
GK
Table 5.24 Runs Test Results for GK stock prices 2010-14 performed on
a)Median b)Mean
ClosePrice
Test Value(a) 55.0
Cases < Test Value 548
Cases >= Test Value 581
Total Cases 1129
Number of Runs 32
Z -31.768
Asymp. Sig. (2-tailed) .000
Runs Test a) Median
ClosePrice
Test Value(a) 54.933
Cases < Test Value 544
Cases >= Test Value 585
Total Cases 1129
Number of Runs 34
Z -31.648
Asymp. Sig. (2-tailed) .000
Runs Test b) Mean
83
GLNR
Table 5.25 Runs Test Results for GLNR stock prices 2010-14 performed on
a)Median b)Mean
ClosePrice
Test Value(a) 1.40
Cases < Test Value 505
Cases >= Test Value 624
Total Cases 1129
Number of Runs 21
Z -32.411
Asymp. Sig. (2-tailed) .000
Runs Test a) Median
ClosePrice
Test Value(a) 1.5117
Cases < Test Value 711
Cases >= Test Value 418
Total Cases 1129
Number of Runs 21
Z -32.341
Asymp. Sig. (2-tailed) .000
Runs Test b) Mean
JBG
Table 5.26 Runs Test Results for JBG stock prices 2010-14 performed on
a)Median b)Mean
ClosePrice
Test Value(a) 5.00
Cases < Test Value 510
Cases >= Test Value 633
Total Cases 1143
Number of Runs 53
Z -30.710
Asymp. Sig. (2-tailed) .000
Runs Test a) Median
ClosePrice
Test Value(a) 5.4508
Cases < Test Value 656
Cases >= Test Value 487
Total Cases 1143
Number of Runs 7
Z -33.461
Asymp. Sig. (2-tailed) .000
Runs Test b) Mean
84
JMMB
Table 5.27 Runs Test Results for JMMB stock prices 2010-14 performed on
a)Median b)Mean
ClosePrice
Test Value(a) 8
Cases < Test Value 560
Cases >= Test Value 569
Total Cases 1129
Number of Runs 17
Z -32.663
Asymp. Sig. (2-tailed) .000
Runs Test a) Median
ClosePrice
Test Value(a) 7.24
Cases < Test Value 503
Cases >= Test Value 626
Total Cases 1129
Number of Runs 21
Z -32.411
Asymp. Sig. (2-tailed) .000
Runs Test b) Mean
JP
Table 5.28 Runs Test Results for JP stock prices 2010-14 performed on
a)Median b)Mean
ClosePrice
Test Value(a) 20.40
Cases < Test Value 569
Cases >= Test Value 574
Total Cases 1143
Number of Runs 18
Z -32.817
Asymp. Sig. (2-tailed) .000
Runs Test a) Median
ClosePrice
Test Value(a) 20.3158
Cases < Test Value 567
Cases >= Test Value 576
Total Cases 1143
Number of Runs 18
Z -32.817
Asymp. Sig. (2-tailed) .000
Runs Test b) Mean
85
LIME
Table 5.29 Runs Test for LIME stock prices 2010-2014 performed on a)Median b)Mean
ClosePrice
Test Value(a) .20
Cases < Test Value 485
Cases >= Test Value 644
Total Cases 1129
Number of Runs 43
Z -31.064
Asymp. Sig. (2-tailed) .000
Runs Test a) Median
Runs Test b) Mean
ClosePrice
Test Value(a) .2508 Cases < Test Value 713 Cases >= Test Value 416 Total Cases 1129 Number of Runs 5 Z -33.362 Asymp. Sig. (2-tailed)
.000
NCBJ
Table 5.30 Runs Test for NCB stock prices 2010-2014 performed on a)Median b)Mean
ClosePrice
Test Value(a) 20
Cases < Test Value 560
Cases >= Test Value 569
Total Cases 1129
Number of Runs 37
Z -31.472
Asymp. Sig. (2-tailed) .000
Runs Test a) Median Runs Test b) Mean
ClosePrice
Test Value(a) 20.85 Cases < Test Value 685 Cases >= Test Value 444 Total Cases 1129 Number of Runs 21 Z -32.369 Asymp. Sig. (2-tailed)
.000
5.4 Hurst Exponent & Periods of Predictability
This section uses the aforementioned Hurst exponent to identify periods of predictability
over the period 2001-2014. The Hurst exponent ranges between zero and one. Sample
Periods of 250 trading days, approximately one year, were randomly chosen from periods
I and II and the Hurst exponent computed to determine predictability.
NCB
Figure 5.21 shows the Hurst exponent of NCB closing prices for 2008 with a trend line
attached. As indicated by the Hurst exponent below 0.5 for most of the year, prices were
86
generally predictable as they were in the limited range of $20-25, thus rejecting the
random walk model. Between February and July the trend line for the Hurst exponent
was also consistent.
Figure 5.21 Hurst Exponent of NCB closing prices for 2008
LIME
Figures 5.22, 5.23 and 5.24. show the LIME Hurst values were generally between 0.65
and 0.8 for 2001-3. In 2004 the predictability declined, as indicated by a low of almost
0.58, but was still above 0.5; the threshold which indicates a perfectly random model.
See Figure 5.25.
-0.2
-0.1
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
14
/11
/20
07
03
/01
/20
08
22
/02
/20
08
12
/04
/20
08
01
/06
/20
08
21
/07
/20
08
09
/09
/20
08
29
/10
/20
08
18
/12
/20
08
06
/02
/20
09
NCB HURST H
87
Figure 5.22 Hurst Exponent of LIME closing prices for 2001
Figure 5.23 Hurst Exponent of LIME closing prices for 2002
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
20
-No
v-0
0
09
-Jan-0
1
28
-Feb
-01
19
-Ap
r-01
08
-Jun-0
1
28
-Jul-0
1
16
-Sep
-01
05
-No
v-0
1
25
-Dec-0
1
13
-Feb
-02
LIME 2001 HURST H
0.69
0.7
0.71
0.72
0.73
0.74
0.75
0.76
0.77
0.78
0.79 0
5-N
ov-0
1
25
-Dec-0
1
13
-Feb
-02
04
-Ap
r-02
24
-May
-02
13
-Jul-0
2
01
-Sep
-02
21
-Oct-0
2
10
-Dec-0
2
29
-Jan-0
3
LIME 2002 HURST H
88
Figure 5.24 Hurst Exponent of LIME closing prices for 2003
Figure 5.25 Hurst Exponent of LIME closing prices for 2004
0.69
0.695
0.7
0.705
0.71
0.715
0.72
0.725
0.73
0.735
10
-Dec-0
2
29
-Jan-0
3
20
-Mar-0
3
09
-May
-03
28
-Jun-0
3
17
-Aug-0
3
06
-Oct-0
3
25
-No
v-0
3
14
-Jan-0
4
04
-Mar-0
4
LIME 2003 HURST H
0.56
0.58
0.6
0.62
0.64
0.66
0.68 2
5-N
ov-0
3
14
-Jan-0
4
04
-Mar-0
4
23
-Ap
r-04
12
-Jun-0
4
01
-Aug-0
4
20
-Sep
-04
09
-No
v-0
4
29
-Dec-0
4
17
-Feb
-05
LIME 2004 HURST H
89
CAR
An examination of the Hurst exponent rejected the random walk hypothesis for the sub-
period 2001to 2004 within Period I. Figure 5.26 shows the scatter plot of the CAR over
the sub-period.
Figure 5.26 Scatter plot of CAR over the sub-period 2001-2004
Table 5.31 Runs Test Results for CAR stock prices 2001-4 performed on
a)median b)Mean
ClosePrice
Test Value(a) 32
Cases < Test Value 491
Cases >= Test Value 517
Total Cases 1008
Number of Runs 187
Z -20.034
Asymp. Sig. (2-tailed) .000
Runs Test a) Median
ClosePrice
Test Value(a) 27.57
Cases < Test Value 232
Cases >= Test Value 776
Total Cases 1008
Number of Runs 239
Z -10.605
Asymp. Sig. (2-tailed) .000
Runs Test b) Mean
0
10
20
30
40
50
60
01
/10
/20
00
19
/04
/20
01
05
/11
/20
01
24
/05
/20
02
10
/12
/20
02
28
/06
/20
03
14
/01
/20
04
01
/08
/20
04
17
/02
/20
05
05
/09
/20
05
Close price $
Day
CAR:ClosePrice
90
Figure 5.27 Hurst Exponent of CAR closing prices for 2002
The CAR visual test and runs test for the sub-period (Table 5.31) failed to reject the
random walk hypothesis. As Chatfield 2004 indicated, a runs test may indicate correlation
of prices. Hence, the Hurst was computed for the same sub-period. Thus Figure 5.27 and
5.28 below shows the Hurst exponent of the CAR stock on closing prices for 2002 and
2004 were above 0.5. Here, the visual test and runs tests failed to identify the
predictability of the stock. In 2002, the second half of the year Hurst exceeded 0.58
(Figure 5.27). In Figure 5.28, the first three months in 2004 has the higher exponent over
the period, above 0.58 and would therefore have been more predictable than April to
September which lingered below 0.54.
0.53
0.54
0.55
0.56
0.57
0.58
0.59
0.6
0.61
0.62
05
-No
v-0
1
25
-Dec-0
1
13
-Feb
-02
04
-Ap
r-02
24
-May
-02
13
-Jul-0
2
01
-Sep
-02
21
-Oct-0
2
10
-Dec-0
2
29
-Jan-0
3
CAR 256-507 2002 HURST H
91
Figure 5.28 Hurst Exponent of CAR closing prices for 2004
Figure 5.29 shows Hurst Exponent on close prices for the GLNR stock in 2002. The
stock exhibited characteristics of an anti-persistent or mean-reverting series, indicated by
an exponent below 0.5 for the entire year.
0.52
0.54
0.56
0.58
0.6
0.62
0.64
25
-No
v-0
3
14
-Jan-0
4
04
-Mar-0
4
23
-Ap
r-04
12
-Jun-0
4
01
-Aug-0
4
20
-Sep
-04
09
-No
v-0
4
29
-Dec-0
4
17
-Feb
-05
CAR 2004
92
Figure 5.29 Hurst Exponent on close prices for the GLNR stock in 2002
5.5 Analysis of Results
In this section we compared the three methods used to determine whether to accept or
reject the random walk hypothesis: namely the runs test, visual test and the Hurst
exponent. The statistical runs and visual test proved to be less accurate than the Hurst
exponent. In the sub-period 2001-4, CAR and GLNR did not exhibit random walk. This
is evidenced by the Hurst exponent being above and below 0.5 respectively.
Identifying periods of predictability by Hurst exponent was found to be more effective
than the statistical tests. The anti-persistence of the GLNR stock may account for the runs
tests failing to reject the random walk model.
0.38
0.385
0.39
0.395
0.4
0.405
0.41
0.415
05
-No
v-0
1
25
-Dec-0
1
13
-Feb
-02
04
-Ap
r-02
24
-May
-02
13
-Jul-0
2
01
-Sep
-02
21
-Oct-0
2
10
-Dec-0
2
29
-Jan-0
3
GLNR 2002
93
5.6 Summary
Over longer time periods the JSE was found to exhibit random walk. This was confirmed
by both the runs test and visual test comparing the standard deviation of close prices and
their differences. Also, Hurst exponent was close to 0.5 for both periods I and II for all
stocks. However, small to medium periods were found to reject the random walk theory
as confirmed by the Hurst exponent computed for CAR and GLNR 2001-2004, NCB
February to July 2008, and LIME several months between 2001-2003.
94
CHAPTER 6: EXPERIMENTAL RESULTS I - Statistical vs Machine Learning Methods
6.1 Introduction
This section describes machine learning approaches such as Naive Bayes (NB), artificial
neural networks (ANN), decision trees (DT) and support vector machines (SVM) used to
predict indices of the Jamaica Stock Exchange (JSE). The predictions include trend of the
seven indices, volume and prices of blue chip stocks trading on the JSE.
Only one previous work, Serju (2000), describes neural network approaches used
to predict the Jamaican financial market which focused on forecasting core inflation rate
from oil prices, treasury bills, exchange rate and base money. The use of neural nets as a
successful financial predictor has been suggested by Chakraborty & Sharma (2007).
Stocks were not included in that study.
Machine learning approaches used in the JSE predictions include neural networks,
support vector machines and linear regression for continuous data prediction as well as
decision trees, neural networks and Naïve Bayes for binary predictions and multiclass
discrete data. Trading data over the 22 month period from January 2010 - November
2011 was formatted to do three types of predictions: prices, movement and volume.
i. Closing ask prices of companies and their respective shares- This dataset includes
44 companies that trade 59 instruments on the JSE. Some companies trade up to 4
securities. The trading period is from January 10, 2010 to November 11, 2011
totaling 10,158 instances. The predictions were done using linear regression and
95
neural networks. The results are shown in Table 6.1. Test mode was split 66.0%
train, remainder test; as given the time series nature of the dataset, cross fold
validations were not used in the experiments discussed here and in Chapter 7.
ii. Movement of seven indices. This binary prediction was done using decision trees,
neural networks and Naïve Bayes. This is shown in Tables 6.2 and 6.3.
iii. Volume of ten blue chip stocks: There are 14 blue chips stocks in a select index
fund that are deemed to be most liquid by brokerage firm JMMB as shown in
Table IV. Eight of these stocks were selected for volume predictions: CAR, CCC,
CWJ (later traded as LIME), DG, GK, GLNR, JMMB and JP. The results are
shown in Table 6.4.
Table 6.1
Price Prediction of Various Companies on the JSE Statistical
Parameters
Linear
Regression
Multilayer
Perceptron
CC
MAE
RMSE
RAE
RRSE
0.9284
7.1556
20.0838
25.5137 %
37.1844 %
0.9502
7.5095
17.6571
26.7758 %
32.6916 %
KEY
CC-Correlation coefficient
MAE- Mean absolute error
RMSE-Root mean squared error
RAE-Relative absolute error
RRSE-Root relative squared error
A. Description of Statistical Parameters
Correlation coefficient (CC), measures the strength and the direction of a linear
relationship between two variables. A correlation greater than 0.8 is generally viewed
as strong, while a correlation coefficient less than 0.5 is generally described as weak. A
96
high correlation coefficient is therefore a necessary condition for the accuracy our price
predictions.
Mean absolute error (MAE) : This measures the average magnitude of the errors in a set
of forecasts, without considering their direction. In other words, it is the average over the
verification sample of the absolute values of the differences between forecast and the
corresponding observation.
Root mean squared error (RMSE): This is a quadratic scoring rule which measures the
average magnitude of the error. In simple terms, the difference between forecast and
corresponding observed values are each squared and then averaged over the sample; then
the square root of the average is taken. Since the errors are squared before they are
averaged, the RMSE gives a relatively high weight to large errors. The RMSE proves
most useful when large errors are particularly undesirable.
Relative absolute error (RAE) The relative absolute error take the total absolute error and
normalizes it then divides by the MAE.
While correlation coefficient is high , based on the nature of our predictions, including
continuous variables for prices, MAE is deemed most significant and an algorithm with
the lowest MAE is considered the most desirable .
97
Table 6.2
Movement prediction of various indices of all and main JSE index. Index Scheme M N Accuracy
(%)
All* DT 0 880 100
All* ANN 0.44 880 35
All* NB 0.13 880 85
1 DT 0 162 100
1 ANN 0.13 162 89
1 NB 0.25 162 77
KEY
*All refers to all seven indices
M -Mean absolute error
N- number of Instances
Table 6.3
Movement prediction of JSE Select (2), All Jamaican Composite (3), Cross Listed
Index(4), Junior Market Index(5), Combined Index (6) and US Equities Index (7) Index Scheme Instances Mean
Absolute
Error
Correctly
Classified
Instances (%)
2 NB 162 0.1175 90
2 DT 162 0 100
2 ANN 162 0.04 95
3 NB 162 0.1663 91
3 DT 162 0 100
3 ANN 162 0.0817 93
4 NB 162 0.0409 93
4 DT 162 0 100
4 ANN 162 0.0476 93
5 NB 162 0.1475 77
5 DT 162 0. 100
5 ANN 162 0.1219 84
6 NB 55 0.1081 91
6 DT 55 0.0364 96
6 ANN 55 0.1125 89
7 NB 16 0.1587 81.2
7 DT 16 0 100
7 ANN 16 0.193 75
6.2 Results
In order to avoid over fitting, neural network experiments unless otherwise stated
had the following parameters: learning rate: 0.3, momentum: 0.2, training time: 2500, and
validation threshold: 20.
98
A. Price prediction
Table 6.1 shows the results of the closing ask price prediction of all companies that trade
on the JSE for the period January 2010 to November 2011. The data set includes 29,876
instances and uses the following nine attributes: Stock-Code, Value-Date, Last-Price,
Previous-Price, Price-Change, Percentage-Change, Volume-Traded, Year-High and
Year-Low.
B. Movement prediction
The seven indices on the JSE are:
1 JSE Market Index (Main Index )
2 JSE Select Index (JSE Select)
3 JSE All Jamaican Composite (All Jamaican )
4 JSE Cross Listed Index (Cross Listed)
5 JSE Junior Market Index (JSE Junior )
6 JSE Combined Index (Combined Index)
7 JSE US Equities Index (US Equities )
For each of the indices the following 12 attributes were used: Value-Date, Value,
Value-Change, Percentage-Change, Volume-Traded, Year-High, Year-Low,
YearToDate, QuarterToDate, MonthToDate, WeekToDate and Movement.
Table 6.2 shows the results of the movement prediction of companies on all seven indices
as well as the main index. Table 6.3 shows Movement on all remaining indices. Two
99
hidden layers and a training time of 1500 were used for the neural network experiments
in Table 6.3.
Table 6.4
JMMB Select Blue Chip stocks Registered Company Trading Symbol Sector Sharesholding
*Bank Of Nova Scotia
Jamaica Ltd.
BNSJ Investment 3,630,464
Cable & Wireless
Jamaica Limited
CWJA or LIME Communication 10,943,953
Caribbean Cement
Company Limited
CCC Production 1,059,917
Carreras Group
Limited
CAR Conglomerate 604,516
*Courts Jamaica
Limited
CRTS Furniture &
Appliance
Retailer
2,976,582
Desnoes & Geddes
Limited
DG Conglomerate 3,498,249
*Dehring, Bunting &
Golding Limited
DBG Investment 357,296
Gleaner Company
Limited
GLNR Communication 1,508,356
GraceKennedy GK Conglomerate 403,225
Jamaica Broilers
Group Limited
JBG Production 1,493,454
Jamaica Money
Market Brokers
JMMB Investment 2,107,780
Jamaica Producers
Group Limited
JP Production 232,820
*Life of Jamaica LOJ Investment 3,511,516
NCB Jamaica Limited NCBJ Investment 3,067,441
* Data were unavailable for these four companies. DBG merged with BNSJ
C. Predicting Company Volume
The volume was predicted for eight blue chip stocks on the JSE shown below in Table
6.4. Since the prediction accuracy was a mere 13% on the continuous data, Table 6.5 was
used to discretize the continuous volume data to gain an improvement on the prediction
100
accuracy. It was also found that support vector machine (SVM) had a higher accuracy
and lower MAE than neural networks. Hence, SVM was used for experiments in Table
6.5. As shown in Chapter 2, feature discretization uses thresholds to convert continuous
values to discrete ones. There were 261 instances and 6 attributes: Number iincrementally
replaces date), LastPrice, ClosePrice, Change dollar value, ChangePercent, VolumeDisc
(Discretized volume as shown in Table 6.5. The results are shown in Table 6.6.
6.3 Analysis of Results
In this study, the decision trees were found to have 100% accuracy in predicting
movements of all seven indices. Naïve Bayes’ accuracy ranged from 77% to 93% .
Neural networks outperformed linear regression in predicting prices, whereas decision
trees were more accurate in the binary movement prediction. SVM combined with
discretization proved the most effective method for volume prediction.
A. Price Prediction
In price prediction, neural network had a higher correlation coefficient (0.97) than linear
regression and a similar lower mean absolute error, as shown in Table 6.1.
B. Movement Prediction
Decision trees have 100 percent accuracy on predicting movement on all seven indices
except the combined index where the accuracy was 96%. Naïve Bayes had 77-93%
accuracy on index two to seven and 85% on the main index.
Tables 6.2 and 6.3 indicate that while neural networks had a lower prediction accuracy on
the movement of the combined and US indices, the mean absolute error was also higher
making it a slighter weaker predictor than Naïve Bayes and decision tree. The 35%
101
accuracy obtained on neural networks prediction on all seven indices is odd, but can be
favorably countered. Since movement is a binary prediction, and the historical accuracy
is known to be low, one could simply assume the opposite trend and 65% accuracy would
be achieved. Kim ((2008) conducted an empirical study comparing decision trees,
artificial neural networks, and linear regression methods based on the number and types
of independent variables and sample size. It concluded that for continuous and
categorical independent variables, linear regression was best when the number of
categorical variables was one, while the artificial neural network was superior when the
number of categorical variables was two or more. Also, the artificial neural network
performance improved faster than that of the other methods as the number of classes of
categorical variable increased. This supports the theory that ANNs perform better on
multiclass predictions (three or more classes) than binary predictions, as evidenced by
these results.
Table 6.5
Categories of Volume Indices Volume Classifier ID
0 K
500 J
1000 I
5000 H
10000 G
100000 F
500000 E
1000000 D
10000000 C
50000000 B
10000000 A
102
C. Volume Prediction
Table 6.6 reveals that of the eight blue chip companies analyzed with neural networks,
only Jamaica Producers had an accuracy above 50%. This experiment was performed
using continuous data of actual volume traded. The volume data was discretized using
Table 6.5 and then SVM used to perform the predictions shown in Table 6.7 where seven
out of eight companies had an accuracy above 50%.
Table 6.6
Results of Eight Blue Chip Company Volume Predictions using Neural Networks
Company Hidden
layers
MAE Correctly
Classified
Instances (%)
CAR 2 0.0054 13 CCC 2 0.0063 26 CWJ 2 0.0051 17
DG 2 0.0069 33 GLNR 2 0.0071 37 GK 2 0.0051 15 JMMB 2 0.01 20 JP 2 0.0073 52
Table 6.7
Volume Predictions of Blue Chip Companies Using SMO SVM Polykernel
Kernel
Evaluations
Accuracy
(%)
Precision Recall MAE
CAR 55 60 0.734 0.6 0.19
CCC 1225 70 0.744 0.695 0.19
CWJ 210 41 0.397 0 .413 0.20
DG 45 72 0.697 0.719 0.18
GLNR 231 66 0.696 0.665 0.17
GK 28 52 0.531 0.525 0.18
JMM
B
55 51 .657 0.419 0.18
JP 55 73 0.657 0.517 0.19
103
Table 6.7 shows the SVM results for predicting company volume. CCC had an
accuracy of 70% with a precision of .744 and recall of 0.695. DG had an accuracy of
72% with a precision of 0.697. Among the blue chip companies, only CWJ had an
accuracy of less than 50%.
6.4 Conclusion/Summary
The results reveal that neural networks are better at predicting continuous data such as
prices and volume traded and less accurate at binary prediction of stock movement. Other
predictors such as decision trees and Naïve Bayes were more accurate at predicting the
movement of the stock based on historical data. This concurs with the empirical study by
Kim (2008).
The movement prediction accuracy of almost 100% by decision trees and price
prediction of 0.97 correlation coefficient for 22 month dataset seem reasonable. SVM
volume prediction accuracy of up to 73% on a 13 year dataset is promising.
The success of a stock is also dependent on the number of investors. Hence the
importance of volume predictions. The discretization method used proved quite effective
in increasing the accuracy of volume predictions. While the prediction accuracy was a
mere 13% on the continuous data, after using Table 6.5 to discretize the continuous
volume data, the prediction accuracy improved to above 50% for seven of the eight blue
chip stocks listed Table 6.7. The 41% accuracy for the CWJ (LIME) stock could be
attributed to competition faced by CWJ after the government lifted the decades old
monopoly for telecommunications which they previously enjoyed.
104
6.5 Confusion Matrices
The confusion matrices shown in Tables 6.8, 6.9 and 6.10 indicate that errors dominate in
two adjacent categories. It is anticipated the errors can be reduced by merging both
categories. In converting the continuous type volume predictions to discrete form, the
same range was used for all companies. Some companies trading have a lower range than
others.
Table 6.8
Confusion matrix for CCC Confusion matrix for CCC
a b c d e f g h <-- classified as
0 0 0 1 0 0 0 0 | a = E
0 46 0 3 0 0 0 0 | b = K
0 0 11 19 0 0 0 0 | c = I
0 0 0 52 0 0 0 0 | d = G
0 0 0 12 4 0 0 0 | e = H
0 0 0 5 0 0 0 0 | f = D
0 0 0 0 0 0 3 0 | g = J
0 0 0 11 0 0 0 0 | h = F
Table 6.9
Confusion matrix for Grace Kennedy Conglomerate Grace Confusion matrix
a b c d e f g h i <--
classified as
10 0 5 85 0 0 0 0 0 | a = I
1 0 2 12 0 0 0 0 0 | b = J
5 0 10 58 0 0 0 0 0 | c = K
11 0 7 140 3 0 0 0 0 | d = G
2 0 1 45 0 0 0 0 0 | e = H
2 0 3 57 0 0 0 0 0 | f = F
1 0 0 9 0 0 0 0 0 | g = D
1 0 0 4 0 0 0 0 0 | h = E
0 0 0 2 0 0 0 0 0 | i = C
105
Table 6.10
Confusion matrix for Jampro Conglomerate JP Confusion matrix
a b c d e f g h <--
classified as
11 102 0 0 0 0 0 0 | a = K
15 136 0 0 0 0 0 0 | b = G
10 95 0 0 0 0 0 0 | c = I
6 50 0 0 0 0 0 0 | d = H
3 31 0 0 0 0 0 0 | e = F
1 3 0 0 0 0 0 0 | f = E
0 1 0 0 0 0 0 0 | g = D
3 24 0 0 0 0 0 0 | h = J
6.6 Acknowledgment
Some of these results are published in the paper A Machine Learning Predictive Model for
the Jamaica Frontier Market in the Proceedings of the 2015 Int'l Conference of Data Mining and
Knowledge Engineering by IAENG(ISBN978-888-19253-4-3) .
106
CHAPTER 7: EXPERIMENTAL RESULTS II SentAMaL- A Sentiment
Analysis Machine Learning Stock Predictive Model
7.1 Overview
Chapter three provided a review of semantic web and sentiment based approaches
designed for stock prediction. The architectural design of SentAMaL was then detailed in
Section 4.2. This chapter provides the experimental results obtained using SentAMaL and
compares those results to Chapter 6.
7.2 Results
Table 7.1 shows the non-sentiment based price prediction of all companies that traded on
the JSE within the two month period while Table 7.2 shows the price prediction of only
the five relevant companies that are perceived would be impacted by sentiments derived
from the marijuana tweets. These companies are distributors of medical, pharmaceutical
or tobacco products denoted on the JSE by the symbols: MDS, LASM, LASD, JP and
CAR.
As shown in Table 7.1, SVM had a higher correlation coefficient and a lower mean
absolute error than the nreural network. Hence, SVM was used for to predict the prices of
the drug related companies assessed by SentAMaL in Table 7.2.
Table 7.3 shows movement prediction of the various indices of the various indices using
SentAMaL. The number of instances for the seven indices combined was 2233, while
107
each of the seven indices had 68 instances. While ANN had a slighter higher accuracy for
than SVM for all the indices tested, the error was also marginally higher. This denotes the
robustness of the SVM classification technique. Decision Trees also proved the superior
binary classifier among the three.
Table 7.1
Price Prediction of All Companies on the JSE Multilayer
Perceptron
SVM
CC MAE RMSE RAE RRSE
0.8105 3.9919 26.6466
28.7234 % 69.7462 %
0.9954 1.6108 3.7976
11.5907 % 9.94 %
Total Number of Instances 1196 KEY
CC-Correlation coefficient
MAE- Mean absolute error
RMSE-Root mean squared error
RAE-Relative absolute error
RRSE-Root relative squared error
Table 7.2
Price Prediction of Drug Related Companies on the JSE SVM
SentAMaL
SVM
without
SentAMaL
CC MAE RMSE RAE RRSE
0.9985 0.5051 0.8727
3.5071 % 5.3691 %
0.9956 0.7652 1.5402
5.3129 % 9.475 %
Total Number of Instances 59
108
Table 7.3
SentAMaL Movement prediction of various JSE indices : Main JSE index(1), JSE Select
(2), All Jamaican Composite (3), Cross Listed Index(4), Junior Market Index(5),
Combined Index (6) and US Equities Index (7)
Index Scheme M Accuracy
(%)
All* DT 0.092 99
All* ANN 0.078 89
All* SVM 0.265 87
1 DT 0.089 97
1 ANN 0.167 87
1 SVM 0.012 87
2 DT 0.014 99
2 ANN 0.156 93
2 SVM 0.074 91
3 DT 0.029 97
3 ANN 0.164 89
3 SVM 0.117 88
4 DT 0.022 95
4 ANN 0.117 85.2
4 SVM 0.025 84.1
5 DT 0.024 97
5 ANN 0.113 90
5 SVM 0.251 88
6 DT 0 100
6 ANN 0.192 88
6 SVM 0.111 90
7 DT 0.010 99
7 ANN 0.112 87
7 SVM 0.251 89
KEY
*All refers to all seven indices
M -Mean absolute error
7.3 Conclusion
Tweets had a significant impact on prediction. The MAE for SentAMaL is low, a mere
0.5, compared to 7 on price predictions without tweets in Table 6.1. It is likely that there
was not a greater difference in values between SentAMaL and its counterpart in Table 7.2
because the contents of the tweet corpus did not contain shocking content or a newsflash
as in the case of the false tweet which almost crashed the US market (CNN, 2013).
Although SentAMaL receives a similar correlation coefficient to its non-sentiment based
109
counterpart, its error is significantly lower than the purely quantitative model. This
indicates the accuracy of the SentAMaL model in using sentiment for its qualitative input
to complement the traditional quantitative input of most ML stock forecasting models.
7.4 Acknowledgment
Similar results performed with cross fold validation are published in the paper
SentAMaL- A Sentiment Analysis Machine Learning Stock Predictive Model in the
Proceedings of the 17th International Conference on Artificial Intelligence ISBN: 1-
60132-405-7 , 1-60132-406-5, CSREA Press .
110
CHAPTER 8: CONCLUSION
This chapter summarizes the main contributions of this research and gives
recommendations for future study.
8.1 Major Contributions
Stock prediction is by no means an exact science and many pundits believe it is virtually
impossible to accurately predict stocks because they follow a random walk. Also, based
on the efficient market hypothesis, the market is designed to correct itself over time so
any periods of predictability are usually short lived. Against this background, this
dissertation achieved the contributions outlined below:
i. Using the JSE dataset that covers the period 1st January 2001 - 30
th June 30 2014,
the entire period was tested for random walk using a trio of methods.
It was proven that periods of predictability exist within the stock market;
even where the main index is deemed to follow a random walk we used
sub-periods and gained high predictability. Specifically, CAR & GLNR
failed to accept the null hypothesis of randomness for the sub-period 2001
to 2004. LIME prices also proved predictable for the same sub-period with
an average Hurst exponent of 0.7, and topping 0.8 for some trading days in
2001.
111
ii. Experimental results show 90% accuracy in the movement prediction and 0.95
correlation coefficient for price prediction. Volume predictions were enhanced by
a discretization method and support vector machine to yield over 70% accuracy
for all but one of the stocks.
iii. The high accuracy in ML predictions can be justified by the Hurst exponent
indicators which proved more effective than statistical tests in identifying periods
of random walk.
iv. Although this dissertation has undertaken a longitudinal study of the JSE using
ML and statistical techniques, it has also taken a focal view and developed
SentAMaL architecture for accepting qualitative input in the form of tweets from
social media and analyzing these tweets as input to complement relevant
historical stock data. The architecture considered tweets based on a January 2015
legislation to make predictions for companies of the JSE that were most likely to
be impacted by the legalization of medical marijuana. Experimental results show
87% accuracy in the movement prediction and 0.99 correlation coefficient for
price prediction with a mean absolute error of 0.5.
8.2 Hypotheses
Hypothesis 1 :JSE main index follows a random walk.
As explained in Chapter five, blue chip companies that trade on the JSE main index were
found to follow a random walk for the periods 2001-2009 and 2010 -2014. However, this
hypothesis was rejected for CAR, GLR and LIME for the sub-period 2001-2004.
112
Hypothesis 2: Machine learning approaches are superior to statistical approaches for
forecasting JSE data.
This hypotheses proved to be true in all cases. In chapter six, it was demonstrated that the
ML approaches have a greater accuracy at predicting movement, prices and volume as
well as a lower error rate.
Hypothesis 3: Hybrid machine learning approaches are more accurate than individual
ones.
The hybrid ML approach pioneered for this study is SentAMaL which includes
qualitative input from tweets and other economic factors. Experimental results in Chapter
seven indicate that as a hybrid SentAMaL's accuracy was close to its non sentiment
based counterpart. However it had a lower mean absolute error and relative absolute error
on the dataset used.
8.3 Future Study /Recommendation
The qualitative input to SentAMaL could be improved by adding statements from
relevant news headlines posted in electronic media such as latest news sections of
national, regional and international media houses eg. Jamaica Gleaner, Radio Jamaica,
Caribbean Media Corporation (CaribVision), LOOP and CNN. These would prove to be
as concise and relevant as the current tweet input, and also increasing the variety and
potential authenticity of the qualitative input.
Granger's Causality analysis, or comparable alternate models, could be used to determine
extent to which stock prices are impacted by tweets.
113
Speculation is one of the factors influencing the foreign exchange rate and the IMF has
indicated that the Jamaican currency is overvalued. A future study could focus on
extending the SentAMaL architecture to predicting foreign exchange rates.
114
BIBLIOGRAPHY
Abounoori, E., & Tazehabadi, A. (2009). Forecasting stock price using macroeconomic
variables hybrid ADRL ARIMA neural network. International Conference on
Information and Financial Engineering,
Agbeyegbe, T. D. (1994). Some stylised facts about the Jamaica stock market. Social and
Economic Studies, , 143-156.
Antweiler, W., M. Frank. 2004. Is all that talk just noise? The information content of
Internet stock message boards. J. Finance 59(3) 1259–1295.
Asur, S., & Huberman, B. A. (2010). Predicting the future with social media. Web
Intelligence and Intelligent Agent Technology (WI-IAT), 2010 IEEE/WIC/ACM
International Conference on 1 492-499.
Bailey, W., R. Stulz, and S. Yen (1990) Properties of Daily Stock Returns from the
Pacific Basin Stock Markets. Pacific Basin Capital Market Research 155-171.
Baumgartner, R., Gatterbauer, W., & Gottlob, G. (2009). Web data extraction
system. Encyclopedia of Database Systems, , 3465-3471.
Bernhard, W., & Leblang, D. (2006). Democratic processes and financial markets:
Pricing politics Cambridge Univ Pr.
Blaine, C.(2013) Stocks drop on false tweet of White House explosion Retrieved
4/23/2013 from http://money.msn.com/top-stocks/post.aspx?post=a4b8243d-94ec-
432b-ae75-1750f850240f
Bodie, Z., Kane, A., & Marcus, A. (2011). Investments (ninth ed.) McGraw-Hill Irwinn.
Bogle, S.A. & Potter, W.D. (2015a) Machine Learning Predictive Model for the Jamaica
Frontier Market in the Proceedings of the 2015 Int'l Conference of Data Mining
and Knowledge Engineering by IAENG(ISBN978-888-19253-4-3) .
Bogle, S. A. and Potter, W. D. (2015b). SentAMaL- A Sentiment Analysis Machine
Learning Stock Predictive Model, Proceedings of the 17th International
Conference on Artificial Intelligence ISBN: 1-60132-405-7 , 1-60132-406-5,
CSREA Press
115
Bollen, J., Mao, H., & Zeng, X. (2011). Twitter mood predicts the
stock market. Journal of Computational Science, 2(1), 1-8.
Bonde, G., & Rasheed , R. (2012). Extracting the best features for predicting prices
usning mahcine learning. TBA,
Bonde, G., & Rasheed , R. (2012). Stock price prediction using genetic algorithms and
evolution strategies. TBA,
Bordino, I., Battiston, S., Caldarelli, G., Cristelli, M., Ukkonen, A., & Weber, I. (2012).
Web search queries can predict stock market volumes. PloS One, 7(7), e40014.
Chatfield, C.(2004) The analysis of time series :An Introduction CRC Press Chapman &
Hall :USA
CNN, (2013) Stocks plunge after twitter account hacked Retrieved 4/23/2013 from
http://www.cnn.com/video/#/video/us/2013/04/23/nr-stocks-plunge-after-ap-
twitter-acct- hacked.cnn
Dalton, J. M. (Ed.). (1993). How the stock market works Prentice Hall Pr.
Das, S. R., & Chen, M. Y. (2007). Yahoo! for amazon: Sentiment extraction from small talk on
the web. Management Science,53(9), 1375-1388.
De Gooijer, J. G., & Hyndman, R. J. (2006). 25 years of time series forecasting.
International Journal of Forecasting, 22(3), 443-473.
De Gooijer, J. G., & Hyndman, R. J. (2006). 25 years of time series forecasting.
International Journal of Forecasting, 22(3), 443-473.
Divecha, A., J. Drach, and D. Stefek (1992) Emerging Markets: A Quantitative
Perspective. Journal of Portfolio Management 19, 41-50.
Dorsey, T. J. (1995). Point and figure charting: The essential application for forecasting
and tracking market prices by
Doshi, L., Krauss, J., Nann, S., & Gloor, P. (2010). Predicting movie prices through
dynamic social network analysis. Procedia-Social and Behavioral Sciences, 2(4),
6423-6433.
Enke, D., Grauer, M., & Mehdiyev, N. (2011). Stock market prediction with multiple
regression, fuzzy type-2 clustering and neural networks. Procedia Computer
Science, 6, 201-206.
Fama E, and K. French (1988) Permanent and Temporary Components of Stock Prices.
The Journal of Political Economy 96, 246-273.
116
Harding D. (1995). Making Money from mathematical models. In Howison, S., Kelly,
F.P. & Wilmott, P. Mathematical Models in Finance (1st ed., pp. 61-66). London:
Chapman & Hall.
Howison, S., Kelly, F. P., & Wilmott, P. (1995). Mathematical models in finance
Chapman & Hall/CRC.
Hsu, C. M. (2011). A hybrid procedure for stock price prediction by integrating self-
organizing map and genetic programming. Expert Systems with Applications, 38(11),
14026-14036.
Insana, R. (2001). The message of the markets: How financial markets foretell the future-
-and how you can profit from their guidance HarperBusiness.
Jamaica Gleaner. 2002 Lascelles sells shares in Kingston Wharves over the counter
6/10/2012 from http://jamaica-
gleaner.com/gleaner/20020920/business/business4.html
Jamaica Gleaner. 2005 Cayman moves to protect locals in Dyoll saga Retrieved on
6/10/2012 from http://jamaica-
gleaner.com/gleaner/20050706/business/business7.html
Jamaica Gleaner. 2011 Dyoll Liquidators Settle Suit Against Canadian Reinsurer
Retrieved on 6/10/2012 from http://jamaicagleaner.com/gleaner/20110921/business/business3.html
Jamaica Gleaner. 2012 IMF chides Jamaica on lost JDX opportunity - Puts debt at 140%
of GDP Retrieved on 6/10/2012 from
http://jamaicagleaner.com/gleaner/20120610/business/business3.html
JSE (2011) Jamaica Stock Exchange Retrieved 12/05/2012 from
http://www.jamstockex.com/controller.php?action=about_exchange
Kiani, K. M. (2006). Predictability in stock returns in an emerging market: Evidence
from KSE 100 stock price index. The Pakistan Development Review, , 369-381.
Kim, K., & Han, I. (2000). Genetic algorithms approach to feature discretization in
artificial neural networks for the prediction of stock price index. Expert Systems with
Applications, 19(2), 125-132.
Kim, S., Jeon, S., Kim, J., Park, Y., & Yu, H. (2012). Finding core topics: Topic
extraction with clustering on tweet. Cloud and Green Computing (CGC), 2012
Second International Conference on, 777-782.
Kim, Y. S. (2008). Comparison of the decision tree, artificial neural network, and linear
regression methods based on the number and types of independent variables and
sample size. Expert Systems with Applications, 34(2), 1227-1234.
Kitchen, R. (1986). The role of the Jamaican stock exchange in the capital market.
Caribbean Finance and Management, 2(2), 1-23
117
Kohara, K., Ishikawa, T., Fukuhara, Y., & Nakamura, Y. (1997). Stock price prediction
using prior knowledge and neural networks. Intelligent Systems in Accounting,
Finance and Management, 6(1), 11-22.
Koot, R., Miles, J., & Heitmann, G. (1989). Security risk and market efficiency in the
jamaican stock exchange. Caribbean Finance and Management, 5(2), 18-33.
Kovalerchuk, B., & Vityaev, E. (2000). Data mining in finance: Advances in relational
and hybrid methods Springer.
Kuepper, J. 2011, Using Genetic Algorithms to Forecast Financial Markets Retrieved on
6/9/2012 from http://www.investopedia.com/articles/financial-theory/11/using-
genetic-algorithms-forecast-financial-markets.asp
Lee, M. C. (2009). Using support vector machine with a hybrid feature selection method
to the stock trend prediction. Expert Systems with Applications, 36(8), 10896-10904.
Liang, J., Song, W., & Wang, M. (2011). Stock price prediction based on procedural
neural networks. Advances in Artificial Neural Systems, 2011, 6.
Lin,L., Cao, L, Wang, J. & Zhang, C. 2002 The Applications of Genetic Algorithms in
Stock Market Data Mining Optimization
Lorie, J. H., Dodd, P., & Kimpton, M. H. (1985). The stock market Irwin.
Micu, A., Mast, L., Milea, V., Frasincar, F., & Kaymak, U. (2009). Financial news
analysis using a semantic web approach.Semantic Knowledge Management: An
Ontology-Based Framework, , 311-328.
Merton, R.C. (1995). Influence of mathematical models in finance on practice: past,
present and future. In Howison, S., Kelly, F.P. & Wilmott, P. Mathematical
Models in Finance (1st ed., pp. 1-14). London: Chapman & Hall.
McQueen, G., & Thorley, S. (1991). Are stock returns predictable? A test using chains.
The Journal of Finance, 46(1), 239-263.
Mittermayer, M. (2004). Forecasting intraday stock price trends with text mining
techniques. System Sciences, 2004. Proceedings of the 37th Annual Hawaii
International Conference on, 10 pp.
Ng, A., & Fu, A. (2003). Mining frequent episodes for relating financial events and stock
trends. Advances in Knowledge Discovery and Data Mining, , 569-569.
Nikfarjam, A., Emadzadeh, E., & Muthaiyah, S. (2010). Text mining approaches for
stock market prediction. Computer and Automation Engineering (ICCAE), 2010 the
2nd International Conference on, , 4 256-260.
118
Orell Jr, S. R. (2011). Semantic News Analysis & Prediction, Texas State University-San
Marcos
Ornes, C., & Sklansky, J. (1997). A neural network that explains as well as predicts
financial market behavior. Computational Intelligence for Financial Engineering
(CIFEr), 1997., Proceedings of the IEEE/IAFE 1997, 43-49.
Padhiary, P. K., & Mishra, A. P. (2011). Development of improved artificial neural
network model for stock market prediction. International Journal of Engineering
Science, 3
Parrino, R., & Kidwell, D. S. (2009). Fundamentals of Corporate Finance Wiley.
Phua, P., Ming, D., & Lin, W. (2001). Neural network with genetically evolved
algorithms for stocks prediction. Asia-Pacific Journal of Operational Research,
18, 103-107.
Podobnik B, Horvatic D, Petersen A, Stanley H E (2009) Cross-correlations between
volume change and price change. Proceedings National Academy Science USA
106: 22079–22084.
Poterba, J., and L. Summers (1988) Mean Reversion in Stock Prices: Evidence and
Implications. Journal of Financial Economics 22, 27-59.
Plerou V, Gopikrishnan P, Rosenow B, Amaral L, Stanley H E (2000) Econophysics:
financial time series from a statistical physics point of view. Physica A 279: 443–
456.
QianYu, L., & ShaoRong, F. (2010). Stock market forecasting research based on neural
network and pattern matching. E-Business and E-Government (ICEE), 2010
International Conference on, 1940-1943.
Qian, B., & Rasheed, K. (2004). Hurst exponent and financial market
predictability. Proceedings of the 2nd IASTED International Conference on
Financial Engineering and Applications, 203-209.
Rachlin, Last, Alberg, and Kandel. (2007)ADMIRAL: A Data Mining Based Financial
Trading System," 2007 IEEE Symposium on Computational Intelligence
and Data Mining, pp. 720-725.
Rahamneh, Z., Reyalat, M., Sheta, A., & Aljahdali, S. (2010). Forecasting stock
exchange using soft computing techniques. Computer Systems and Applications
(AICCSA), 2010 IEEE/ACS International Conference on, 1-5.
Robinson, J. (2005). Stock price behavior in emerging markets: Tests for weak form
market efficiency on the Jamaica stock exchange. Social and Economic Studies,
54(2), 51-69.
119
Schumaker, R. P., Zhang, Y., Huang, C., & Chen, H. (2012). Evaluating sentiment in
financial news articles. Decision Support Systems, 53(3), 458-464.
Schumann, M., & Lohrbach, T. (1993). Comparing artificial neural networks with
statistical methods within the field of stock market prediction. System Sciences,
1993, Proceeding of the Twenty-Sixth Hawaii International Conference on, , 4 597-
606 vol. 4.
Schwager, J. D. (1999). Getting started in technical analysis Wiley.
Senol, D. and Ozturan, M. 2008. Stock Price Direction Prediction Using Artificial Neural
Network Approach: The Case of Turkey. Journal of Artificial Intelligence, 1: 70-77.
Skabar, A., & Cloete, I. (2002). Neural networks, financial trading and the efficient
markets hypothesis. Australian Computer Science Communications, , 24(1) 241-249.
Skolpadungket, P., Dahal, K., & Harnpornchai, N. (2008). Forecasting stock returns
using evolutionary artificial neural networks. Preceeding of ClEF,
Skolpadungket, P., Dahal, K., & Harnpornchai, N. (2009). Forecasting stock returns
using variable selections with genetic algorithm and artificial neural-networks.
Computational Intelligence and Industrial Applications, 2009. PACIIA 2009. Asia-
Pacific Conference on, , 1 186-189.
Srinivasa, K., Venugopal, K., & Patnaik, L. (2006). An efficient fuzzy based neuro-
genetic algorithm for stock market prediction. International Journal of Hybrid
Intelligent Systems, 3(2), 63-81.
Subrahmanyam, A. (1995). On rules versus discretion in procedures to halt trade. Journal
of Economics and Business, 47(1), 1-16.
Takahashi, S., Takahashi, M., Takahashi, H., & Tsuda, K. (2007). Analysis of the relation
between stock price returns and headline news using text categorization. Knowledge-
Based Intelligent Information and Engineering Systems, 1339-1345.
Thompson, J. R., Williams, E. E., & Findlay, M. C. (2003). Models for investors in real
world markets Wiley Online Library.
Wang, S., Zhe, Z., Kang, Y., Wang, H., & Chen, X. (2008). An ontology for causal
relationships between news and financial instruments. Expert Systems with
Applications, 35(3), 569-580.
Wang, S., Xu, K., Liu, L., Fang, B., Liao, S., & Wang, H. (2011). An ontology based
framework for mining dependence relationships between news and financial
instruments. Expert Systems with Applications, 38(10), 12044-12050
Wilcox, J. (1992) Taming Frontier Markets. Journal of Portfolio Management 19, 51- 56.
120
Wu, J. Y., & Lu, C. J. (2012). Computational intelligence approaches for stock price
forecasting. Computer, Consumer and Control (IS3C), 2012 International
Symposium on, 52-55.
Wuthrich, B., Cho, V., Leung, S., Permunetilleke, D., Sankaran, K., & Zhang, J. (1998).
Daily stock market forecast from textual web data. Systems, Man, and
Cybernetics, 1998. 1998 \IEEE International Conference on, , 3 2720-2725. Yamasaki K, Muchnik L, Havlin S, Bunde A, Stanley H E (2005) Scaling and memory in
volatility return intervals in financial markets. Proceedings National Academy
Science USA 102: 9424–9428.
Zarandi, M., Hadavandi, E., & Turksen, I. (2012). A hybrid fuzzy intelligent agent‐based
system for stock price prediction. International Journal of Intelligent
Systems,
Zhai, Hsu, and Halgamuge,2007 "Combining News and Technical Indicators in Daily
Stock Price Trends Prediction," Lecture Notes in Computer Science, pp. 1087-
1096.
121
APPENDIX
122
A: INTERVIEW QUESTIONS
Mr. Stephen Gooden –Vice President: Investment & Trading , NCB Capital
Markets
Background for Question 1:
WorldCom overstated profits by at least $3.8M by incorrectly classifying expenses as investments,
Enron used “special purpose entities” to move debt off its books,
Parmalat-Italian dairy firm had a $4.8 M bank account that didn’t exist
1. How many Jamaican companies (if any) or major instances of bankruptcy due to
negligence or “unfortunate circumstances” have occurred?
__________________________________________________________________
__________________________________________________________________
__________________________________________________________________
__________________________________________________________________
2. What legislation exists to manage corporate governance in Jamaica comparable to
Sarbanes Oxley Act of 2002, to tighten rules of corporate governance?
____________________________________________________________________
_____________________________________________________________________
3. What (statistical) methods are used generally by brokerage houses to predict the
market for the
a. JSE Main
Index_______________________________________________________
b. JSE Combined
Index_______________________________________________________
c. Junior
Market______________________________________________________
123
4. What time period is usually used for forecasting Blue Chip Stocks?
_____________________________________________________________________
_____________________________________________________________________
5. What studies exist on long term prediction of stocks traded on JSE?
_____________________________________________________________________
_____________________________________________________________________
6. What type of market is the JSE? Direct –search, brokered, dealer , auction or a
combination
__________________________________________________________________
7. What is the impact on trading of
a) a declared holiday such as 1997 Jamaica’s football team qualifying for World
cup in France?
______________________________________________________________
b) Strike__________________________________________________________
c) Elections______________________________________________________
d) Jamaica Debt Exchange
2010___________________________________________________________
e) Natural disasters eg Hurricanes Ivan 2004 and Gilbert 1988
______________________________________________________________
8. Is there an ECN for the JSE eg Archipelago?
_________________________________________________________________
9. Is naked access trading allowed on the JSE? Controversial trading practice via
high speed traders where exchanges are often don’t know the identity of the firms
using sponsored access since the only way to identify the firm is through
computer code.
_________________________________________________________________
124
10. Are there instances of proxy fight in JSE. Eg Carl Icahn in Yahoo vs Microsoft
_____________________________________________________________________