Comparative Economic Forecasting with Neural Networks: Forecasting Aggregate Business Sales from S&P 500 and Interest Rates
Total Page:16
File Type:pdf, Size:1020Kb
Pace University School of Computer Science and Information Systems Department of Computer Science Eshwar Singh Comparative Economic Forecasting with Neural Networks: Forecasting Aggregate Business Sales from S&P 500 and Interest Rates Master’s Thesis Supervising Faculty: Dr Anthony Joseph. Abstract Research utilizing neural networks is a rapidly growing field of study for its extensive analytical behavior. This study uses neural networks to forecast economic time-series data. It focuses on comparative economic forecasting using neural networks with the objective of forecasting aggregate business sales using Standard and Poor’s (S&P) 500 index and interest rates. The application software used was Mathworks’ Matlab and NeuroDimension’s NeuroSolutions. The two networks used were time-lagged feedforward backpropagation multilayer perceptron and the Elman recurrent neural network. These neural network models were implemented, and then trained and tested on sales and S&P 500 index, sales and interest rates, as well as sales and S&P 500 index together with interest rates. In particular, various data manipulation procedures were used, software tools employed during preprocessing, different methodologies applied during forecasting, and error metrics techniques applied during post-processing analysis and data evaluation. Furthermore, the study showed that current stock market prices were correlated to past stock prices suggesting that stock market data have long memory and can be useful for forecasting purposes. This is contrary to the efficient market hypothesis and the random walk theory assumption, which states that today’s asset price, does not depend on previous prices. Moreover, the Matlab and NeuroSolutions neural network modeling frameworks were compared to determine their relative performance and suitability for economic time series forecasting. 2 Table of contents 1. Introduction…………………………………………………………………7 2. Time Series Data………………………………………………………………9 2.1 Time Series Analysis…………………………………………………….10 2.2 Source of Data…………………………………………………………....11 2.3 Technical Analysis..……………………………………………………...12 2.4 Fundamental Analysis…..………………………………………………..12 2.5 Data Plots………………………………………………………………...13 2.6 Economic Analysis.........................................................................….......14 2.7 Indicators…................................................................................................14 7.1 Moving Averages...……………………………………………………....15 7.2 Differencing……………………………………………………………...15 3. Performance Metrics………………………………………………………….16 3.1 Correlation………………………………………………………………..16 3.2 Mean Square Error………………………………………………………..16 3.3 Root Mean Square Error………………………………………………….17 3.4 Percentage of Correct Directions…………………………………………17 3.5 Theil………………………………………………………………………18 3.6 Mean Absolute Percentage Error…………………………………………18 4. Preprocessing Tools…………………………………………………………...18 4.1 Twelve Month Differences……………………………………………….18 4.2 Volterra Filtering…………………………………………………………19 4.3 Normalization…………………………………………………………….22 4.4 Zero Mean………………………………………………………………..23 4.5 Maximum Correlation……………………………………………………23 4.6 Matlab…………………………………………………………………….25 4.7 Hurst Exponent…………………………………………………………...25 5. Neural Networks……………………………………………………………….26 5.1 Neural Network Design…………………………………………………...26 5.2 Supervised Learning………………………………………………………27 5.3 Multi-Layer Perceptron…………………………………………………...28 5.4 Temporal Neural Networks….……………………………………………29 5.5 Time-Lagged Feedforward Neural Network……………………………...30 5.6 Elman Recurrent Neural Network………………………………………...31 5.7.1 Training a Neural Network………………………………………………..33 7.2 Sliding Window Training…………………………………………………34 5.8 Generalization......................................................................................…...34 5.9 Testing the network………………………………………………………35 5.10 Design of Neural Network Models……………………………………....35 3 6. Experiments………………………………………………………………..….37 6.1 Predicting sales using S&P 500 index………………………….………….40 6.2 Predicting sales using 3-month treasury bills…………….………………..49 6.3 Predicting sales using both S&P 500 & 3-mth T-Bills…………………….57 7. Data Analysis…………………………………………………………………..63 8. Conclusion…………………………….……………………………………….67 9. References……………………………………………………………………..69 4 Table of Figures & Tables Figures 2.1 Scatter plots of filtered sales, S&P500 & 3-month T-Bills………………..9 2.2 Plots of unfiltered sales, S&P500 & 3-month T-Bills……………………..13 4.2.1 12 month differenced of Sales, S&P500 & 3-month T-Bills………………21 4.2.2 Filtered sales using the 5 th order Volterra series expansion……………. …22 4.5.1 Plot of the filtered sales versus S&P 500 shifted 6 months………………..23 4.5.2 Plot of the filtered sales versus 3-month T-Bills shifted 20 months……….24 5.1 Neural Network adaptive designs………………………………………….27 5.3 A basic architecture of the multi-layer Perceptron………………………...29 5.5 TLFN with 2 delays and 4 processing elements……………………….......31 5.6 Elman Recurrent network……………………………………………….....32 6.1.1a Predict Sales - S&P 500 unfiltered NeuroSolutions TLFN……………......40 1.1b Predict Sales - S&P 500 filtered NeuroSolutions TLFN………………......40 1.1c Predict Sales - S&P 500 filtered (shifted) NeuroSolutions TLFN….….......41 1.2a Predict Sales - S&P 500 unfiltered NeuroSolutions Elman network........…42 1.2b Predict Sales - S&P 500 filtered NeuroSolutions Elman network................43 1.2c Predict Sales - S&P 500 filtered (shifted) NeuroSolutions Elman network..43 1.3a Predict Sales - S&P 500 unfiltered Matlab TLFN……………………........44 1.3b Predict Sales - S&P 500 filtered Matlab TLFN………………………........45 1.3c Predict Sales - S&P 500 filtered (shifted) Matlab TLFN………………......45 1.4a Predict Sales - S&P 500 unfiltered Matlab Elman network..........……........46 1.4b Predict Sales - S&P 500 filtered Matlab Elman network..........………........47 1.4c Predict Sales - S&P 500 filtered (shifted) Matlab Elman network...….........47 6.2 1a Predict Sales - T-Bills unfiltered NeuroSolutions TLFN..............................49 2.1b Predict Sales - T-Bills filtered NeuroSolutions TLFN..................................49 2.1c Predict Sales - T-Bills filtered (shifted) NeuroSolutions TLFN....................50 2.2a Predict Sales - T-Bills unfiltered NeuroSolutions Elman network...............51 2.2b Predict Sales - T-Bills filtered NeuroSolutions Elman network...................51 2.2c Predict Sales - T-Bills filtered (shifted) NeuroSolutions Elman network.....52 2.3a Predict Sales - T-Bills unfiltered Matlab TLFN......................…..................53 2.3b Predict Sales - T-Bills filtered Matlab TLFN…...........................................53 2.3c Predict Sales - T-Bills filtered (shifted) Matlab TLFN...........................…..54 2.4a Predict Sales - T-Bills unfiltered Matlab Elman network................……….55 2.4b Predict Sales - T-Bills filtered Matlab Elman network.............…................55 2.4c Predict Sales - T-Bills filtered (shifted) Matlab Elman network..............….56 6.3.1a Predict Sales - S&P 500 & T-Bills unfiltered NeuroSolutions TLFN…..... 58 3.1b Predict Sales - S&P 500 & T-Bills filtered NeuroSolutions TLFN……..…58 3.2a Predict Sales - S&P 500 & T-Bills unfiltered NeuroSolutions Elman…......59 3.2b Predict Sales - S&P 500 & T-Bills filtered NeuroSolutions Elman…..........59 3.3a Predict Sales - S&P 500 & T-Bills unfiltered Matlab TLFN…....................60 3.3b Predict Sales - S&P 500 & T-Bills filtered Matlab TLFN…........................60 3.4a Predict Sales - S&P 500 & T-Bills unfiltered Matlab Elman…....................61 3.4b Predict Sales - S&P 500 & T-Bills filtered Matlab Elman…........................61 5 Tables 6.1 Training & testing subsets without account of lead/lag correlation values....37 6.2 Training & testing subsets with account of lead/lag correlation values…….38 6.3 Subdivision of datasets used in Matlab……………………………………..39 6.4 Summary of performance metrics predicting sales with S&P 500………….48 6.5 Summary of performance metrics predicting sales with 3-month T-Bills….57 6.6 Summary of performance metrics predicting sales with S&P & T-Bills…...62 6.7 Summary of Averages………………………………………………………62 6.8 Summary of performance metrics for all experiments……………………...63 6 1. Introduction The human brain is perhaps the most intricate biological system found in the human body. It functions as a processor for sensory pathway stimuli, allows for cognitive control of movement and unconsciously controls many body functions and organs utilizing neuronal pathways, and conducts these operations within nano-seconds. The human brain also serves as the reservoir for memory, whereby it stores past information which can be retrieved for future use. The artificial neural network (ANN) is a network modeled after the human brain, connected by processing elements called neurons. The connections between the neurons are a way to store the knowledge acquired by the network. These connections are representative of the network weights. Moreover the network has the ability to learn different types of relationship. This neural system can be fabricated into a complex network of processing elements to capture the intricacies of the non-linear, non-parametric time series data. The adaptive nature of these networks can provide good prediction results for even volatile and chaotic time- series data. This thesis is based on using the ANN models to forecast aggregate business sales from the S&P 500 index and 3-month treasury bills. The volatile nature and noisiness of the S&P 500 index and 3-month treasury bills data