stock market analysis using ga and neural network

30
Based on Genetic Algorithm and Back Propagation Artificial Neural Network Algorithm Presented to: Pro.Dr. : Magda B. Fayek Date:1 April 2013 By Students : Amr Abd El Latief Abd El Al Allam Sheahata Hassanien Allam Abdullah Shoukry Nagaty

Upload: amr-abd-el-latief

Post on 22-Jan-2017

466 views

Category:

Data & Analytics


0 download

TRANSCRIPT

Page 1: Stock market analysis using ga and neural network

The forecasting of Shanghai Index trend Based onGenetic Algorithm and Back Propagation Artificial

Neural Network Algorithm

Presented to:Pro.Dr. : Magda B. FayekDate:1 April 2013

By Students : Amr Abd El Latief Abd El Al Allam Sheahata Hassanien AllamAbdullah Shoukry Nagaty

Page 2: Stock market analysis using ga and neural network

2

Agenda

Introduction Problem statement Methodology Experiment Results Conclustion Reference

Page 3: Stock market analysis using ga and neural network

Introduction

3

Stock forecast, is a branch of economic forecasts, which use the accurate survey statistics and stock market information as the basis.

If we can predict the stock's ups and downs, and the stock market in a timely manner to reasonable regulation and with health guide, it will continue to develop our economy to provide a solid backing.

Page 4: Stock market analysis using ga and neural network

Introduction(cont)

4

Existence of high yield and high-risk characteristics in the stock market. people are continuing to explore its internal rules. many traditional time series analysis methods. Exponential smoothing method, ARMA (Auto

Regressive Moving Average Model) . ARCH (Auto Regressive Conditional

Heteroskedasticity Model)

Page 5: Stock market analysis using ga and neural network

Problem statement Paper presents a BP Artificial neural

network prediction modeling method for forecasting the end of Shanghai index.

Paper Uses the genetic algorithm to optimize the BP network parameters, weight and structure.

5

Page 6: Stock market analysis using ga and neural network

Methodology

6

Page 7: Stock market analysis using ga and neural network

Artificial Neural Network

7

Page 8: Stock market analysis using ga and neural network

Artificial Neural Network(Cont.)

Page 9: Stock market analysis using ga and neural network

Artificial Neural Network(Cont.) error back-propagation algorithm Its: error-correction learning rule. BP ANN Is Learning By Two

Teqhniques:Supervised learningUnsupervised learning

Page 10: Stock market analysis using ga and neural network

Genetic Algorithm

10 http://ib-poland.virtualave.net/ee/genetic1/3geneticalgorithms.htm

Page 11: Stock market analysis using ga and neural network

GA Steps To Optimize BP ANN: Intialization: p , Crossover Scale – pc Crossover

ProbabilityPm Mutation Probability WIH(ji ) Connection Weights of

Hidden L.WHO(ji) Weights of Output L.

Page 12: Stock market analysis using ga and neural network

GA Steps To Optimize BP ANN: Coding : Real Number Coding .

Initial Pobulation Takes 30

Page 13: Stock market analysis using ga and neural network

Fitness Function

. F(i) fitness value of indvidual i.

. Sum(E) sum of the squares errors

Page 14: Stock market analysis using ga and neural network

Fitness Function

i=1…..N number of chromosomes. K= 1……4 for the number of output Layers P=1…….5 the study sample size T(k) Teacher Signal

Page 15: Stock market analysis using ga and neural network

Using genetic algorithm to optimize the weights of the neural network

1) Initialize: Initialize population P, including crossover scale, Pc ,Pm and initialization for WIHij and WHOji, Paper Author use the real number coding, and the initial population take 30.

2) Select and Computing fitness: each individual evaluation function, and sort them; we can choose the network by the probability value that show in Formula; 15

Page 16: Stock market analysis using ga and neural network

Using genetic algorithm to optimize the weights of the neural network

Page 17: Stock market analysis using ga and neural network

Using genetic algorithm to optimize the weights of the neural network

3) crossover: Individual G i and G i+1 crossover operation with probability Pc to generate new individuals 'G i and , G i+1.

4) mutate: Individual Gj mutate by probability Pm, and then produce new individuals , Gj.

5) evaluate new pop: Put the individuals into the new population P, and calculate the new evaluation function of the individual.

6) decide satisfactory: If you find a satisfactory individual, then the end, or switch to 3).

After achieve the required performance indicators, will eventually decode the group's best individual you can get the optimized network connection weights.

17

Page 18: Stock market analysis using ga and neural network

Genetic algorithm to optimize the BP network’s workflow

18

Page 19: Stock market analysis using ga and neural network

Establish Forecasting Model BP ANN : 3 Layers ANN. parameters of Related Training start Training Use G A To Optimize ANN Weights Train the Optimized ANN Again Use the Optimized ANN To test

Samples.

Page 20: Stock market analysis using ga and neural network

BP neural Network Weights Optimization We need to use GA for BP weights to

be Optimized. Initialize Weights Encoding and

Fitness Calculations. Choose new Generation According to

Fitness. Repeat until Getting a set of

Weights to meet the Accuracy Req’s.

Page 21: Stock market analysis using ga and neural network

Training of BP ANN (again) Asseign the Weights and Threshold

Optimized to the BP ANN. Use training Sample To Train The

BP ANN again . Untill NN o/p and Sample o/p

Tailed . Terminate the Trainig.

Page 22: Stock market analysis using ga and neural network

Experiment Results(Cont.) After a series of training, eventually selected parameters are:

a) Population scale: popu=30b) Selection rate: opti=0.09c) Crossover: arithXoverd) Crossover rate: Pc=0.95e) Mutation: nonUnifMutationf) Mutation rate: Pm=0.1g) Genetic generations: gen=120

22

Page 23: Stock market analysis using ga and neural network

Experiment Results(Cont.) The training of the BP neural network after optimized Using genetic algorithm

program assign the weights and threshold (W1, B1, B2 W2) that after optimized to the BP neural network.

Use the training sample, to train BP network again, each 2,000 times, until network output and sample output tallied, terminate the training.

Stock Index Forecast Using the established GA-BP neural network based stock index forecasting model to predict the stock price index Output the results of the model predicted values and target values, and draw curve, to used to verify the prediction accuracy, operability and practicability.

23

Page 24: Stock market analysis using ga and neural network

Experiment result(Cont.)

24

Page 25: Stock market analysis using ga and neural network

Experiment result(Cont.) R .. BP ANN Target Value P .. Predicted Value E .. Absolute Error.

Page 26: Stock market analysis using ga and neural network

Experiment result(Cont.)

26

Page 27: Stock market analysis using ga and neural network

Conclusion

GA-BP algorithm used to avoid the BP algorithm into a local minimum, slow convergence problem, and also to overcome the GA in a similar form of exhaustive search for optimal solution search time caused by long, slow shortcomings, is a fast, reliable method.

Paper results shows that BP neural network using GA for the learning of rules and to optimize the network weights and weights of the network and the fixed threshold can improve the accuracy of stock index prediction model.

27

Page 28: Stock market analysis using ga and neural network

References [1] Shen Bing. Equity Investment Analysis [M]. Chongqing: Chongqing

Publishing House, 2002: 94. [2] Chu Yuan. Securities Investment Principles [M]. Beijing: Lixin Accounting

Book Publishing ,2003:74-78. [3] Liu Yong. China's stock market and the empirical relationship between

macroeconomic variables [J]. Finance and Trade Economics, 2004 (4): 21-27. [4] Zhang Ling Song, Tao Chongen. Stock technical analysis tool [M]. Beijing:

China Encyclopedia Publishing House, 1994: 52-56 . [5] Ma Weihua, LI Yu-hong. Stock index futures and stock market development

in China [J]. Finance Teaching and Research, 2004, (5): 50-54. [6] E.W. Saad, D. V. Prokhorov, D.C. Wunsch. Comparative Study of Stock

Trend Prediction Using Time Delay, Recurrent and Probability Neural Networks. IEEE Trans on Nerual Netowrks, 1998, 9(6): 1 4561 470.

28

Page 29: Stock market analysis using ga and neural network

Questions

?

Page 30: Stock market analysis using ga and neural network

Thank You