Stock Price Prediction Using Multilayer Perceptron Neural Network by Monitoring Frog Leaping Algorithm

Similar documents
Using Evolutionary Imperialist Competitive Algorithm (ICA) to Coordinate Overcurrent Relays

Shuffled Complex Evolution

Artificial Neural Networks. Artificial Intelligence Santa Clara, 2016

Evolutionary Artificial Neural Networks For Medical Data Classification

DRILLING RATE OF PENETRATION PREDICTION USING ARTIFICIAL NEURAL NETWORK: A CASE STUDY OF ONE OF IRANIAN SOUTHERN OIL FIELDS

Publication P IEEE. Reprinted with permission.

NAVIGATION OF MOBILE ROBOT USING THE PSO PARTICLE SWARM OPTIMIZATION

Improvement of Robot Path Planning Using Particle. Swarm Optimization in Dynamic Environments. with Mobile Obstacles and Target

AN IMPROVED NEURAL NETWORK-BASED DECODER SCHEME FOR SYSTEMATIC CONVOLUTIONAL CODE. A Thesis by. Andrew J. Zerngast

INTRODUCTION. a complex system, that using new information technologies (software & hardware) combined

APPLICATION OF NEURAL NETWORK TRAINED WITH META-HEURISTIC ALGORITHMS ON FAULT DIAGNOSIS OF MULTI-LEVEL INVERTER

Model Order Reduction based on meta-heuristic optimization methods

A NEW APPROACH TO GLOBAL OPTIMIZATION MOTIVATED BY PARLIAMENTARY POLITICAL COMPETITIONS. Ali Borji. Mandana Hamidi

COMPUTATONAL INTELLIGENCE

Applications of Nature-Inspired Intelligence in Finance

Comparison of MLP and RBF neural networks for Prediction of ECG Signals

Stock Market Indices Prediction Using Time Series Analysis

FINANCIAL TIME SERIES FORECASTING USING A HYBRID NEURAL- EVOLUTIVE APPROACH

Decentralized PID Controller Design for a MIMO Evaporator Based on Colonial Competitive Algorithm

Detection and classification of faults on 220 KV transmission line using wavelet transform and neural network

A Comparison of Particle Swarm Optimization and Gradient Descent in Training Wavelet Neural Network to Predict DGPS Corrections

MAGNT Research Report (ISSN ) Vol.6(1). PP , Controlling Cost and Time of Construction Projects Using Neural Network

Artificial neural networks in forecasting tourists flow, an intelligent technique to help the economic development of tourism in Albania.

CHAPTER 4 MONITORING OF POWER SYSTEM VOLTAGE STABILITY THROUGH ARTIFICIAL NEURAL NETWORK TECHNIQUE

Load Frequency Controller Design for Interconnected Electric Power System

A comparative study of different feature sets for recognition of handwritten Arabic numerals using a Multi Layer Perceptron

An Optimized Performance Amplifier

Biologically Inspired Embodied Evolution of Survival

Current Harmonic Estimation in Power Transmission Lines Using Multi-layer Perceptron Learning Strategies

Implicit Fitness Functions for Evolving a Drawing Robot

Computational Intelligence for Network Structure Analytics

Total Harmonic Distortion Minimization of Multilevel Converters Using Genetic Algorithms

FOUR TOTAL TRANSFER CAPABILITY. 4.1 Total transfer capability CHAPTER

ARTIFICIAL NEURAL NETWORK BASED CLASSIFICATION FOR MONOBLOCK CENTRIFUGAL PUMP USING WAVELET ANALYSIS

Accurate Hybrid Method for Rapid Fault Detection, Classification and Location in Transmission Lines using Wavelet Transform and ANNs

Design Of PID Controller In Automatic Voltage Regulator (AVR) System Using PSO Technique

Real-Time Selective Harmonic Minimization in Cascaded Multilevel Inverters with Varying DC Sources

ISSN: [Jha* et al., 5(12): December, 2016] Impact Factor: 4.116

Prediction of Rock Fragmentation in Open Pit Mines, using Neural Network Analysis

Use of Neural Networks in Testing Analog to Digital Converters

Smart Grid Reconfiguration Using Genetic Algorithm and NSGA-II

Transient stability Assessment using Artificial Neural Network Considering Fault Location

Enhanced MLP Input-Output Mapping for Degraded Pattern Recognition

Contents 1 Introduction Optical Character Recognition Systems Soft Computing Techniques for Optical Character Recognition Systems

Roberto Togneri (Signal Processing and Recognition Lab)

Figure 1. Artificial Neural Network structure. B. Spiking Neural Networks Spiking Neural networks (SNNs) fall into the third generation of neural netw

2. Simulated Based Evolutionary Heuristic Methodology

Journal of Applied Science and Agriculture, 8(5) October 2013, Pages: Journal of Applied Science and Agriculture

Signal Processing of Automobile Millimeter Wave Radar Base on BP Neural Network

MINE 432 Industrial Automation and Robotics

Evolutionary Computation and Machine Intelligence

Stock Market Forecasting Using Artificial Neural Networks

Classification of Voltage Sag Using Multi-resolution Analysis and Support Vector Machine

Training a Neural Network for Checkers

The Hamming Code Performance Analysis using RBF Neural Network

Behaviour Patterns Evolution on Individual and Group Level. Stanislav Slušný, Roman Neruda, Petra Vidnerová. CIMMACS 07, December 14, Tenerife

CHAPTER 4 PV-UPQC BASED HARMONICS REDUCTION IN POWER DISTRIBUTION SYSTEMS

CS 229 Final Project: Using Reinforcement Learning to Play Othello

Analysis of Learning Paradigms and Prediction Accuracy using Artificial Neural Network Models

Research Article Analysis of Population Diversity of Dynamic Probabilistic Particle Swarm Optimization Algorithms

AIS and Swarm Intelligence : Immune-inspired Swarm Robotics

Cubature Kalman Filtering: Theory & Applications

DIAGNOSIS OF STATOR FAULT IN ASYNCHRONOUS MACHINE USING SOFT COMPUTING METHODS

IBM SPSS Neural Networks

SWARM INTELLIGENCE. Mario Pavone Department of Mathematics & Computer Science University of Catania

Space Craft Power System Implementation using Neural Network

AN ANALYSIS OF SPEECH RECOGNITION PERFORMANCE BASED UPON NETWORK LAYERS AND TRANSFER FUNCTIONS

Mehrdad Amirghasemi a* Reza Zamani a

Active BIM with Artificial Intelligence for Energy Optimisation in Buildings

IDENTIFICATION OF POWER QUALITY PROBLEMS IN IEEE BUS SYSTEM BY USING NEURAL NETWORKS

On the Application of Artificial Neural Network in Analyzing and Studying Daily Loads of Jordan Power System Plant

NEURAL NETWORK DEMODULATOR FOR QUADRATURE AMPLITUDE MODULATION (QAM)

NEURAL NETWORK OPTIMIZATION USING SHUFFLEDFROG ALGORITHM FOR SOFTWARE DEFECT PREDICTION

FAULT DIAGNOSIS AND PERFORMANCE ASSESSMENT FOR A ROTARY ACTUATOR BASED ON NEURAL NETWORK OBSERVER

DISTRIBUTION NETWORK RECONFIGURATION FOR LOSS MINIMISATION USING DIFFERENTIAL EVOLUTION ALGORITHM

Vol. 2, No. 6, July 2012 ISSN ARPN Journal of Science and Technology All rights reserved.

Online Evolution for Cooperative Behavior in Group Robot Systems

A linear Multi-Layer Perceptron for identifying harmonic contents of biomedical signals

A Comparison of MLP, RNN and ESN in Determining Harmonic Contributions from Nonlinear Loads

Using of Artificial Neural Networks to Recognize the Noisy Accidents Patterns of Nuclear Research Reactors

Forecasting Exchange Rates using Neural Neworks

Artificial Neural Network Modeling and Optimization using Genetic Algorithm of Machining Process

SMARTPHONE SENSOR BASED GESTURE RECOGNITION LIBRARY

DETECTION AND CLASSIFICATION OF POWER QUALITY DISTURBANCES

Current Trends in Technology and Science ISSN: Volume: VI, Issue: VI

Control of Load Frequency of Power System by PID Controller using PSO

Implementation of FPGA based Decision Making Engine and Genetic Algorithm (GA) for Control of Wireless Parameters

CHAPTER 7 CONCLUSIONS AND FUTURE SCOPE

Voltage Controller for Radial Distribution Networks with Distributed Generation

OPTIMAL PLACEMENT OF UNIFIED POWER QUALITY CONDITIONER IN DISTRIBUTION SYSTEMS USING PARTICLE SWARM OPTIMIZATION METHOD

COMPARATIVE ANALYSIS OF ACCURACY ON MISSING DATA USING MLP AND RBF METHOD V.B. Kamble 1, S.N. Deshmukh 2 1

Optimization of Recloser Placement to Improve Reliability by Genetic Algorithm

Minimization of Power Loss and Improvement of Voltage Profile in a Distribution System Using Harmony Search Algorithm

Prediction of Compaction Parameters of Soils using Artificial Neural Network

Imperialistic Competitive Algorithm based solution to optimize both Real Power Loss and Voltage Stability Limit

Fraud detection in E-banking by using the hybrid feature selection and evolutionary algorithms

Energy Saving Scheme for Induction Motor Drives

Efficient Learning in Cellular Simultaneous Recurrent Neural Networks - The Case of Maze Navigation Problem

FACE RECOGNITION USING NEURAL NETWORKS

We are IntechOpen, the world s leading publisher of Open Access books Built by scientists, for scientists. International authors and editors

Transcription:

Stock Price Prediction Using Multilayer Perceptron Neural Network by Monitoring Frog Leaping Algorithm Ahdieh Rahimi Garakani Department of Computer South Tehran Branch Islamic Azad University Tehran, Iran ABSTRACT: In the modern world, human is daily involved in many decision-makings in diverse markets, and any suggestion which can improve accuracy of decisions or reduce the decision making time is attractive and valuable. One of the developing markets in which advantages of decision support systems are very evident and it is monetary in the capital markets including the stock market. Actors of this market purchase shares of companies and thereby make a profit or loss by accepting future share risk. This study collected data from the Tehran Stock Exchange database; then, main features of data were extracted by using wavelet transform method and applied as inputs for prediction to multilevel perceptron neural network trained by frog leaping algorithm. The results were compared with radial basis function neural network trained with frog leaping algorithms. Keywords: Frog Leaping Algorithm, Neural Network, Decision-Making Time, Stock Exchange Received: 29 August 2017, Revised 3 October 2018, Accepted 15 October 2017 2018 DLINE. All Rights Reserved 1. Introduction Investing in stocks listed in the stock exchange is one of profitable options in the capital market. The Stock market has a nonlinear chaotic system influenced by political, economic and psychological conditions. Prediction and assessment of price behaviour of securities is a subject that finance scientists and investors always tend to optimize; in this way, they have sustainable and functional methods with the least error prediction. Accordingly, mathematical methods such as simple mean, weighted mean, double mean, regression and alike were the only models which were decisively used in recent years; however, they also had some drawbacks at different times. Recently, advancement of technology in the field of computer sciences and its integration into various sciences have provided the opportunity for using neural networks due to high speed processing in computers. By using their learning capabilities, these networks learn any changes in the rules contained in time series and use them to predict the future. Considering the importance of stock price prediction, this study tends to predict stock prices in the Tehran Stock Exchange (TSE) using a multilayer perceptron neural network. Generally, stock price prediction system consists of four steps. This study collects data from TSE database; then, main features of data are extracted by using wavelet transform method. The Multilevel perceptron neural network is used for stock price prediction. A Frog leaping algorithm is used to train the neural network. Journal of Intelligent Computing Volume 9 Number 1 March 2018 15

To determine the best values for weights and bias of neural network, this study tends to use frog leaping optimization algorithm. At the initial preparation stage, each member of the population first includes a vector containing weights and biases of the neural network, which is sent as an input to objective function after being randomly initialized. The objective function receives input vector including weights and bias and is considered as weights and biases of the neural network. Then, it applies training inputs to the constructed network and network error is calculated and returned based on the output of the neural network and the target output. In the iteration step, different subgroups are created and evolved in the algorithm. Iteration continues until termination conditions are met. Upon completion of the learning process, the algorithm returns a member of the population with the best values of weight and bias. A member selected by an algorithm is a member of which mean square error of the neural network is less than the rest of the population. To examine the efficiency of the trained model, another part of data is used as experimental data [5-8].The main purpose of this study is to identify the most effective stock prediction model for companies listed in the TSE, which is constructed with an ANN trained by the evolutionary algorithm [9]. 2. Theoretical Framework 2.1 Stock Exchange Market: A stock exchange market is a market in which stock price of venture capital companies and other tradable securities are determined by supply and demand competition between buyers and sellers. Any legal or actual entity can bid or ask by receiving a transaction code with any amount of capital in this market. Any actor of this market decides to ask or bid stocks of a company based on the results of his own research and investigation, thus making his profit or loss. 2.2 Genetic Algorithms: Genetic algorithm [8] is a biological evolution-based learning method which was developed in 1970 by John Holland. A genetic algorithm generates a very large set of possible solutions for solving a problem. A solution is evaluated by using a fitness function, and some of the best solutions candidate for production of new solutions through a process called evolution. In this way, the search space evolves in order to find an optimal solution. 2.3 Particle Swarm Optimization (PSO) Algorithm: PSO algorithm is a population-based algorithm. Development of this algorithm is inspired by a massive movement of natural populations such as birds and fishes which do not individually behave cleverly, while their group behaviour is clever. Particle in this algorithm is the position candidate for solution of the problem. 2.4 Imperialist Competitive Algorithms: The imperialist competitive algorithm [9] is a mathematical modelling of social evolution. Most evolution optimization algorithms simulate natural processes, such as genetic and simulated annealing algorithms. Human evolution has other aspects other than biological evolution, such as social, intellectual, and socio-political aspects. The evolution of this aspect is inspired by the proposed imperialist competitive algorithm. Imperialist competitive algorithm travels a different path from other algorithms from the same starting point. 2.5 Frog Leaping Algorithms: This algorithm is a very simple algorithm used for direct search. It is used for generation of offspring and evolution of these very complex subsets. This strategy is used in evolutionary path using information contained in these complex subsets. 3. Materials and Methods In carrying out this study, some small constraints due to limited time and resources have led to the limited scope of the problem and the research. Some constraints are described below. The sample included 14 shares out of more than 400 shares in Tehran Stock Exchange. Based on statistical theoretical calculations, more than 450 shares were required to reach a 90% confidence level. However, 14 shares were considered as an acceptable sample at 95% confidence level considering highly similar price behaviour of different stocks in an industry and considering those35 active industries in the stock market. The Computational power of the software used in this study (MATLAB) is another consideration. This powerful software has a limited power to some available software such as R in computing efficiency and space requirements. This has no effect on computations and results of the study. However, it does not allow simultaneous calculation of a larger number of samples. In the modeling phase, the data was divided into a training dataset and test dataset. In this study, training was based on 80% % of data on a random basis, and quality of training was evaluated based on the rest of the data. The model used for prediction 16 Journal of Intelligent Computing Volume 9 Number 1 March 2018

was a feed-forward ANN model which was trained by using evolutionary algorithms. In other words, each of shuffled frog leaping algorithm(sfla), genetic algorithm(ga), imperialist competitive algorithm (ICA), and particle swarm optimization (PSO) algorithm, rather than post-propagation training algorithm, were used to train ANN. For this purpose, MATLAB was used for programming. In this study, the model was evaluated by using the mean square error (MSE 1 ). The model quality was judged in stock price prediction by using MSE in different runs of the model. At this stage of the study, ANN structure was extracted with weights and biases calculated for implementation of the model. 4. Results 4.1 Datasets Forty companies were selected from 7 non-identical industries, as listed in Table 1: Table 1. Symbol of the selected stocks Data obtained from daily trading in Tehran Stock Exchange is stored and maintained on its information servers and is available to interested parties in two ways: web services or downloadable and storable files. The downloadable file is in Excel format and contains information fields such as symbol, date, first price, maximum price, minimum price, closing price, trade volume, trade value, number of trades, last day price, company code, Latin name, name, Shamsi date and last traded price. In order to download and store data of daily trading price, 14 shares were selected and total index information was received from TSE website. 4.2 ANN Implementation for Time Series In this architecture, a hidden layer was considered for the neural network. Given the nature of the problem and the goal of stock price prediction in one day in the future, one output and, consequently, only one output neuron was considered. This prediction output was derived from the next seven effective input parameters. In ANNs with a hidden layer, it is suggested that the number of hidden neurons is at least larger than the square root of the product of the number of input neurons and the number of neurons in the output layer. This theory suggests two neurons in the hidden layer. Previous studies also show that, in general, five neurons were considered in the hidden layer. Considering these two suggestions, five neurons were considered for the hidden layer. In order to implement this model and incorporate data in ANN through MATLAB, an n 7 matrix was formed. In other words, stock price data was transformed from the input matrix environment derived from n 7 time series to another n 1 matrix environment. where, n is the number of data, is the predicted data and is the baseline data. Journal of Intelligent Computing Volume 9 Number 1 March 2018 17

4.3 Implementation of ANN Training with Evolutionary Algorithms Training of neural networks is, in fact, a problem in which optimal weights of mutual effects of neurons are determined. Several methods have been considered for solving this problem; however, more optimal results have been achieved by using evolutionary algorithms. 4.3.1 Genetic Algorithm In order to train the ANN by using genetic algorithm, the program and the required functions were coded in MATLAB. The structure of the files created to implement this algorithm in ANN training is described in Table 2. Table 2. Structure of ANN training implementation by GA 4.3.2 Particle Swarm Optimization Algorithm In order to train the ANN by using the PSO algorithm, the program and the required functions were coded in MATLAB. The structure of the files created to implement this algorithm in ANN training is described in Table 3. Table 3. Structure of ANN training implementation by PSO algorithm 4.3.3 Imperialist Competitive Algorithm In order to train the ANN by using ICA, the program and the required functions were coded in MATLAB. Structure of the files created to implement this algorithm in ANN training is described in Table 4. 4.3.4 Frog Leaping Algorithm In order to train the ANN by using a frog leaping algorithm, the program and the required functions were coded in MATLAB. The structure of the files created to implement this algorithm in ANN training is described in Table 5. 4.3.5 Application of ANN Trained by Evolutionary Algorithms The main ANN training program was run with each evolutionary algorithm chosen by following two methods for total index and each of the 14 selected stocks: 18 Journal of Intelligent Computing Volume 9 Number 1 March 2018

Table 4. Structure of ANN training implementation by ICA Table 5. Structure of ANN training implementation by frog leaping algorithm First method Running algorithms for the number of constant steps; algorithms were run for the number of result correction steps limited to 1000 steps. Second method Running algorithms for finite time; algorithms were run for a limited time (one hour). Results of ANN training by each of the evolutionary algorithms including runtime and the square of the training data error and the square of the test data error are listed in tables 6 to 10. Table 6 shows results of the ANN training with the post-propagation algorithm. Journal of Intelligent Computing Volume 9 Number 1 March 2018 19

Table 6. Results of training and testing ANN trained by post-propagation algorithm Table 7 shows the results of ANN training with genetic algorithm. Table 7. Results of training and testing ANN trained by GA Table 8 shows the results of ANN training with POS algorithm. 20 Journal of Intelligent Computing Volume 9 Number 1 March 2018

Table 8. Results of training and testing ANN trained by POS algorithm Table 9 shows the results of ANN training with ICA. Table 9. Results of training and testing ANN trained by ICA Table 10 shows the results of ANN training with frog leaping algorithm. Trend curves of MSE in different iterations of the algorithm as well as the comparative curve of the actual situation of stock price and the price predicted by the algorithm for two run modes are shown to facilitate comparison of MSE based on the training process for each of the different algorithms. Journal of Intelligent Computing Volume 9 Number 1 March 2018 21

Table 10. Results of training and testing ANN trained by frog leaping algorithm 5. Conclusion In order to predict stock prices, this study trained ANN with post-propagation algorithm, GA, PSO algorithm, ICA and frog leaping algorithm by using daily index data as well as daily price of 14stocksselected from Tehran Stock Exchange. This study tended to determine the best evolutionary algorithm used in stock price prediction algorithms by ANN with reliable and acceptable precision. According to information received from results of network training, Table 11 shows MSEs for training and testing data and their standard deviation. Table 11. Results of network testing By examining the runtime of each algorithm infinite iterations (1000 steps), it is concluded that time is inversely related to precision. No algorithm can be found which is both precise and fast. Some algorithms do a simple optimization procedure in any run; some others achieve more optimal options in any run to achieve stronger results by division and composition procedures. Thus, a proper time analysis cannot be done. It is noteworthy that algorithms which act weaker in a similar number of runs may be able to provide more efficient result at the same time. References 22 Journal of Intelligent Computing Volume 9 Number 1 March 2018

[1] Akansu, A. N., Serdijn, W. A., Selesnick, I. W. (2010). Emerging applications of wavelets: A review. 2009. [2] Costanzo, S., Trigo, L., Jimenez, L., Gonzalez, J. (2007). A Neural Network Model of the Venezuelan Economy Audio, Transactions of the IRE Professional Group on. [3] Liu, Jie. (2012). Shannon wavelet spectrum analysis on truncated vibration signals for machine incipient fault detection. [4] lttipong, P. (2008). solving non-linear continuous mathematical using shuffled frog leaping and memetic algorithm, Department of Computer Science and information technology, faculty of science, Naresuan university. [5] Artificial Neural Networks: Architectures and Applications, by Kenji Suzuki, In: In Tech 2013. [6] Neural Networks: A Comprehensive Foundation, Simon Haykin, 1986-2012. [7] Eusuff, M., Lansey, K., Pasha, F. (2006). Shuffled frog-leaping algorithm: a memetic meta-heuristic for discrete optimization, Engineering Optimization, 38 (2) 129-154. [8] Goetti, J. S., Brugh, A. W., Julstrom. B. A. (2005). Arranging the Keyboard with a Permutaion-Coded Genetic Algorithm, In: Proc. of the 2005 SCM Symposium on Applied Computing. [9] Atashpaz-Gargari, E., Lucas, C. (2007). Imperialist competitive algorithm: an algorithm for optimization inspired by imperialistic competition, In: IEEE 2007. Journal of Intelligent Computing Volume 9 Number 1 March 2018 23