Forecasting Financial Time Series Through Causal and Dilated Convolutional Neural Networks

Forecasting Financial Time Series Through Causal and Dilated Convolutional Neural Networks

Linköping University | Department of Computer and Information Science Bachelor’s Thesis| Bachelor’s Programme in Programming Spring term 2020 | LIU-IDA/LITH-EX-G—20/055-SE Forecasting Financial Time Series through Causal and Dilated Convolutional Neural Networks Lukas Börjesson Tutor, Rita Kovordanyi Examinator, Jalal Maleki Upphovsrätt Detta dokument hålls tillgängligt på Internet – eller dess framtida ersättare – under 25 år från publiceringsdatum under förutsättning att inga extraordinära omständigheter uppstår. Tillgång till dokumentet innebär tillstånd för var och en att läsa, ladda ner, skriva ut enstaka kopior för enskilt bruk och att använda det oförändrat för ickekommersiell forskning och för undervisning. Överföring av upphovsrätten vid en senare tidpunkt kan inte upphäva detta tillstånd. All annan användning av dokumentet kräver upphovsmannens medgivande. För att garantera äktheten, säkerheten och tillgängligheten finns lösningar av teknisk och administrativ art. Upphovsmannens ideella rätt innefattar rätt att bli nämnd som upphovsman i den omfattning som god sed kräver vid användning av dokumentet på ovan beskrivna sätt samt skydd mot att dokumentet ändras eller presenteras i sådan form eller i sådant sammanhang som är kränkande för upphovsmannens litterära eller konstnärliga anseende eller egenart. För ytterligare information om Linköping University Electronic Press se förlagets hemsida http://www.ep.liu.se/. Copyright The publishers will keep this document online on the Internet – or its possible replacement – for a period of 25 years starting from the date of publication barring exceptional circumstances. The online availability of the document implies permanent permission for anyone to read, to download, or to print out single copies for his/hers own use and to use it unchanged for non- commercial research and educational purpose. Subsequent transfers of copyright cannot revoke this permission. All other uses of the document are conditional upon the consent of the copyright owner. The publisher has taken technical and administrative measures to assure authenticity, security and accessibility. According to intellectual property law the author has the right to be mentioned when his/her work is accessed as described above and to be protected against infringement. For additional information about the Linköping University Electronic Press and its procedures for publication and for assurance of document integrity, please refer to its www home page: http://www.ep.liu.se/. © Lukas Börjesson ii Abstract In this paper, predictions of future price movements of a major American stock index was made by analysing past movements of the same and other correlated indices. A model that has shown very good results in speech recognition was modified to suit the analysis of financial data and was then compared to a base model, restricted by assumptions made for an efficient market. The performance of any model, that is trained by looking at past observations, is heavily influenced by how the division of the data into train, validation and test sets is made. This is further exaggerated by the temporal structure of the financial data, which means that the causal relationship between the predictors and the response is dependent on time. The complexity of the financial system further increases the struggle to make accurate predictions, but the model suggested here was still able to outperform the naive base model by more than 20 percent. The model was, however, too primitive to be used as a trading system, but suitable modifications, in order to turn the model into one, were discussed in the end of the paper. iii Acknowledgement The study in this paper stretches over a number of different subject fields, ranging from computer science to finance. This means that there is a lot of ground to cover and a number of different concepts that need to be explained. However, the number of pages in the paper were limited and great effort has been placed on covering the most essential concepts. In this regard, my tutor, Rita Kovordanyi, has provided a great deal of thoughtful inputs and insights, for which I am very grateful. Thank you. I also want to take this opportunity to thank Martin Singull, who has, apart from providing helpful input on this paper, been an excellent instructor in the area of mathematical statistics and who has further increased my interest in the same and similar subjects. Linköping in June 2020 Lukas Börjesson iv INTRODUCTION in the financial markets are no trivial task, and it should be Deep learning has brought a new paradigm into machine learn- approached with humility. However, one should not be dis- ing in the past decade and has shown remarkable results in couraged, since the models proposed in [13] does provide areas such as computer vision, speech recognition and natural promising or, in often times, positive results. language processing. However, one of the areas where it is yet An important note about the expectation mentioned above is to become a mainstream tool is in forecasting financial time that the definition of a trader, provided by Paul and Baschnagel, series. This despite the fact that time series does provide a does not limit it to be that of a human being, it might as well suitable data representation for deep learning methods such be an algorithm. This is important, since the majority of as a convolutional neural network (CNN) [16]. Researchers the transactions in the market are now made by algorithms. and market participants1 are still, to the most part, sticking to These algorithms are used in order to decrease the impact of more historically well known and tested approaches, but there biases and irrationality in the decision making. However, the has been a slight shift of interest to deep learning methods in algorithms are programmed by people and are still making the past years [13]. The reason behind the shift, apart from the predictions under uncertainty, based on historical data, which structure of the time series, is that the financial market is an means that they are by no means free of biases. Algorithms increasingly complex system. This means that there is a need is also more prone to get stuck in a feedback loop, which has for more advanced models, such as deep neural networks, that been exploited by traders in the past4. does a better job in finding the nonlinear relations in the data. There are also those who states that complexity is not the Objective issue, but instead advocate for the Efficient Market Hypothesis The objective of this paper was to expand the research in fore- (EMH) [7]. A theory that essentially suggest that no model, casting financial time series, specifically with a deep learning no matter how complex, can outperform the market, since approach. To achieve this, two models, which greatly differ the price is based on all available information. The theory in the approach towards the effectivness of the market, were rests upon three key assumptions2, which are stated to be compared. The first model was restricted by the assumptions sufficient, but not necessary3. These assumptions, even with made on the market by the EMH and was seen as the base modifications, are very bold and there are many who have model. The second model was a convolutional neural net- criticized the theory over the years. However, whether one work, inspired by a model developed for speech recognition agrees with the theory or not, one would probably agree with by researchers at Google. The models set out to predict the that a model, that satisfies the assumptions made in EMH, next day’s closing price of Standard & Poor’s 500 (S&P 500), would indeed be suitable as a base model. Which means that which is a well known stock market index, comprised of 500 such a model can be used as a benchmark, in order to assess large companies in the US. the accuracy of other models. Problem Formulation Traders and researchers alike would furthermore agree on, that In order to reach the objective, this paper aimed at answering the price of any asset is, apart from its inner utility, based the following questions: on expectation of its future value. For example, the price of a stock is partially determined by the company’s current • Can a CNN model, using only the closing price as input, per- financials, but also by the expectation of future revenues or form better forecasts than a model restricted by the EMH? future dividends. This expectation is, by the neoclassical economics, seen as completely rational, giving rise to the • Can conditional input series help to improve the perfor- area of rational expectation [8]. However, the emergence of mance of the CNN model? behavioural economics have questioned this rationality and proposes that traders (or more generally, decision-makers who THEORY act under risk and uncertainty) are sometimes irrational and Time Series many times affected by biases [15]. A time series can be defined, as the name suggests, as a series of data points, ordered with respect to time and where the time A trader that sets out to exploit this irrationality and these interval between the data points are often chosen to be fixed. biases can only do so by looking into the past, and thereby When using time series as a forecasting model, one makes the also go against the hypothesis of the efficient market. Upon assumption that future events, such as next day’s closing price reading this, it should be fairly clear, that making predictions of a stock, can be determined by looking at past closing prices in the time series. Most models, however, include a random 1"Market participants is a general expression for individuals or error as a factor, meaning that there is some noise in the data groups who are active in the market, such as banks, investors, invest- which cannot be explained by past values in the series.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    14 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us