Up/Down Analysis of Stock Index by Using Bayesian Network

,

Day trading refers to the practice of buying and selling financial instruments within the same trading day such that all positions are usually closed before the market close for the trading day.Traders who participate in day trading are simply called day traders.Some of the more commonly day-traded financial instruments are stocks, stock options, currencies, and a host of futures contracts such as equity index futures, interest rate futures, and commodity futures.In the day trading of the stock indexes, the most important information for the day trader is not the exact future stock price but the up/down information of the future stock price.In this study, Bayesian network is applied for the up/down analysis of the stock index.
Bayesian network is the graphical model which can represent the stochastic dependency of the random variables via the acyclic directed graph (Pearl & Russell, 2002;Ben-Gal, 2007;Heckerma, Geiger & Chickering, 1995).The network takes the random variables as the nodes and can represent their dependency as the arrows.The strength of the dependency between the random variables is estimated according to their concurrent occurrence probability.
In this study, the Bayesian network is applied for predicting the up/down analysis of the stock indexes in three major markets; Dow Jones Industrial Average (Dow, 30), Financial Times Stock Exchange 100 (FTSE100) and Nikkei Stock Average (Nikkei,225).The up or down of the stock index on the next day is taken as the random variables for the Bayesian network.The network is determined by using K2 algorithm with the K2 metric as the prediction accuracy of the network (Ben-Gal, 2007;Heckerma, Geiger & Chickering, 1995).The network is applied for predicting the up/down analysis of the stock index FTSE100 in 2007 and then, the results are compared with the traditional day-trading strategies such as psychological line and trend estimation.
The stock price forecast by using Bayesian network was presented in the reference (Zu & Kita, 2012).The aim of the study was to predict the daily stock prices by using Bayesian network.The daily stock prices were digitized by the clustering algorithm in order to define the random variables for the network.Since the prediction accuracy depends on the clusters and the data size, huge data are necessary for the good prediction accuracy.Therefore, the daily stock prices from 1985 to 2008 were used in the study.On the other hand, the up and down of the daily stock price are taken as the random variables in this study.Therefore, necessary data set size is relatively small, which is the daily stock prices from 2005 to 2006 in this study.
The remaining part of this paper is organized as follows.In section 2, the study background is described.The Bayesian network algorithm and the present algorithm are explained in section 3 and 4, respectively.Numerical results are shown in section 5.The conclusions are summarized in section 6.

Stock Exchange
A stock exchange is a form of exchange which provides services for stock brokers and traders to trade stocks, bonds, and other securities.Stock exchanges also provide facilities for issue and redemption of securities and other financial instruments, and capital events including the payment of income and dividends.Securities traded on a stock exchange include shares issued by companies, unit trusts, derivatives, pooled investment products and bonds.
Three traditional major stock exchanges are New York Stock Exchange (NYSE), London Stock exchange and Tokyo Stock Exchange.
The New York Stock Exchange is a stock exchange located at New York City, USA.It is by far the world's largest stock exchange and its average daily trading value was approximately US$153 billion in 2008.One of the popular stock market indexes in NYSE is Dow Jones Industrial Average (Dow30).
The London Stock Exchange is a stock exchange located in the City of London in the United Kingdom.As of December 2011, the Exchange had a market capitalization of US$3.266 trillion (short scale), making it the fourth-largest stock exchange in the world by this measurement (and the largest in Europe).The main stock market index is Financial Times Stock Exchange 100 index (FTSE100).
The Tokyo Stock Exchange is a stock exchange located in Tokyo, Japan.It is the third largest stock exchange in the world by aggregate market capitalization of its listed companies.It had 2,292 listed companies with a combined market capitalization of US$3.8 trillion as of Dec 2011.The main stock market index is the Nikkei225 index of companies selected by the Nihon Keizai Shimbun (Japan's largest business newspaper).

Stock Index Prediction
Traditional algorithms for the up and down analysis of the stock indexes are briefly classified into fundamental and technical analyses (Bianchi, Boyle & Hollingsworth, 1999).
Fundamental analysis involves analyzing financial statements, health, management and competitive advantages, and competitors of the business.When it is applied for predicting a stock, it focuses on the overall state of the economy, interest rates, production, earnings, and management.Since large amount data are necessary for the fundamental analysis, it may not be adequate for the stock index prediction in the short term.
A fundamental principle of technical analysis is that a market's price reflects all relevant information, so their analysis looks at the history of a security's trading pattern rather than external drivers such as economic, fundamental and news events.Price action also tends to repeat itself because investors collectively tend toward patterned behavior.Technical analysis employs models and trading rules based on price and volume transformations, such as the relative strength index, moving averages, regressions, inter-market and intra-market price correlations, business cycles, stock market cycles or, classically, through recognition of chart patterns.
In this study, the Bayesian network is applied for the up and down analysis of the stock indexes and then, the results are compared with psychological line and trend estimation, which are popular technical analysis algorithms.

Psychological Line
The reference value of the psychological line on the day t is defined as follows.
∑ 100 (1) where the parameter N denotes the number of days for estimating psychological line.The term ∑ in Eq.( 1) estimates the number of days of which closing stock price is higher than that of the previous day.For example, the parameter 80% in case of N=10 indicates that the closing stock price rose on eight days of past ten days.If 100% in case of 10, stock price every days rose during last ten days and thus, investors must consider that the stock price will decrease on the next day.
The psychological line, in this study, gives the following predictions.

1) If
75, it is predicted that the stock price rises on the next day.
2) If 75, it is predicted that the stock price declines on the next day.
The parameter is taken as follows.

Trend Estimation
The trend estimation is focusing on their ability to pick up turning points quickly at the end of a series.In this study, the base and the deflector lines are used for picking up turning points.
When the base and the deflector lines are referred to as and , respectively, the trend estimation leads to the following predictions.

1) If
, it is predicted that the stock price rises on the next day.
2) If , it is predicted that the stock price declines on the next day.
The values and are defined as follows.
Case T1) The value and are defined as the average values of the highest and the lowest stock prices on the past 26 days and the past 9 days, respectively.
Case T2) The value and are defined as the average values of the highest and the lowest stock prices on the past 42 days and the past 9 days, respectively.

Conditional Probability
When the probabilistic variable depends on the probabilistic variable , the relation is represented as where the node and are named as the parent node and the child node, respectively.If the node has multiple parent nodes, the class of the parent nodes is defined as the class where the notation and denote the parent nodes of the node and the total number of the parent nodes, respectively.The dependency of the child node to the class of parent nodes is quantified by the conditional probability | , which is given as where

K2Metric
The validity of the network is evaluated by K2Metric (Cooper & Herskovits, 1992;Pearl, 1988), which is defined as follows. and where the parameter , , and denote total number of nodes, total numbers of states for and , respectively.Besides, the notation denotes the number of samples of when .

K2 Algorithm
The graph structure is determined by K2 algorithm (Cooper & Herskovits, 1992;Pearl, 1988).The K2 algorithm is illustrated in Fig. 1 and summarized as follows.
2. Set a parent node class as an empty class .
3. Estimate K2Metric of the network composed of the node and the class , which is referred to as .
5. Add the node to the class .
6. Estimate K2Metric of the network composed of the node and the class , which is referred to as .

If
, remove the node from the class .
11. Define the Bayesian network as the network composed of the node and the class .

Probabilistic Reasoning
When the evidence of the random variable is given, the probability | is estimated by the marginalization with the conditional probability table (Cooper & Herskovits, 1992).
The marginalization algorithm gives the probability | as follows: where the notation ∑ denotes the summation over all states , , ⋯ , of the random variable .

Process
The object of this algorithm is to estimate the probability of the up/down of the stock index FTSE100 on the next day by using Bayesian Network.The prediction process is summarized as follows.
1. Estimate the up/down rates in the past stock indexes between the day and the day 1.
2. Determine the Bayesian network from the up/down rates in the past stock indexes.
3. Predict the stock price on the next day so that the probability of the up/down rate in the stock index is maximized.

Stock Price UP/Down Rate
Assume FTSE100 on the day is referred to as , the up/down rate on the day is defined as follows.
0, 1, When Dow30 and Nikkei225 on the day are given as and , respectively, the related up/down rates and on the day are defined as follows.

Prediction of Up/Down Rate
Bayesian network is determined according to the K2 algorithm from the set of the up/down rates of the indexes.The total order relationship of the random variables is defined according to the time order (Figure 2).

Problem Setting
The stock index data from January 2005 to December 2006 are used for determining the Bayesian network.The stock index from January 2007 to December 2007 is predicted and then, the results are compared with the psychological line and the trend estimation.
The vertical investments are performed on the data from January 2007 to December 2007 according to three algorithms and then, the accuracy and the total profit are compared.
The vertical investment strategies are given as follows.
(1) If it is predicted on the day 1 that the stock index on the day will rise, the specific amount of stocks are bought on the closing time of the day 1.Then, the same amount of stocks are sold on the closing time of the day .
(2) If it is predicted on the day 1 that the stock index on the day will decline, the specific amount of stocks are sold on the closing time of the day 1.Then, the same amount of stocks are bought on the closing time of the day .

Figure 5 .
Figure 4. Results of psychological line