Predicting stock market index using fusion of machine learning techniques

Download Predicting stock market index using fusion of machine learning techniques

Post on 16-Mar-2017

234 views

Category:

Documents

12 download

Embed Size (px)

TRANSCRIPT

<ul><li><p>1</p><p>3</p><p>4</p><p>5</p><p>6</p><p>7 Q1</p><p>8</p><p>910</p><p>1 2</p><p>1314</p><p>15161718192021</p><p>2 2</p><p>3536</p><p>37</p><p>38</p><p>39</p><p>40</p><p>41</p><p>42</p><p>43</p><p>44</p><p>45</p><p>46</p><p>47</p><p>48</p><p>49</p><p>50</p><p>51</p><p>52</p><p>53</p><p>54</p><p>55</p><p>56</p><p>57</p><p>58</p><p>Q2Q1</p><p>Expert Systems with Applications xxx (2014) xxxxxx</p><p>ESWA 9633 No. of Pages 11, Model 5G</p><p>31 October 2014</p><p>Q1Contents lists available at ScienceDirect</p><p>Expert Systems with Applications</p><p>journal homepage: www.elsevier .com/locate /eswaPredicting stock market index using fusion of machine learningtechniqueshttp://dx.doi.org/10.1016/j.eswa.2014.10.0310957-4174/ 2014 Published by Elsevier Ltd.</p><p> Corresponding author.E-mail addresses: 10bce067@nirmauni.ac.in (J. Patel), 10bce089@nirmauni.ac.in</p><p>(S. Shah), priyank.thakkar@nirmauni.ac.in (P. Thakkar), director.it@nirmauni.ac.in(K. Kotecha).</p><p>Please cite this article in press as: Patel, J., et al. Predicting stock market index using fusion of machine learning techniques. Expert Systems with Appl(2014), http://dx.doi.org/10.1016/j.eswa.2014.10.031Jigar Patel, Sahil Shah, Priyank Thakkar , K. KotechaComputer Science &amp; Engineering Department, Institute of Technology, Nirma University, Ahmedabad, Gujarat, India</p><p>a r t i c l e i n f o a b s t r a c t232425262728293031Article history:Available online xxxx</p><p>Keywords:Artificial Neural NetworksSupport Vector RegressionRandom ForestStock marketHybrid models3233The paper focuses on the task of predicting future values of stock market index. Two indices namely CNXNifty and S&amp;P Bombay Stock Exchange (BSE) Sensex from Indian stock markets are selected for experi-mental evaluation. Experiments are based on 10 years of historical data of these two indices. The predic-tions are made for 110, 15 and 30 days in advance. The paper proposes two stage fusion approachinvolving Support Vector Regression (SVR) in the first stage. The second stage of the fusion approach usesArtificial Neural Network (ANN), Random Forest (RF) and SVR resulting into SVRANN, SVRRF and SVRSVR fusion prediction models. The prediction performance of these hybrid models is compared with thesingle stage scenarios where ANN, RF and SVR are used single-handedly. Ten technical indicators areselected as the inputs to each of the prediction models.</p><p> 2014 Published by Elsevier Ltd.3459</p><p>60</p><p>61</p><p>62</p><p>63</p><p>64</p><p>65</p><p>66</p><p>67</p><p>68</p><p>69</p><p>70</p><p>71</p><p>72</p><p>73</p><p>74</p><p>75</p><p>76</p><p>77</p><p>78</p><p>79</p><p>80</p><p>81</p><p>821. Introduction and literature review</p><p>Prediction of stock prices is a classic problem. Efficient markethypothesis states that it is not possible to predict stock pricesand that stocks behave in random walk manner. But technical ana-lysts believe that most information about the stocks are reflectedin recent prices and so if trends in the movements are observedthen prices can be easily predicted. In addition, stock marketsmovements are affected by many macro-economical factors suchas political events, firms policies, general economic conditions,commodity price index, bank rate, bank exchange rate, investorsexpectations, institutional investors choices, movements of otherstock markets, psychology of investors, etc. (Miao, Chen, &amp; Zhao,2007). Value of stock indices are calculated based on stocks withhigh market capitalization. Various technical parameters are usedto gain statistical information from value of stocks prices. Stockindices are derived from prices of stocks with high market capital-ization and so they give an overall picture of economy and dependson various factors.</p><p>There are several different approaches to time series modeling.Traditional statistical models including moving average, exponen-tial smoothing, and ARIMA are linear in their predictions ofthe future values (Bollerslev, 1986; Hsieh, 1991; Rao &amp; Gabr,1984). Extensive research has resulted in numerous prediction83</p><p>84</p><p>85</p><p>86</p><p>87applications using Artificial Neural Networks (ANN), fuzzy logic,Genetic Algorithms (GA) and other techniques (Hadavandi,Shavandi, &amp; Ghanbari, 2010b; Lee &amp; Tong, 2011; Zarandi,Hadavandi, &amp; Turksen, 2012). Artificial Neural Networks (ANN)and Support Vector Regression (SVR) are two machine learningalgorithms which have been most widely used for predicting stockprice and stock market index values. Each algorithm has its ownway to learn patterns. Zhang and Wu (2009) incorporated thebackpropagation neural network with an Improved BacterialChemotaxis Optimization (IBCO). They demonstrated the abilityof their proposed approach in predicting stock index for both shortterm (next day) and long term (15 days). Simulation Resultsexhibited the superior performance of proposed approach. Acombination of data preprocessing methods, genetic algorithmsand LevenbergMarquardt (LM) algorithm for learning feedforward neural networks was proposed in Asadi, Hadavandi,Mehmanpazir, and Nakhostin (2012). They used data pre-process-ing methods such as data transformation and selection of inputvariables for improving the accuracy of the model. The resultsshowed that the proposed approach was able to cope with the fluc-tuations of stock market values and also yielded good predictionaccuracy. The Artificial Fish Swarm Algorithm (AFSA) was intro-duced by Shen, Guo, Wu, and Wu (2011) to train radial basis func-tion neural network (RBFNN). Their experiments on the stockindices of the Shanghai Stock Exchange indicated that RBF opti-mized by AFSA was an easy-to-use algorithm with considerableaccuracy. Ou and Wang (2009) used total ten data mining tech-niques to predict price movement of Hang Seng index of HongKong stock market. The approaches included Linear Discriminantications</p><p>http://dx.doi.org/10.1016/j.eswa.2014.10.031mailto:10bce067@nirmauni.ac.inmailto:10bce089@nirmauni.ac.inmailto:priyank.thakkar@nirmauni.ac.inmailto:director.it@nirmauni.ac.inhttp://dx.doi.org/10.1016/j.eswa.2014.10.031http://www.sciencedirect.com/science/journal/09574174http://www.elsevier.com/locate/eswahttp://dx.doi.org/10.1016/j.eswa.2014.10.031</p></li><li><p>88</p><p>89</p><p>90</p><p>91</p><p>92</p><p>93</p><p>94</p><p>95</p><p>96</p><p>97</p><p>98</p><p>99</p><p>100</p><p>101</p><p>102</p><p>103</p><p>104</p><p>105</p><p>106</p><p>107</p><p>108</p><p>109</p><p>110</p><p>111</p><p>112</p><p>113</p><p>114</p><p>115</p><p>116</p><p>117</p><p>118</p><p>119</p><p>120</p><p>121</p><p>122</p><p>123</p><p>124</p><p>125</p><p>126</p><p>127</p><p>128</p><p>129</p><p>130</p><p>131</p><p>132</p><p>133</p><p>134</p><p>135</p><p>136</p><p>137</p><p>138</p><p>139</p><p>140</p><p>141</p><p>142</p><p>143</p><p>144</p><p>145</p><p>146</p><p>147</p><p>148</p><p>149</p><p>150</p><p>151</p><p>152</p><p>153</p><p>154</p><p>155</p><p>156</p><p>157</p><p>158</p><p>159</p><p>160</p><p>161</p><p>162</p><p>163</p><p>164</p><p>165</p><p>166</p><p>167</p><p>168</p><p>169</p><p>170</p><p>171</p><p>172</p><p>173</p><p>174</p><p>175</p><p>176</p><p>177</p><p>178</p><p>179</p><p>180</p><p>181</p><p>182</p><p>183</p><p>184</p><p>185</p><p>186</p><p>187</p><p>188</p><p>189</p><p>190</p><p>191</p><p>192</p><p>193</p><p>194</p><p>195</p><p>196</p><p>197</p><p>198</p><p>199</p><p>200</p><p>201</p><p>202</p><p>203</p><p>204</p><p>205</p><p>206</p><p>207</p><p>208</p><p>209</p><p>210</p><p>211</p><p>2 J. PatelQ1 et al. / Expert Systems with Applications xxx (2014) xxxxxx</p><p>ESWA 9633 No. of Pages 11, Model 5G</p><p>31 October 2014</p><p>Q1Analysis (LDA), Quadratic Discriminant Analysis (QDA), K-nearestneighbor classification, Naive Bayes based on kernel estimation,Logit model, Tree based classification, neural network, Bayesianclassification with Gaussian process, Support Vector Machine(SVM) and Least Squares Support Vector Machine (LS-SVM). Exper-imental results showed that the SVM and LS-SVM generated supe-rior predictive performance among the other models. Hadavandi,Ghanbari, and Abbasian-Naghneh (2010a) proposed a hybrid artifi-cial intelligence model for stock exchange index forecasting. Themodel was a combination of genetic algorithms and feed forwardneural networks.</p><p>Recently, the support vector machine (SVM) (Vapnik, 1999) hasgained popularity and is regarded as a state-of-the-art techniquefor regression and classification applications. Kazem, Sharifi,Hussain, Saberi, and Hussain (2013) proposed a forecasting modelbased on chaotic mapping, firefly algorithm, and Support VectorRegression (SVR) to predict stock market price. SVRCFA modelwhich was newly introduced in their study, was compared withSVRGA (Genetic Algorithm), SVRCGA (Chaotic Genetic Algo-rithm), SVRFA (Firefly Algorithm), ANN and ANFIS models andthe result showed that SVRCFA model was performing better thanother models. Pai, Lin, Lin, and Chang (2010) developed a SeasonalSupport Vector Regression (SSVR) model to forecast seasonal timeseries data. Hybrid genetic algorithms and tabu search (GAnTS)algorithms were applied in order to select three parameters ofSSVR models. They also applied two other forecasting models,Sessional Autoregressive Integrated Moving Average (SARIMA)and SVR for forecasting on the same data sets. Empirical resultsindicated that the SSVR outperformed both SVR and SARIMAmodels in terms of forecasting accuracy. By integrating geneticalgorithm based optimal time-scale feature extractions with sup-port vector machines, Huang and Wu (2008) developed a novelhybrid prediction model that operated for multiple time-scaleresolutions and utilized a flexible nonparametric regressor to pre-dict future evolutions of various stock indices. In comparison withneural networks, pure SVMs and traditional GARCH models, theproposed model performed the best. The reduction in root-mean-squared error was significant. Financial time series predictionusing ensemble learning algorithms in Cheng, Xu, and Wang(2012) suggested that ensemble algorithms were powerful inimproving the performances of base learners. The study by Aldin,Dehnavr, and Entezari (2012) evaluated the effectiveness of usingtechnical indicators, such as Moving Average, RSI, CCI, MACD, etc.in predicting movements of Tehran Exchange Price Index (TEPIX).</p><p>This paper focuses on the task of predicting future values ofstock market indices. The predictions are made for 110, 15 and30 days in advance. It has been noticed from the literature thatthe existing methods for the task under focus in this paper employonly one layer of prediction which takes the statistical parametersas inputs and gives the final output. In these existing methods, thestatistical parameters value of tth day is used as inputs to predictthe t nth days closing pricenvalue (t is a current day). It is feltthat in such scenarios, as the value of n increases, predictions arebased on increasingly older values of statistical parameters andthereby not accurate enough. It is clear from this discussions thatthere is a need to address this problem, and that motivated usabout two stage prediction scheme which can bridge this gapand minimize the error stage wise. It was thought that success ofthe two stage proposed model could really be the significantcontribution to the research as the approach can be generalizedfor other prediction tasks such as whether forecasting, energyconsumption forecasting, GDP forecasting etc.</p><p>The two stage fusion approach proposed in this paper involvesSupport Vector Regression (SVR) in the first stage. The second stageof the fusion approach uses Artificial Neural Network (ANN), Ran-dom Forest (RF) and SVR resulting into SVRANN, SVRRF andPlease cite this article in press as: Patel, J., et al. Predicting stock market index us(2014), http://dx.doi.org/10.1016/j.eswa.2014.10.031SVRSVR prediction models. The prediction performance of thesehybrid models is compared with the single stage scenarios whereANN, RF and SVR are used single-handedly.</p><p>The remainder of the paper is organized into following sections.Section 2 describes single stage approach while focus of the Section3 is proposed two stage approach. Section 4 addresses experimen-tal results and discussions on these results. Section 5 ends with theconcluding remarks.2. Single stage approach</p><p>The basic idea of a single stage approach is illustrated in Fig. 1. Itcan be seen that for the prediction task of nth-day ahead of time,inputs to prediction models are ten technical indicators describingtth-day while the output is t nth-days closing price. Thesetechnical indicators which are used as inputs are summarized inTable 1. The prediction models employed are described in thefollowing sub-sections.2.1. Artificial Neural Networks</p><p>Three layer feed forward back propagation ANN as shown inFig. 2 is employed in this paper. Input layer has ten neurons, onefor each of the selected technical parameters. The value of theindex which is to be predicted is represented by the only neuronin the output layer. Adaptive gradient descent is used as the weightupdate algorithm. A tangent sigmoid is used as the transferfunction of the neurons of the hidden layer while the neuron inthe output layer uses linear transfer function. The output of themodel is a continuous value signifying the predicted value of theindex.</p><p>The reason behind using adaptive gradient descent is to allowlearning rate to change during the training process. It may improvethe performance of the gradient descent algorithm. In adaptivegradient descent, first, the initial network output and error are cal-culated. The current learning rate is used to calculate new weightsand biases at each epoch. Based on these new weights and biases,new outputs and errors are calculated. If the new error exceeds theold error by more than a predefined ratio (1.04, in this study), thenew weights and biases are discarded. Also the learning rate isdecreased (to 70% of its current value, in this study). Otherwise,new weights and biases are kept and the learning rate is increased(by 5% of the current value, in the experiments reported in thispaper).</p><p>The procedure ensures that the learning rate is increased onlyto the extent that the network can learn without large increasesin error. This allows to obtain near optimal learning rate for thelocal terrain. At the same time, as long as stable learning is assured,learning rate is increased. When it is too high to assure a decreasein error, it is decreased until stable learning resumes.</p><p>Number of neurons in the hidden layer and number of epochsare considered as the design parameters of the model. Comprehen-sive number of experiments are carried out by varying the param-eter values as shown in Table 2.2.2. Support Vector Regression</p><p>The SVR uses the same principles as the SVM for classification,with only a few minor differences. First of all, because output is areal number it becomes very difficult to predict the information athand, which has infinite possibilities. In the case of regression, amargin of tolerance is set in approximation to the SVM. Up untilthe threshold , the error is considered 0. However, the main idea isalways the same: to minimize error, individualizing the hypering fusion of machine learning techniques. Expert Systems with Applications</p><p>http://dx.doi.org/10.1016/j.eswa.2014.10.031</p></li><li><p>212</p><p>213</p><p>214</p><p>215</p><p>216</p><p>217</p><p>218</p><p>219</p><p>220222222</p><p>223224</p><p>226226</p><p>227</p><p>228</p><p>229</p><p>230231</p><p>233233</p><p>234</p><p>235</p><p>236</p><p>237</p><p>238239</p><p>241241</p><p>242</p><p>243</p><p>244</p><p>245</p><p>246</p><p>247</p><p>248</p><p>Fig. 1. General architecture of single stage approach for predicting n day ahead of time.</p><p>Table 1Selected technical indicators &amp; their formulas (Kara et al., 2011).</p><p>Name of indicators Formulas</p><p>Simple n10here-day movingaverage</p><p>CtCt1...Ct9n</p><p>Weighted 10-day moving average 10Ct9Ct1...Ct9nn1...1</p><p>Momentum Ct Ct9Stochastic K% CtLLtn1</p><p>HHtn1LLtn1 100Stochastic D% Pn1</p><p>i0 Kti10 %</p><p>Relative strength index (RSI) 100 1001Pn1</p><p>i0 UPti=n Pn1</p><p>i0 DWti=n </p><p>Moving average convergencedivergence (MACD)</p><p>MACDnt1 2n1 DIFFt MACDnt1</p><p>Larry Williams R% HnCtHnLn 100</p><p>A/D (Accumulation/Distribution)oscillator</p><p>HtCt1HtLt</p><p>CCI (Commodity channel index) MtSMt0:015Dt</p><p>Ct is the closing price, Lt is the low price and Ht the high price at timet; DIFFt EMA12t EMA26t ;...</p></li></ul>

Recommended

View more >