Artificial Intelligence in Finance
Total Page:16
File Type:pdf, Size:1020Kb
Artificial Intelligence in Finance: Forecasting Stock Market Returns Using Artificial Neural Networks Alexandra Zavadskaya Department of Finance Hanken School of Economics Helsinki 2017 HANKEN SCHOOL OF ECONOMICS Department of: Finance Type of work: Thesis Author: Alexandra Zavadskaya Date: 29.09.2017 Title of thesis: Artificial Intelligence in Finance: Forecasting Stock Market Returns Using Artificial Neural Networks Abstract: This study explored various Artificial Intelligence (AI) applications in a finance field. It identified and discussed the main areas for AI in the finance: portfolio management, bankruptcy prediction, credit rating, exchange rate prediction and trading, and provided numerous examples of the companies that have invested in AI and the type of tasks they use it for. This paper focuses on a stock market prediction, and whether Artificial Neural Networks (ANN), being proxies for Artificial Intelligence, could offer an investor more accurate forecasting results. This study used two datasets: monthly returns of S&P500 index returns over the period 1968-2016, and daily S&P 500 returns over the period of 2007-2017. Both datasets were used to test for univariate and multivariate (with 12 explanatory variables) forecasting. This research used recurrent dynamic artificial neural networks and compared their performance with ARIMA and VAR models, using both statistical measures of a forecast accuracy (MSPE and MAPE) and economic (Success Ratio and Direction prediction) measures. The forecasting was performed for both in-sample and out-of-sample. Furthermore, given that ANN may produce different results during each iteration, this study has performed a sensitivity analysis, checking for the robustness of the results given different network configuration, such as training algorithms and number of lags. Even though some networks have outperformed certain linear models, the overall result is mixed. ARMA models were the best in minimizing forecast errors, while networks often had a better accuracy in a sign or direction prediction. Artificial neural networks outperformed respective VAR models in many parameters, but the difference of this outperformance was not significant, measured by S-test. Moreover, all model produced significant results in accurate stock index direction predictions, as 75-80% of the time the models predicted correct direction change in S&P500 return. Furthermore, combining Artificial Intelligence with the concept of Big Data, Google Trends search terms were used as a measure of a market sentiment. This study finds the use of Google trends search terms valuable in the modeling of S&P 500 returns. Keywords: forecasting, stock returns, S&P500, market sentiment, ANN, artificial neural networks, artificial intelligence, forecasting accuracy, forecast evaluation CONTENTS 1 INTRODUCTION ................................................................................................ 8 1.1 Purpose of the study ................................................................................................ 9 1.2 Study limit ................................................................................................................ 9 1.3 Contribution........................................................................................................... 10 1.4 Thesis organization ................................................................................................. 11 1.5 List of abbreviations .............................................................................................. 12 2 BACKGROUND INFORMATION ...................................................................... 13 2.1 What is AI .............................................................................................................. 13 2.2 Applications of AI in finance ................................................................................. 14 2.2.1 Anomaly detection .......................................................................................... 14 2.2.2 Portfolio management and robo-advisory ..................................................... 14 2.2.3 Algorithmic trading .........................................................................................15 2.2.4 Text mining ..................................................................................................... 16 2.2.5 Market, sentiment or news analysis ................................................................ 17 2.2.6 Credit evaluation and loan/insurance underwriting ....................................... 17 2.3 Types of Artificial Intelligence (AI) ....................................................................... 18 2.4 Artificial Neural Network (ANN) ........................................................................... 18 2.4.1 Types of ANN .................................................................................................. 18 3 THEORY REVIEW ............................................................................................ 22 3.1 Traditional Investment Theories ........................................................................... 22 3.2 Behavioral finance ................................................................................................. 22 3.3 Adaptive Market Hypothesis (AMH) ..................................................................... 24 3.4 Chaos Theory ......................................................................................................... 24 3.5 Time-series momentum theory. ............................................................................ 25 3.6 Forecasting methods .............................................................................................. 25 3.6.1 Linear vs. nonlinear methods ......................................................................... 26 3.6.2 Benefits of ANN .............................................................................................. 26 3.6.3 ANN drawbacks .............................................................................................. 27 3.6.4 Forecast Combinations ................................................................................... 27 1 4 LITERATURE REVIEW .................................................................................... 29 4.1 Bahrammirzaee’s (2010) review of previous studies of ANN applications ........... 29 4.2 Individual papers review ....................................................................................... 30 5 DATA .................................................................................................................. 38 5.1 Dataset 1 description .............................................................................................. 38 5.1.1 Variables ......................................................................................................... 39 5.1.2 Descriptive statistics ....................................................................................... 44 5.1.3 Correlations .....................................................................................................51 5.2 Dataset 2 description ............................................................................................. 53 5.2.1 Variables ......................................................................................................... 53 5.2.2 Descriptive statistics ....................................................................................... 57 5.2.3 Correlation analysis ........................................................................................ 59 6 RESEARCH METHOD ....................................................................................... 61 6.1 Research Question and Research Hypothesis: ...................................................... 61 6.2 Traditional long-term forecasting methods........................................................... 61 6.2.1 ARIMA ............................................................................................................ 61 6.2.2 VAR ................................................................................................................. 63 6.2.3 In sample forecasting versus out-of-sample .................................................. 64 6.3 Research method for ANN ..................................................................................... 64 6.3.1 Process of constructing and utilizing ANN .................................................... 64 6.3.2 NAR network .................................................................................................. 67 6.3.3 NARX network................................................................................................ 69 6.4 Method for comparing the model’s forecast accuracy ........................................... 70 6.4.1 Statistical loss functions ................................................................................. 70 6.4.2 Financial/economic loss function .................................................................. 72 6.5 Statistical hypotheses............................................................................................. 75 7 EMPIRICAL RESEARCH ................................................................................... 77 7.1 ARIMA modeling for monthly dataset .................................................................. 77 7.1.1 ARMA (5,2) model ............................................................................................. 79 7.2 ARIMA