AbstractsComputer Science

Stock Forecasting Using Artificial Neural Networks

by Daniel Millevik




Institution: KTH Royal Institute of Technology
Department:
Year: 2015
Keywords: Natural Sciences; Computer and Information Science; Computer Science; Naturvetenskap; Data- och informationsvetenskap; Datavetenskap (datalogi)
Record ID: 1334706
Full text PDF: http://urn.kb.se/resolve?urn=urn:nbn:se:kth:diva-166455


Abstract

This paper studies the potential of artificial neural networks (ANNs) in stock forecasting. It also investigates how the number of neurons in the network, as well as the distribution of the training data into training, validation and testing sets, affect the accuracy of the network. By using MATLAB and its Neural Network Toolbox tests were carried out with a two-layer feedforward neural network (FFNN). These are carried out by collecting five years of historical data from the Dow Jones Industrial Average (DJIA) stock index, which is then used for training the network. Finally, retraining the network with different configurations, with respect to the number of neurons and the training data distribution, in order to perform tests on a separate year of the DJIA stock index. The best acquired accuracy for predicting the closing stock price one day ahead is around 99\%. There are configurations that give worse accuracy. These are mainly the configurations using many neurons as well as the ones with low training data percentage. The conclusion is that there is potential for stock forecasting using ANNs but only predicting one day forward might not be practically useful. It is important to adapt the network to the given problem and its complexity and thus choosing the number of neurons accordingly. It will also be necessary to retrain the network several times in order to find one with good performance. Besides the training data distribution it is more important to gather enough data for the network's training set to allow it to adapt and generalize to the problem at hand. ; Denna rapport studerar ifall artificiella neuronnät (ANN) potentiellt kan tillämpas på den finansiella marknaden för att förutspå aktiepriser. Det undersöks även hur antalet neuroner i nätverket och hur fördelningen av träningsdatat i träning, validering och testning, påverkar nätverkets noggrannhet. Tester utfördes på en ''two layer feedforward neural network'' (FFNN) med hjälp av MATLAB och dess Neural Network Toolbox. Dessa utfördes genom att samla fem år av historisk data för ''Dow Jones Industrial Average'' (DJIA) aktieindex som används för att träna nätverket. Slutligen så tränas nätverket i omgångar med olika konfigurationer bestående av ändringar på antalet neuroner och fördelningen av träningsdatat. Detta för att utföra tester på ett separat år av DJIA aktieindex. Den bästa noggrannheten som erhölls vid förutsägning av stängningspriset i börsen efter en dag är ca 99\%. Det finns konfigurationer som ger sämre noggrannhet. Dessa är i synnerhet konfigurationer med ett stort antal neuroner samt de med låg andel träningsdata. Slutsatsen är att det finns potential vid användning av artificiella neuronnät men det är inte praktiskt användbart att bara förutspå aktiepriser en dag framåt. Det är viktigt att anpassa nätverket till det givna problemet och dess komplexitet. Därför ska antalet neuroner i nätverket väljas därefter. Det är också nödvändigt att träna om nätverket ett flertal gånger för att erhålla ett med bra prestanda. Utöver…