0% found this document useful (0 votes)
14 views57 pages

Stock Market Forecasting Based On Artificial Stock Market Forecasting Based On Artificial Intelligence Technology Intelligence Technology

Here are the key points about the significance and background of this research: - Stock market forecasting is a classic research problem that can help investors if done accurately. - The stock market is a nonlinear, dynamic system influenced by many complex factors, making it difficult to predict. - Traditional linear analysis tools have not yielded ideal results for understanding the stock market's nonlinear changes. - Artificial intelligence combined with big data/computing offers new technical capabilities for stock analysis. - This research aims to better describe the stock market's nonlinear dynamics and forecast price time series trends. - Specifically, it will use neural networks as AI tools to model complex relationships in stock data and predict market movements. -

Uploaded by

Girish Khairnar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views57 pages

Stock Market Forecasting Based On Artificial Stock Market Forecasting Based On Artificial Intelligence Technology Intelligence Technology

Here are the key points about the significance and background of this research: - Stock market forecasting is a classic research problem that can help investors if done accurately. - The stock market is a nonlinear, dynamic system influenced by many complex factors, making it difficult to predict. - Traditional linear analysis tools have not yielded ideal results for understanding the stock market's nonlinear changes. - Artificial intelligence combined with big data/computing offers new technical capabilities for stock analysis. - This research aims to better describe the stock market's nonlinear dynamics and forecast price time series trends. - Specifically, it will use neural networks as AI tools to model complex relationships in stock data and predict market movements. -

Uploaded by

Girish Khairnar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 57

California State University, San Bernardino

CSUSB ScholarWorks

Electronic Theses, Projects, and Dissertations Office of Graduate Studies

8-2021

STOCK MARKET FORECASTING BASED ON ARTIFICIAL


INTELLIGENCE TECHNOLOGY
YUZHUN LIANG

Follow this and additional works at: https://scholarworks.lib.csusb.edu/etd

Part of the Business Analytics Commons, and the Finance and Financial Management Commons

Recommended Citation
LIANG, YUZHUN, "STOCK MARKET FORECASTING BASED ON ARTIFICIAL INTELLIGENCE TECHNOLOGY"
(2021). Electronic Theses, Projects, and Dissertations. 1324.
https://scholarworks.lib.csusb.edu/etd/1324

This Thesis is brought to you for free and open access by the Office of Graduate Studies at CSUSB ScholarWorks. It
has been accepted for inclusion in Electronic Theses, Projects, and Dissertations by an authorized administrator of
CSUSB ScholarWorks. For more information, please contact [email protected].
STOCK MARKET FORECASTING BASED ON ARTIFICIAL INTELLIGENCE

TECHNOLOGY

A Project

Presented to the

Faculty of

California State University,

San Bernardino

In Partial Fulfillment

of the Requirements for the Degree

Master of Science

in

Information Systems and Technology

by

Yuzhun Liang

August 2021
STOCK MARKET FORECASTING BASED ON ARTIFICIAL INTELLIGENCE

TECHNOLOGY

A Project

Presented to the

Faculty of

California State University,

San Bernardino

by

Yuzhun Liang

(August 2021)

Approved by:

Conrad Shayo, Committee Chair

Jay Varzandeh, Department Chair, Information Decision Sciences


© 2021 YUZHUN LIANG
ABSTRACT

This culminating experience project used artificial intelligence (AI)

technology to forecast and analyze the stock market and construct complex

nonlinear relationships between the input data and the output data. This project

used a radial basis function neural network to forecast and analyze the stock

market data. Compared the radial basis function neural network performance

with the feed-forward neural network and showed clearly the superiority of the

radial basis function neural network over the feed-forward neural network in the

data processing. The results showed that AI technology could effectively predict

stock market performance. Based on the results, the conclusion is that the

prediction performance of the RBF neural network is better than that of the

multilayer feed-forward neural network. Areas for future research are to explore

the use of other AI and other Neural Network Algorithms such as Back

Propagation, Convolutional, Kohonen Self Organizing, and Modular to predict

stock market performance.

iii
TABLE OF CONTENTS

ABSTRACT .......................................................................................................... iii

LIST OF FIGURES .............................................................................................. vii

CHAPTER ONE INTRODUCTION

Research Background and Significance .................................................... 1

Research Questions Addressed in This Project .............................. 6

Literature Review ............................................................................ 8

CHAPTER TWO ARTIFICIAL INTELLIGENCE

Brief Introduction ...................................................................................... 16

The Principle of AI ................................................................................... 18

CHAPTER THREE TWO TYPES OF NEURAL NETWORKS

Radial Basis Function Neural Network (RBFNN) ..................................... 24

Brief Introduction ........................................................................... 24

Basic Principle............................................................................... 25

Multilayer Feed Forward Neural Network (MLFFNN) ............................... 27

Brief Introduction ........................................................................... 27

Basic Principle............................................................................... 28

CHAPTER FOUR DATA SET ANALYSIS AND RESULTS

Introduction of Data Set ........................................................................... 30

Introduction of Simulation Software ......................................................... 31

Simulation Results ................................................................................... 31

CHAPTER FIVE CONCLUSION......................................................................... 39

APPENDIX MATLAB SOURCE CODE .............................................................. 41

v
REFERENCES ................................................................................................... 46

vi
LIST OF FIGURES

Figure 1. The main research content and thinking............................................... 2

Figure 2. The schematic diagram of the logistic regression ............................... 19

Figure 3. The application of AI technology ........................................................ 21

Figure 4. The main principle of the RBFNN ....................................................... 27

Figure 5. Forecasting the stock market based on RBFNN ................................ 32

Figure 6. Error curve of the RBFNN .................................................................. 33

Figure 7. Forecasting the stock market based on MLFFNN .............................. 37

Figure 8. Error curve of the MLFFNN ................................................................ 38

vii
CHAPTER ONE

INTRODUCTION

Research Background and Significance

Stock market forecasting has always been a classic research problem. By

predicting the stock market, the input and the output data of the stock are fitted

and analyzed with the help of computer technology and related algorithm

knowledge principles. The nonlinear relationships between the input and the output

are constructed, and the specific trend of the stock market is analyzed, which

provides a specific reference basis for the investors. After years of development,

artificial intelligence (AI) technology, combined with the Internet, big data, cloud

computing, and other mutual influences, has provided the corresponding technical

support for all walks of life.

Artificial intelligence technology is used to analyze and forecast the stock

market, seeking the nonlinear relationship between the stock market data and

providing the corresponding basis for the investors to invest in the stock market.

Price forecasting in the stock market is a hot topic nowadays. It is subject to

political events, the economic environment, corporate decisions, investor

psychology, foreign exchange risk, and many other factors. The stock market is a

highly nonlinear dynamic change system with chaotic characteristics, so it is of

great significance to predict the stock market accurately. For a long time, some

researchers have made a series of scientific attempts on the stock market to

extract some meaningful patterns to predict the specific trend of the stock prices.

1
These patterns helped the researchers to develop many models, using scientific

and technological means to provide investors with the stock price prediction.

The stock market is a typical nonlinear dynamical system, which is unpredictable

and complex. Therefore, it is challenging to predict the stock market accurately.

Although the price of a particular stock is difficult to predict accurately, the trend of

the stock market or the changing pattern of the stock market has certain regularity.

Therefore, if we can classify and predict the stock trend pattern, it will be helpful

for the further prediction of a particular stock price and promote the research of

securities investment.

Figure 1. The main research content and thinking

2
The stock market is a vast nonlinear system. There are many nonlinear

and uncertain factors, its dynamic mechanism is very complex, describing its

specific dynamic process is extremely difficult, the traditional linear technical

analysis tools are not ideal results. At present, there are two main problems in

the stock market analysis. One is how to describe the nonlinear dynamic change

process of the stock market effectively. The other is how to forecast and analyze

the time series formed by the stock prices. As shown in Figure 1, it is the main

research content and thinking of this topic.

Neural network algorithms are the most widely used in artificial intelligence

(AI) technology and the application of mature technologies. Considering the

radial basis function (RBF) neural network as a kind of feed-forward neural

network, computing speed and generalization ability is strong and has good

nonlinear mapping function. Therefore, this topic considers using the radial basis

function (RBF) neural network to the stock market's dynamic change process and

sharing the time series prediction and analysis accordingly.

There are six different ANN algorithms: Radial Basis Function,

Feedforward, Back Propagation, Convolutional, Kohonen Self Organizing,

Recurrent NN, Long STM, and Modular. Each algorithm has its unique

characteristics. The RBF neural network is a three-layer neural network,

including the input layer, the hidden layer, and the output layer. The

transformation from the input space to the hidden space is nonlinear, while the

transformation from the hidden space to the output space is linear. The

3
Feedforward neural network, referred to as the feed-forward network, is a kind of

artificial neural network. In this kind of neural network, each neuron starts from

the input layer, receives the input of the previous level, and inputs to the next

level, until the output layer, there is no feedback in the whole network, can be

represented by a directed acyclic graph. The goal of the neural training network

is to optimize the cost function so that it can find a global or local minimum value.

No matter what kind of gradient descent algorithm is used, the gradient of each

parameter needs to be calculated first. The function of backpropagation is to

calculate the partial derivatives of all parameters quickly. The Convolutional

neural network is a kind of feed-forward neural network. Artificial neurons can

respond to the surrounding units and perform large-scale image processing.

Convolutional neural networks include the convolutional layer and the pooled

layer. Convolutional neural networks include the one-dimensional convolutional

neural network, the two-dimensional convolutional neural network, and the three-

dimensional convolutional neural network. The function of the Kohonen Self-

Organizing network is to adjust the weight of the network with a large number of

sample training data through the self-organization method so that the output of

the final network can reflect the distribution of sample data. At the beginning of

network training, a certain output node can respond to a certain class of patterns

to represent the pattern class. However, it is stipulated here that adjacent nodes

on the two-dimensional plane can make a special response to a similar pattern

class in the actual pattern distribution. The cycle is a sequence of the neural

4
networks linked to the current output from the previous output, the specific forms

of the memory for the information on the front of the network, and applied to the

current output calculation. Instead of no connection between the hidden layer

nodes' connection, the input and the hidden layer include the output of the input

layer and a moment the output of the hidden layer. The neural network

construction is modularized from input to output to build a complete network

structure, that is, the calculation process of building a model. The corresponding

output can be given according to the input.

RBF neural network has a high approximation accuracy, higher than the

general neural network, even can achieve complete approximation. And the

neural network design is very convenient, can automatically increase the number

of neurons until the accuracy requirements. As a feed-forward neural network,

RBF neural network has excellent performance. It can approximate any nonlinear

function with arbitrary accuracy and has global approximation ability. This makes

the optimal local problem solved. The topology has a compact structure, and the

parameters of the structure can be learned separately, which has the

characteristics of fast convergence. RBF neural network not only has the general

advantages of neural network, such as multidimensional nonlinear mapping

ability and generalization ability, parallel information processing ability, but also

has a strong clustering analysis ability. The advantage of the simple learning

algorithm is a kind of good performance for the network, with the interpolation in

multi-dimensional space of traditional technology.

5
Also, consider that the radial basis function neural network is implemented

by the linear combination of the nonlinear function of the nonlinear mapping

function. The critical parameters in the network are the center of the basis

function and the width. The connection weights between the hidden layer and the

output layer. This topic was proposed using the backpropagation algorithm based

on the gradient descent principle to deduce the parameter updating equation.

Research Questions Addressed in This Project

Firstly, artificial intelligence technology is used to analyze and forecast the

stock market, seeking the non-linear relationship between the stock market data

and providing the corresponding basis for the investors to invest in the stock

market.

Secondly, a Neural network can effectively establish a non-linear behavior

model. Does not need to have a priori knowledge of the corresponding function

form, and does not depend on any parameter hypothesis, can effectively adapt to

a series of dynamic changes in the process of data generation.

Thirdly, this study intends to adopt the RBF neural network, whose core is

the radial basis function, a real value function whose value only depends on the

distance from the origin of the coordinates. RBF neural network is a three-layer

neural network structure, including input layer, hidden layer, and output layer.

Major research questions:

1. What is the research purpose and significance of stock forecasting?

2. What are the specific technologies of artificial intelligence technology?

6
3. What is the specific algorithm form of artificial neural network

technology?

Organization of the project:

In Chapter 2, reviews the literature on stock market prediction and

introduces the basic knowledge and application of artificial intelligence

algorithms.

In Chapter 3, the basic structures and properties of two kinds of neural

networks are introduced.

In Chapter 4, the corresponding simulation results are given.

Chapter 5: Discussion of the main results.

Chapter 6: Conclusion and areas for further study.

Research Objective. By means of the overall design and the operation of

this paper, I effectively reviewed the courses which I had learned during my

study, and systematically sorted out the relevant content and knowledge

structure system of this major, and had a more comprehensive understanding of

the professional background and the development prospect, as well as a better

knowledge of the application of the artificial intelligence Based on this research

topic and the basic theoretical knowledge I have learned before, I have a general

understanding of the background of stock prediction, and I have studied and

analyzed the theory of artificial intelligence. Through the systematic and in-depth

development of the topic, I have a clearer understanding of these contents.

7
Literature Review

Since the birth of the stock market, the volatility of the stock's closing price

has been closely watched at all levels, and there have been several ways to

study the rules of the stock market to predict its performance. In a business

environment, we want to accurately and effectively predict multiple financial

variables to make the right decisions to avoid huge losses. However, the financial

time series data analysis and prediction is extremely difficult, and the most

complex task is to improve the investment decisions because the stock market is

essentially a dynamic, nonlinear, non-stationary, non-parametric, noisy, chaotic

system. The price trend is extremely complex and easily affected by factors

affecting economic variables, industry-specific variables, company-specific

variables, investor's psychological variables, political variables, etc. Therefore,

how to predict the stock market more accurately is a subject of wide attention

from many scholars at home and abroad.

Yang and colleagues (2002) used SVR technology in financial forecasting

tasks. The SVR model is an extension of the standard SVR and can be adapted

to the margin. The volatility of financial data and its variation can be achieved by

changing the marginal value of the SVR. At the same time, they also analyzed

the impact of asymmetric margins on reducing downside risks. Hegazy et al.

(2014) used machine learning models to predict stock market prices. The

algorithm in this model combines the least square support vector machine (LS-

SVM) and particle swarm optimization (PSO).The optimized particle swarm

8
optimization algorithm can accurately predict the daily stock price by studying the

technical indicators and historical data of the stock. By selecting the best free

parameter combination for LS-SVM, PSO algorithm avoids overfitting and local

minimum problems, and improves the accuracy of prediction. They also applied

and evaluated their models using 13 benchmark financial data sets, and

compared their predictions with Levenberg-Marquardt (LM) algorithms and

artificial neural networks. Chang (2014) used artificial neural network (ANN) to

study various techniques for predicting the stock market. The purpose of his

research is to review the application of ANN in stock market forecasting, so as to

clarify the future development direction. Olatunji (2014) predicted the Saudi Stock

market through artificial neural network. The model is based on historical data on

the Saudi stock market in various periods. The results of this study also

confirmed the accuracy of the prediction model, which can be used as a

reference for traders and investors in the Saudi stock market. By improving the

rationality and accuracy of the forecasting model, investors' confidence in the

Saudi stock market will also increase.

Olatunji et al. (2014) used the closing price of a stock as a stock variable

and entered it into the system for prediction. Based on the experimental

simulation conducted, they selected the number of window gaps to determine the

number of previous days used to predict the next day's closing price data in order

to determine the best possible value (Olatunji et al., 2014). Devadoss et al.

(2013) attempted to analyze the stock price of the selected stock through neural

9
network modeling, so as to predict the closing price. The network they developed

consists of six parts: the input layer, the output layer, the hidden layer, the

opening price, the high and low closing price, and the volume. The performance

indicators of this network modeling include mean absolute percentage error,

mean absolute deviation and root mean square error (Devadoss et al., 2013). In

2013, Ramani used a multilayer feedforward artificial neural network as a tool

and used a backpropagation algorithm to predict stock prices. There are several

ways to predict stock prices, but their results suggest that artificial neural

networks can be more accurate in predicting stock prices. In order to train the

neural network to improve the accuracy of the prediction, they used a training

data set consisting of input and output. The performance of the neural network

depends on the number of layers in the network, the number of neurons in the

input layer and hidden layer, the activation function used, the learning rate,

momentum and other parameters (Ramani et al., 2013). Nayak et al. (2014)

attempted to predict the closing price of the Indian stock market. He used two

ANN models and two neurogenetic hybrid models to make predictions. They

evaluated the effects of various normalization methods on four intelligent

prediction models: simple neural network model for gradient descent training

(ANN-GD), genetic algorithm (ANN-GA),And GD trained function link artificial

neural network model (FLANN-GD) and genetic algorithm (FlANN-GA).In

addition, they also used the daily closing prices of the Bombay Stock Exchange

(BSE) for empirical research and evaluation in their research, and the results

10
showed that these models can make effective predictions for the Indian stock

market.

Nayak et al. (2014) used preprocessing methods to make predictions.

Navale (2016) designed a new system that was able to study a database of

stocks and make predictions about future data on stocks based on it. This

system is designed on the basis of neural network research. For better

prediction, Navale used the autoregressive moving average (ARMA) algorithm.

Therefore, the stock forecast given by this system is of the highest probability

(Navale et al., 2016). In 2017, Shah and others tried to make stock market

predictions using artificial neural networks. They studied the types, salient

features, internal workings of different types of neural networks, and the various

configurations in which they could operate, and made a detailed assessment of

the advantages and disadvantages of these networks. Finally, they selected the

best one from these networks and combined it with the national stock index to

predict the stock prices of the selected companies (Shah et al., 2016).Deng et al.

described and evaluated 14 kinds of advanced neural network and support

vector machine prediction techniques in the world, and analyzed and

summarized the key techniques and characteristics of each prediction method.

Then, they put forward the problems existing in the current research methods of

stock forecasting and discussed the prospects of stock forecasting (Deng et al.,

2017). In 2018, Yao et al. conducted an in-depth analysis of 180 stocks that

could have an impact on the Shanghai Stock Exchange. Firstly, they analyzed

11
the closing price of The Shanghai Stock Exchange from January 1, 2005 to June

19, 2015, calculated the logarithmic correlation coefficient, and then established

the prediction model of the stock market by using the threshold method.

Secondly, based on the centrality of local structure, the potential influence of

stock is found out according to different networks under different thresholds.

Finally, by comparing the accuracy of local information and path similarity

indexes in link prediction methods, it is proved that there is an optimal similarity

index for predicting node connection probability in different stock networks (Yao

et al., 2017).

Tripathy (2018) used feedforward neural network model to predict the

stock market. He predicted daily price movements of the Indian stock market

(S&P CNX Nifty) over an eight-year period from January 1, 2008 to April 8, 2016.

Normalized mean square error (NMSE) and sign accuracy (SCP) measures were

used to measure the accuracy of the model. The results show that the

normalized error of one day lag is only 0.02. This suggests that the forecast is

very close to the actual stock market data. Further analysis of the data showed

that the model was 60 per cent accurate in predicting the daily direction of Indian

stock market prices after the 2008 financial crisis. In addition, the results also

show that the stock market price lagging by one day has a reasonable influence

on the predictive ability of the feedforward neural network model. Thus, the

practice of the Indian stock market does not support the EFFICIENT market

hypothesis. This model is very helpful for investors, professional traders and

12
regulators to understand the effectiveness of the Indian stock market and assist

them to make appropriate investment decisions in the stock market (Tripathy et

al., 2018). Nti (2021) proposes a new stock price forecast framework. Based on a

hybrid deep neural network architecture (convolutional neural network (CNN) and

long - and short-term memory (LSTM)), this framework was named IKN-

ConvLSTM.In short, this forecasting framework enables the integration and

analysis of stock related information from six different sources. Secondly, they

also used CNN and random search algorithm as feature selectors to build a basic

model, so as to optimize their initial training parameters. Finally, they fine-tuned

the stacked LSTM network using the tuning parameters (features) of the base

model, resulting in a much better prediction accuracy for this model. They further

validated the accuracy of the model with an empirical assessment using stock

data from the Ghana Stock Exchange (GSE) from 3 January 2017 to 31 January

2020 (Nti et al., 2021).

Ferreira (2021) systematically reviews the application of AI techniques in

stock market investments based on a sample of 2,326 papers from 1995 to 2015

on Scopus. Carta (2021) proposed that machine learning could be used to deal

with the binary classification problem. The technique can also be used to predict

how much future share prices of individual companies in the STANDARD &

Poor's 500 index will change -- high or low. Machine learning materials are drawn

from published articles around the world, making it easy to identify the most

influential words in specific industry markets and at specific time intervals. Then,

13
based on these, the vocabulary is generated. Perform feature engineering and

provide the final features to the decision tree classifier. The high or low of the

forecast represents a prediction of what will happen to the price of a company's

stock the next day. In 2021, Wang proposed that artificial intelligence technology

could be applied to the Shanghai Composite Index, so as to realize the artificial

intelligence forecast of the stock index. Wang collected 3,422 Shanghai

Composite Index from the beginning of 2005 to the beginning of 2019, including

opening price, highest price, closing price, lowest price and trading volume.

Then, he selected MA, KDJ and MACD as technical indicators, and made a

detailed analysis of their application advantages and application methods in

Shanghai Composite Index. In addition, Wang's prediction of stock market

volatility has also incorporated logistic regression and support vector machines in

ai models. Finally, the research results show that the support vector basis

method based on radial basis is more suitable for the stock index prediction

model (Wang et al., 2021).

Stock market prediction technology is for the stock market investors; the

investment institutions have great economic value. To help the investors and the

investment institutions profit, avoid the investment risk, but the value of the stock

market prediction technology is far more than that. From a social level, the stock

market prediction technology can prevent the financial market systemic risk,

helps the rational allocation of the social capital. Stock data has its

14
characteristics, and the existing methods of forecasting technology are not fully

used, so its research poses new challenges to the technology.

The booming development of the stock market constantly produces many

heterogeneous data of various scales from multiple sources. The traditional idea

of simply relying on experts to analyze and forecast has been difficult to meet

industry development needs. To meet the rapid analysis of the massive stock

market data, auxiliary or even completely instead of the investors in the stock

market investment decisions, a large number of stock market prediction research

emerged based on the information technology. The research also boosted rely

on the computer-automated analysis perform even completely independent

investment decisions funds develop rapidly.

To evaluate and manage the trading risk, it is necessary to analyze and

forecast the various types of investment targets in the stock market at multiple

scales and dimensions. Therefore, stock market forecasting has great economic

significance. At the same time, stock market forecasting is also full of challenges

because of the irregularity and randomness of the market environment, which

has always been the focus of research.

15
CHAPTER TWO

ARTIFICIAL INTELLIGENCE

Brief Introduction

Artificial intelligence (AI), known as a kind of machine intelligence,

generally means the intelligence showcased by man-made machines. Usually, AI

is defined as a typical kind of computer programs to simulate human intelligence.

General textbooks define it as the research as well as design of an intelligent

agent. It furthers means that the environment can be observed its and

corresponding act can be downed to finish its tasked assigned by human’s

instructions (Russell et al., 2003). Classical definitions saying that AI, as a

intelligent system, has the capacity to interpret the external data accurately, and

further utilize that data as their knowledge to complete their missions where

flexibility is shown during the process (Russell et al., 2009).

The research of artificial intelligence is quite complex and require

profession knowledge to understand. It includes a wide range and variety in

every part of the branch field which is deep but not interconnected. The crucial

points lying here is the construction of reasoning, knowledge, planning, learning,

communication, perception, moving objects, using tools, and manipulating

machines that are similar and even superior to humans. Several tools applying AI

technology, the range is wide, from research and mathematical optimization to

logical deduction. Algorithms on the basis of bionics, cognitive psychology,

probability theory, and economics are also being developed.

16
As a result, artificial intelligence has the possibility to evolve into ultimately

a smart machine which has better ability or even is superior to us human.

Recently, more and more attention has been paid to artificial intelligence,

especially in the field of the application, including computer inserted with AI

functions and some kinds of robots which can make decisions concerning

commercial or political issues.

Artificial intelligence also refers to a simulation. In this process, machines

are made to simulate the behaviors of human-being, including the process of

learning, understanding, planning, selecting and so on. It mainly includes the

principle of realizing intelligence by the computers, making computers perform

similarly as the brains of human, therefore, the computers can then achieve a

better performance in completing tasks. Artificial intelligence has a large scope of

subjects including computer science, psychology, and so on, combing all natural

science and social science knowledge, which increases its complexity. It is also

hard to figure out the relationship between artificial intelligence and thinking

science, which is a reflection from practice and theory.

From the standpoint of thinking science, AI has its drawbacks as the ability

logical thinking is limited, considering the ability of thinking pictures or imagine.

The breakthrough of artificial intelligence should be promoted through inspiration

thinking, but can not get rid of its mathematical logic considering mathematics is

also a subject connected with the linguistics, thinking process. Therefore, the AI

17
system still rely on mathematical tools although it is not the only standard logic

applied when developing AI. Mathematics plays an important part in the artificial

intelligence development. And it further enhance the process and help to develop

rapidly. Strong AI holds that it is possible to generate intelligent machines that

are appeared to be sentient and self-aware and can further do reasoning and

problems resolution. While supporters who only believe in weak AI insisted that it

is hardly probable to invent such AI to address issues like human being. The

appearance of this technology seems smart but the implicit system still does not

obtain the ability of independent thinking, let alone self-consciousness.

The Principle of AI

This new technology, artificial intelligence is a science that has been studied

and developed for many years. Now, a large number of theories, approaches,

techniques, and corresponding systems have been made to simulate human

intelligence. Artificial intelligence aims to enable machines to understand, think,

and learn like humans, that is, to use computers or other agents to simulate

human intelligence. One of the most popular ways to realize artificial intelligence

is to train the neural network to carry out the relevant information fitting analysis

through learning (Nilsson,1982). The neural network improves the intermediate

algorithm through pairs of x and y values, making the result closer and closer to

the y value after the input of the x value. The neural network with x and y values

is the supervised learning type, while the neural network with x and y values is

the unsupervised learning, also known as the clustering algorithm (Anderson et

18
al., 1984). Deep learning mainly relies on the data, the algorithms, the computing

power, etc. With the prevalence of the Internet, massive information are

accumulated, the popularity of computers also makes computing power more

and more strong. Further, the optimization of some algorithms become more and

more mature, which promotes the development of deep learning (Genesereth et

al., 1987).

Logical regression is the basis of neural network prediction.

Where w refers to the weight and b refers to the thresholds. Represents the

Sigmoid function, and the function of Sigmoid is to convert the calculation result

to a value between 0 and 1 (there are only two results, yes or no, namely 1 or 0,

and the result should be controlled within 1 square root of 0, the closer to 1, and

the more accurate the prediction is).

Figure 2. The schematic diagram of the logistic regression

The neural network uses the loss function to judge whether its prediction

is accurate. The principle is to judge the accuracy of the calculation by comparing

the difference between the predicted value and the actual value (Menard, 2004).

19
A higher prediction accuracy is reflected by a smaller results. The neural

network's learning is to figure out a method to reduce the value of the loss

function, and the w and the b determine the value of the loss function, so the

issue can be turned into how to find the appropriate figures of the w and the b.

Gradient descent algorithms update w and b step by step, making the loss

function smaller and smaller, eventually finding the minimum or near the

minimum.

The application of AI refers to a process of cognition, decision-making and

feedback. Human brains sometimes perform poorly concerning heavy scientific

and engineering calculations. Nowadays, the computers can not only complete

such tasks, but also do them better, faster, and more accurately than the human

brains. As a result, modern people no longer consider these processes as

complicated problems with the help of artificial intelligence.

The AI applications contains a wide range of topic ,from deep learning, to

computer vision, from intelligent robots to recognition of speech or natural

language, from analyzing contexts and linguistics to controlling gestures, etc

(Wodecki et al., 2019).

20
Figure 3. The application of AI technology

As an applied branch of artificial intelligence, deep learning is an important

application field in terms of both the number of companies on the market and the

investment preference of the investors. Build a network, and random initialization

of all connections will be a great deal of the data is output to the network, the

network processing these actions and learning. If the action conforms to the

specified action, it will increase the weight if it does not conform to, reduce the

weight, adjust the weighting system through the above process, and learn more

than the human after hundreds of thousands of times. The concept of deep

learning comes from the research of the artificial neural network. A typical type of

deep learning structure is a multiple hidden layers named multilayer perceptron.

21
Moreover, deep learning combines the low-level features to form a more

abstract high-level representation of the attribute categories or the features to

discover the distributed feature representation of the data. In 2006, this

conception was put forward by Hinton et al.. They came up with an unsupervised

greedy layer-by-layer training algorithm based on the belief network (DBN),

which is aimed to solve the optimization problems concerning the deep structure.

Further, multilayer automatic encoder, as a new stucture of the deep learning is

developed. Besides, The first real multilayer structure learning algorithm is the

convolutional neural network, invented by Lecun et al., which utilizes the relative

spatial relationship to reduce the number of parameters to improve the training

performance. The motivation is to create the neural network of the human brain

for analytical learning inside the machines. Therefore, machines are designed to

imitate the mechanism of the human brain to input and output the data, including

the linguistics, the voices, and the pictures. The methods of deep learning can be

categorized as supervised learning and unsupervised learning, the same as the

approaches of machine learning. The established learning models varied among

various frameworks and structures. For example, the convolutional neural

networks (CNNs) are a machine learning model under deep supervised learning.

In contrast, deep belief networks (DCNS) is a machine learning model under the

deep supervised learning Nets (DBNs) is a machine learning model under

unsupervised learning.

22
A computer's ability to recognize the objects, the scenes, and the images

is the definition of computer vision. Computer vision has a wide range of niche

applications, including medical imaging analysis, which improves the prediction,

diagnosis, and treatment of diseases. Computer vision operates image

processing and other technical tools to break down the image analysis tasks into

manageable chunks.

The easiest to understand speech recognition technology is speech into

text and its recognition and processing. Speech recognition has many

applications, containing medical dictation, voice writing, voice control in computer

systems, telephone customer service, etc.

Analysis based on the user's behavior patterns and attributes is the

recommendation engine. Through the algorithm analysis and the processing,

actively discover the user's current or potential needs, actively push the data to

the user's data network, and then instantly transfer the preferable information to

the user, enhancing the efficiency of browsing the internet and improve the rate

of conversion.

23
CHAPTER THREE

TWO TYPES OF NEURAL NETWORKS

Radial Basis Function Neural Network (RBFNN)

Brief Introduction

The full name of the RBFNN is Radial Basis Function Neural Network. The

RBFNN is the single hidden layer of the feed-forward neural network based on

the function approximation proposed in the late 1980s (Lee et al. 1999.). With the

research becoming more and more mature, the RBFNN has appealed to the

researchers in a variety of fields result from its understandable structure, great

nonlinear approximation ability, and strong generalization capacity, and has been

seen the prevalence of application in many scientific field, for example, the

pattern classification, the function approximation, and the data mining (Elanayar,

1994).

The RBF network can approximate any nonlinear function and tackle with

the complexity to analyze rules and laws in the system. It has marvelous

generalization capacity and high speed of learning convergence. Functions like

nonlinear function approximation, time series analysis, data classification, pattern

recognition, information processing, image processing, system modeling, control,

and fault diagnosis all adopt this approach. Network called the global

approximation network if the fluctuation of one or more adjustable parameters

(weights or thresholds) of a network have an impact on its output. Every weight

on the network has to be adjusted to correspond with each input, therefore, it

24
contributes to decreasing the speed of learning the global approximation

network.

If only a few connection weights affect the output of a local area in the

input space, the network is called a local approximation network. In 1985, Powell

proposed the radial basis function (RBF) method. The so-called radial basis

function is a kind of scalar function with radial symmetry. The distance between

input mode and center vector (such as Euclidean distance) is used as the

function's independent variable for the hidden nodes of the RBF neural network,

and the radial basis function (such as the Gaussian function) is used as the

activation function. The farther the input of neurons is from the center of the

radial basis function, the lower the activation degree of neurons. The output of

the RBF network is related to the local hidden node, which is hard to input from

the data center. Therefore, the RBF neural network has the characteristics of

local mapping.

Basic Principle

The function of radial basis lies in a natural function which the final value

relies solely on the distance from the origin. Simply put, the value of the function

depends only on the distance of the store from the center point. Typical radial

basis functions include the Gaussian function, the Multiquadric function, and the

Inverse Multiquadric function, and their specific mathematical expression is as

follows:

(1) Gaussian function:

25
(2) Multiquadric function:

(3) Inverse Multiquadric function:

RBF of the shape of the Gaussian function has good local characteristics,

and its response is significant only in a neighborhood near the center point. In

contrast, the value of the function decreases monotonically with the increase of

the distance from the center point and gradually approaches 0. A three-layer

neural network can fit any function. Similarly, RBFNN has three layers, and the

hidden layer uses radial basis functions. Therefore, it can fit any function

completely. The radial basis functions mentioned above are relatively simple

forms, but more complex radial basis functions may be used in practice. For

example, there is the superior form of the radial basis functions, and that is.

Moreover, the central point is the diameter base width. The width of the

radial basis determines how fast the radial basis function falls, which is also the

size of the circle. RBFNN has only three layers, the first layer is the input layer,

the second layer is the hidden layer, and the third layer is the output layer. The

weights between the input layer and hidden layer neurons are both 1. The hidden

layer is a neuron that uses a radial basis function as an activation function. The

connection relationship between the hidden layer and the output layer is an

ordinary neural network, and the weight between them can be changed through

training. The key of RBFNN is to determine the radial basis function to determine

where the center point is, how large the diameter is, the width of the basis, and

the number of radial basis functions will affect the effect of the neural network.

26
Figure 4. The main principle of the RBFNN

Multilayer Feed Forward Neural Network (MLFFNN)

Brief Introduction

Feed-forward neural networks are also known as multilayer neural

networks. These model networks are called the feed-forward because

information only propagates forward in the neural network, through the input

nodes, then pass from the hidden layer, and finally through the output nodes. In

the MLFFNN (Multilayer Feed Forward Neural Network), no feedback connection

allows the networks' output, represented by a combination of many simpler

models (like the Sigmoid neurons), to feedback to itself. The feed-forward neural

network is composed of many Sigmoid neurons. MLFFNN can process the

nonlinearly separable data. The layer existing between the input and the output

layers is called the hidden layer. The hidden layer is used to deal with the

27
complex nonlinear separable relationship between the input and output. The

multi-layer feedforward neural network is a fully connected network composed of

an input layer, several hidden layers and an output layer. There are no loops or

loops, each layer is composed of multiple neurons. Neurons are fully connected

with the input vector, but there is no links between neurons, and there is no

cross-layer connection. The input vector of the next layer is based on the output

of the former layer. The input of the neural network is a vector, and the final

output is also a vector.

The dimension of the output vector relies on the number of neurons in the

output layer. Multilayer feed-forward neural network can be regarded as a

nonlinear composite function. It is the learning process of the input layer along

the direction of the network structure, a positive spread until the output layer, and

then by backpropagation algorithm to update the weights and bias. The whole

process cycle until meeting the maximum number of iterations or little change on

the validation set error rate.

Basic Principle

Hidden layers refer to the layer between the input and output layers in

neural networks. The neurons in the hidden layer and output layer are functional

neurons with an activation function. If only one hidden layer is included, it can be

called the multilayer neural network, and the commonly used neural network is

called the multilayer feed-forward neural network.

The structure has the following characteristics:

28
◆ Each layer of the neurons and the next layer of the neurons are

completely interconnected.

◆ There is no same layer connection between neurons.

◆ There is no cross-layer connection between neurons.

According to the above characteristics, we can see that feed-forward

refers to the absence of the loops or the loops in the network topology, rather

than that the network can only propagate forward and not backward. Information

flows through the function of x, through the middle of the calculation process, and

finally to output y, so it is called forward. There is no feedback connection

between the output of the model and the model itself. The general approximation

shows that the feedforward neural network has a linear output layer and at least

one activation function hidden layer with any compression property. As long as

sufficient hidden elements are provided for the network, it can accurately

approximate any measurable function from one finite dimensional space to

another.

29
CHAPTER FOUR

DATA SET ANALYSIS AND RESULTS

Introduction of Data Set

The corresponding stock index data set is derived from the Shanghai

Stock Exchange composite index in China. The composite index of the Shanghai

Stock Exchange is an authoritative index widely concerned and used at home

and abroad, which can be used for measuring the overall performance of China's

securities market. The trading price of the same stock was recorded for ten

consecutive days in January 2016. The data for each day included 100 sample

points, and the total amount of samples in the data set was 1000. The actual

data of the 11th day are used as the expected output data, and the forecast data

are obtained by training the model with the data of the first ten days. The model

is evaluated by comparing the deviations between the actual data and the

expected data. The stock market is a dynamic change process that is very

unstable. It is affected not only by the domestic and foreign economic factors but

also by the speculations of bankers, the regulations of the government, and other

factors. Therefore, the sample data should be selected under normal operating

conditions (i.e., with little or no instability such as the booms and the crashes).

Otherwise, if the sample is very special, only some specific rules can be

extracted, and the net reduces the network's generalization ability.

30
Introduction of Simulation Software

MATLAB is an advanced programming software based on mathematical

computation. It provides various powerful array operations for a variety of data

sets for processing. Matrices and arrays are at the core of data processing in

MATLAB since all data in MATLAB is represented and stored in arrays. Even

though MATLAB is a matrix-oriented programming language, it also has similar

programming characteristics of other computer programming languages. While

providing data processing, MATLAB also provides a range of graphical user

interface tools, which facilitates the users in terms of carrying out various

application developments.

Simulation Results

(1) RBFNN

Effective data forecasts are important in financial investment, and the

financial data of the stock fluctuations are very complex, and their changes are

highly disorderly, increasing the difficulty of predicting. The votes are generally

collected in chronological order, which can be thought of as a time sequence.

Because of the time series of stocks, the complexity and uncertainty of the

series, which inspire us to analyze the nonlinear time series, achieve effective

prediction.

The stock market is a sophisticated nonlinear dynamic system. Therefore,

its inherent law is unable to be revealed by using traditional time series prediction

technology. However, the neural network theory developed in the last ten years

31
has gradually become a powerful tool for modeling and forecasting nonlinear

dynamic systems. RBF neural network is realized by linearly combining the

nonlinear basis functions. There are two critical parameters in the network: the

center and width of the essential functions, and the other is the connection

weight between the output and hidden layers. The radial basis function neural

network is a kind of minimum local network. Compared with the standard feed-

forward network, its advantages are simple structure and simple training. The

work done by the previous nonlinear learning algorithm is completed by using a

linear learning algorithm, and the high precision characteristic of the nonlinear

algorithm can be maintained.

Figure 5. Forecasting the stock market based on RBFNN

32
Figure 6. Error curve of the RBFNN

(2) MLFFNN

As a new research field in recent years, Internet public opinion market

prediction is a valuable research field. Because of the uncertain and

unpredictable characteristics of the stock market, predicting the closing price of

the stock market has been one of the most important and challenging problems

in the stock market.

Many analyses and assumptions in the financial sector suggest that it is

possible to predict the closing price. In the traditional stock market, the prediction

of the stocks’ closing price is used in large quantities for reflecting the structure

data of the economy, such as opening price, volume, price index, etc. Therefore,

33
taping public opinion in the stock market is of great significance to the investors

by using the machine learning algorithm or the in-depth learning algorithm for

accurate and effective predictions of the closing price of the stock market.

In this section, the simulation results are mainly analyzed and explained.

This topic mainly uses two types of neural networks to analyze as well as

forecast the relevant data of the stock market, including the radial basis function

neural network and the multilayer feed-forward neural network. As shown in Fig.

5 and Fig. 7, the two types of network structures can effectively fit and predict the

data. However, Fig. 6 and Fig. 8 show that as the iteration times increase, the

error of RBFNN is much smaller than that of the MLFFNN, which verifies the

effectiveness of the RBF neural network.

Financial transactions demand a fast and reliable decision-making

process in the everchanging market environment. During the decision-making

process, the trend of employing artificial intelligence is becoming more and more

notable. Traditional statistical methods are often supplemented by machine

learning recently. The potentiality of applied machine learning relies not only on

its fast and credible performance but also on its ability to uncover hidden

knowledge in many data. Decision-making supported by the use of artificial

intelligence can partly eliminate the disadvantage of the bounded rationality of

decision-makers so as to enable the decision-makers to make better decisions

through more relevant data and information. Data mining refers to the process of

selecting effective and operable information from large databases and using the

34
selected information for making critical business decisions. The technology of

data mining is mainly based on statistics and machine learning, and the patterns

can be inferred from different models. Data mining is helpful in finding the

association between the assets and creating prediction models based on a broad

range of data. For example, historical data, the short-term exchange rates, the

interest rates can predict the stock price. Text mining is also a helpful tool in

terms of predicting the stock price. Data mining tools have the advantages of

being interactive, easy to understand, and low in cost. At the same time, they can

identify the major anomalies that need to be further checked.

Expert system is a computer-based system employing artificial

intelligence. It can simulate the reasoning process of human professionals in a

specific field of inquiry. Expert-level decision-making is realized by the expert

system through the specific knowledge obtained from human experts. The expert

system is aimed not to simulate the psychological process of the human experts

but to achieve high-quality decision-making. The expert system has to provide

suggestions in every circumstance, even if the data are incomplete. This requires

a database with multiple or alternative inferences. A genetic algorithm is a subset

of the evolutionary algorithm inspired by biological knowledge. By applying

genetic operators, the genetic algorithm can increase the individual adaptation

value in the iterative process of evolution, such as the mutation or the crossover.

The genetic algorithm is advantageous mainly in that its application does not

demand any clear knowledge about the objective function. Genetic algorithms

35
can perform well in a vast potential data set. A fuzzy system is an expert system

from fuzzy logic. Compared with the theory of probability, fuzzy logic does not

assume that the sum is equal. The fuzzy scheme system comprises three steps:

fuzzification, fuzzy reasoning, and deception removal. Fuzzy systems are

especially suitable for decision-making processes characterized by uncertainty.

Therefore, they are especially suitable for being applied in financial markets for

decision-making concerning the trading volume of related assets.

Artificial neural networks are composed of simple elements of parallel

operation. Compared with the function of the biological neural system, the

function of the artificial neural network in a large part relies on the relationship

between the elements. Through a clear understanding of the target value, the

network can learn by adjusting the value between connections (the weight

between elements). Artificial neural networks are extensively used for solving

problems of classification, prediction, and control (Bo, K. W. et al.1998). The

artificial neural networks are advantageous mainly in that they can capture

nonlinearity without knowing the functional relationship between variables. They

are resistant to outliers and do not need a specific distribution (Burrell, P. R. et

al.1997). Comparing with the economic parameter model, the artificial neural

network provides the results quicklier. Neural networks have been proven to be

extremely successfully when applied to solve the generalization problem of

corporate bond rating prediction, and it is far more effective that of the traditional

36
mathematical modeling technology (Mittal, A. K.2012).

Figure 7. Forecasting the stock market based on MLFFNN

37
Figure 8. Error curve of the MLFFNN

38
CHAPTER FIVE

CONCLUSION

In the financial research field, stock market forecasting has always been a

hotspot. Stock market forecasting attempts to predict the future value of the stock

or other investment subject of a company that are listed on an exchange. Stock

market forecasting research is usually based on the stock market data under a

certain scale.

After the analysis, some repeated patterns in the data are extracted to

provide predictions of the movement trend of the stock market on this scale.

Although the data at different scales may have different change rules, they are

also closely influenced. If the data at different scales can be comprehensively

considered, the stock market state can be described more accurately, and then

the stock market can be predicted better. The radial basis function network (RBF)

is a novel and effective feed-forward neural network with high computing speed

and generalization ability.

It has a powerful nonlinear mapping function and is well-suited for the

prediction of nonlinear time series such as stocks. Radial basis function networks

(RBF) have been widely used in predicting because of their fast convergence

and global optimality. The stock market is a sophisticated nonlinear system with

uncertainty, and its dynamic mechanism is very complex. In this paper, RBF

neural network model is used for forecasting stock prices. By comparing with

39
other forecasting methods, we can see that this method has advantages and

feasibility..

40
APPENDIX

MATLAB SOURCE CODE

41
The appendix mainly introduces the MATLAB source code used.

(1)RBFNN
clc
clear all
load ___individual_inputs
x1=(x1-min(x1))./(max(x1)-min(x1));
x2=(x2-min(x2))./(max(x2)-min(x2));
x3=(x3-min(x3))./(max(x3)-min(x3));
x4=(x4-min(x4))./(max(x4)-min(x4));
x5=(x5-min(x5))./(max(x5)-min(x5));
x6=(x6-min(x6))./(max(x6)-min(x6));
x7=(x7-min(x7))./(max(x7)-min(x7));
x8=(x8-min(x8))./(max(x8)-min(x8));
x9=(x9-min(x9))./(max(x9)-min(x9));
x10=(x10-min(x10))./(max(x10)-min(x10));
load ___stock_output
yd=stock_output(:,1);
yd=(yd-min(yd))./(max(yd)-min(yd));
p=30;
n=100;
h=2*rand(p,10)-1;
I=ones(p,1);
w1=rand(p,1);
rou=2/sqrt(2*p);
eta=0.0099;
MSE=0;
iter=1200;
for i=1:iter
for k=1:100
arg=((x1(k)*I-h(:,1)).^2+(x2(k)*I-h(:,2)).^2+(x3(k)*I-h(:,3)).^2+(x4(k)*I-
h(:,4)).^2+(x5(k)*I-h(:,5)).^2+(x6(k)*I-h(:,6)).^2+(x7(k)*I-h(:,7)).^2+(x8(k)*I-
h(:,8)).^2+(x9(k)*I-h(:,9)).^2+(x10(k)*I-h(:,10)).^2);
phi=exp(-arg./2*rou^2);
y(k)=phi'*w1;
e(k)=yd(k)-y(k);
MSE=MSE+0.5*e(k)^2;
h(:,1)=h(:,1)+eta*e(k).*w1.*phi.*(x1(k)*I-h(:,1))./rou^2;
h(:,2)=h(:,2)+eta*e(k).*w1.*phi.*(x2(k)*I-h(:,2))./rou^2;
h(:,3)=h(:,3)+eta*e(k).*w1.*phi.*(x3(k)*I-h(:,3))./rou^2;
h(:,4)=h(:,4)+eta*e(k).*w1.*phi.*(x4(k)*I-h(:,4))./rou^2;
h(:,5)=h(:,5)+eta*e(k).*w1.*phi.*(x5(k)*I-h(:,5))./rou^2;
h(:,6)=h(:,6)+eta*e(k).*w1.*phi.*(x6(k)*I-h(:,6))./rou^2;
h(:,7)=h(:,7)+eta*e(k).*w1.*phi.*(x7(k)*I-h(:,7))./rou^2;

42
h(:,8)=h(:,8)+eta*e(k).*w1.*phi.*(x8(k)*I-h(:,8))./rou^2;
h(:,9)=h(:,9)+eta*e(k).*w1.*phi.*(x9(k)*I-h(:,9))./rou^2;
h(:,10)=h(:,10)+eta*e(k).*w1.*phi.*(x10(k)*I-h(:,10))./rou^2;
w1=w1+eta*e(k)*phi;
end
AMSE(i)=MSE/k;
MSE=0;
end
figure
plot(yd,'k:','LineWidth',1.8)
hold on
plot(y,'r-<','LineWidth',1.3)
legend('Actual Output', 'Predicted Output')
xlabel('Numbers')
ylabel('Output')
set(gca,'fontsize',14,'Fontname', 'Times New Roman')
figure
plot(AMSE,'p')
xlabel('Iterations')
ylabel('Mean Square Error')
set(gca,'fontsize',14,'Fontname', 'Times New Roman')
(2)MLFFNN
clc
clear all
load ___individual_inputs
x1=(x1-min(x1))./(max(x1)-min(x1));
x2=(x2-min(x2))./(max(x2)-min(x2));
x3=(x3-min(x3))./(max(x3)-min(x3));
x4=(x4-min(x4))./(max(x4)-min(x4));
x5=(x5-min(x5))./(max(x5)-min(x5));
x6=(x6-min(x6))./(max(x6)-min(x6));
x7=(x7-min(x7))./(max(x7)-min(x7));
x8=(x8-min(x8))./(max(x8)-min(x8));
x9=(x9-min(x9))./(max(x9)-min(x9));
x10=(x10-min(x10))./(max(x10)-min(x10));
load ___stock_output
yd=stock_output(:,1);
yd=(yd-min(yd))./(max(yd)-min(yd));
n=100;
w1=0.1*rand(20,1);
w2=0.1*rand(20,1);
w3=0.1*rand(20,1);
w4=0.1*rand(20,1);
w5=0.1*rand(20,1);

43
w6=0.1*rand(20,1);
w7=0.1*rand(20,1);
w8=0.1*rand(20,1);
w9=0.1*rand(20,1);
w10=0.1*rand(20,1);
w11=0.1*rand(20,1);
wh=0.1*rand(20,1);
wo=0.1*rand;
eta=0.001;
MSE=0;
iter=1200;
for i=1:iter
for k=1:100
net1=tansig(x1(k)*w1+x2(k)*w2+x3(k)*w3+x4(k)*w4+x5(k)*w5+x6(k)*w6+x7(k)*w
7+x8(k)*w8+x9(k)*w9+x10(k)*w10-wh);
y(k)=purelin(net1'*w11-wo);
e(k)=yd(k)-y(k);
MSE=MSE+0.5*e(k)^2;
a=dpurelin(net1'*w11-wo,y(k))*e(k);
b=dtansig(x1(k)*w1+x2(k)*w2+x3(k)*w3+x4(k)*w4+x5(k)*w5+x6(k)*w6+x7(k)*w7
+x8(k)*w8+x9(k)*w9+x10(k)*w10-wh,net1);
delw1=eta*x1(k)*a*b.*w11;
delw2=eta*x2(k)*a*b.*w11;
delw3=eta*x3(k)*a*b.*w11;
delw4=eta*x4(k)*a*b.*w11;
delw5=eta*x5(k)*a*b.*w11;
delw6=eta*x6(k)*a*b.*w11;
delw7=eta*x7(k)*a*b.*w11;
delw8=eta*x8(k)*a*b.*w11;
delw9=eta*x9(k)*a*b.*w11;
delw10=eta*x10(k)*a*b.*w11;
delw11=eta*net1*a;
delwh=eta*(-1)*a*b.*w11;
delwo=eta*(-1)*a;
w1=w1+delw1;
w2=w2+delw2;
w3=w3+delw3;
w4=w4+delw4;
w5=w5+delw5;
w6=w6+delw6;
w7=w7+delw7;
w8=w8+delw8;
w9=w9+delw9;
w10=w10+delw10;

44
w11=w11+delw11;
wo=wo+delwo;
wh=wh+delwh;
end
AMSE(i)=MSE/k;
MSE=0;
end
figure
plot(yd,'k:','LineWidth',1.8)
hold on
plot(y,'g-*','LineWidth',1.3)
legend('Actual Output', 'Predicted Output')
xlabel('Numbers')
ylabel('Output')
set(gca,'fontsize',14,'Fontname', 'Times New Roman')
figure
plot(AMSE,'p')
xlabel('Iterations')
ylabel('Mean Square Error')
set(gca,'fontsize',14,'Fontname', 'Times New Roman')

45
REFERENCES

Anderson, R. S. Michalski , and T. M. Mitchell . (1984). Machine learning. an

Artificial Intelligence approach. Volume 2. Springer.

Burrell, P. R., & Folarin, B. O. (1997). The impact of neural networks in finance.

Neural Computing and Applications, 6(4), 193–200.

Carta, S. M., Consoli, S., Piras, L., Podda, A. S., & Recupero, D. R. (2021).

Explainable Machine Learning Exploiting News and Domain-Specific

Lexicon for Stock Market Forecasting. IEEE Access, 9, 30193–30205.

Devadoss, A. V., & Ligori, T. A. A. (2013). Stock Prediction Using Artificial Neural

Networks. International Journal of Web Technology, 2(2), 45–51.

Deng, J.-X., & Gan, G. (2017). A Survey of Stock Forecasting Model Based on

Artificial Intelligence Algorithm. Journal of Mathematics and Informatics, 7,

73–78.

Er, M. J., Chen, W., & Wu, S. (2005). High-speed face recognition based on

discrete cosine transform and RBF neural networks. IEEE Transactions on

Neural Networks, 16(3), 679–691.

Elaine R. (1983). Artificial intelligence. McGraw-Hill Book Co.

Elanayar, S. (1994). "Radial Basis Function Neural Networks for Approximation

and Estimation of Nonlinear Stochastic Dynamics Systems." IEEE Trans.

Neural Networks 5.

Ferreira, F. , Gandomi, A. H. , & Cardoso, R. (2021). Artificial intelligence

applied to stock market trading: a review. IEEE Access.

46
Genesereth, M. R. , & N. J. Nilsson. (1987). Logical Foundation of Artificial

Intelligence. brain broad research in artificial intelligence & neuroscience.

Hegazy, O. , O. S. Soliman , & M. A. Salam. (2014). A Machine Learning Model

for Stock Market Prediction. Computer Science 4.12:17-23.

Kolpakov, V. E. (2021). Artificial intelligence in technical diagnostics in the

example of a marine auxiliary diesel engine. Journal of Physics Conference

Series 1864.1:012151.

Lee, et al. (1999). Robust Radial Basis Function Neural Networks. IEEE

Transactions on Systems, Man & Cybernetics: Part B.

Mittal, A. K. (2012). Application of Neural Networks in Finance and Investment

Decisions.

Menard, S. (2004). Logistic Regression. American Statistician 58.4:364.

Navale, G. S., Dudhwala, N., Jadhav, K., Gabda, P., & Vihangam, B. K. (2016).

Prediction of Stock Market using Data Mining and Artificial Intelligence.

International Journal of Computer Applications, 134(12), 9–11.

Nti, I. K., Adekoya, A. F., & Weyori, B. A. (2021). A novel multi-source

information-fusion predictive framework based on deep neural networks for

accuracy enhancement in stock market prediction. Journal of Big Data, 8(1),

1–28.

Nilsson, N. J. (1982). Principle of artificial intelligence. Intelligent Systems IEEE

29.2:2 - 4.

47
Nayak, S. C. , Misra, B. B. , & Behera, H. S. . (2014). Impact of data

normalization on stock index forecasting.

Olatunji, S. O. , Alahmadi, M. S. , Elshafei, M. , & Fallatah, Y. A. . (2014).

Forecasting the saudi arabia stock prices based on artificial neural networks

model. Ahmadi, 2(5), 77.

Ramani, P. , & Murarka, P. D. . (2013). Stock Price Prediction using Multi-Layer

Feed Forward Neural Network.

Russell, S. J. , & Norvig, P. . (2003). Artificial intelligence, a modern approach.

second edition. applied mechanics & materials.

Russell, S. J. , & Norvig, P. N. . (2009). Artificial intelligence: a modern approach.

prentice hall. applied mechanics & materials.

Shah, V. V. , Mirani, S. J. , Nanavati, Y. V. , Narayanan, V. , & Pereira, S. I.

(2016). Stock Market Prediction using Neural Networks.

Tripathy, N. (2018). Predicting Stock Market Price Using Neural Network Model.

International Journal of Strategic Decision Sciences, 9(3), 84–94.

Chang, S. V. , Gan, K. S. , On, C. K. , Alfred, R. , & Anthony, P. . (2014). A

review of stock market prediction with Artificial neural network (ANN).

Control System, Computing and Engineering (ICCSCE), 2013 IEEE

International Conference on. IEEE.

Wodecki, A. (2019). Artificial Intelligence Methods and Techniques, 71–132.

48
Wong, B. K., & Selvi, Y. (1998). Neural network applications in finance: a review

and analysis of literature (1990-1996). Information & Management, 34(3),

129–139.

Wang, Z. (2021). Predicting the rise and fall of Shanghai composite index based

on artificial intelligence. E3S Web of Conferences, 235, 3063.

Yang, H., Chan, L., & King, I. (2002). Support Vector Machine Regression for

Volatile Stock Market Prediction. In IDEAL ’02 Proceedings of the Third

International Conference on Intelligent Data Engineering and Automated

Learning (pp. 391–396).

Yao, H., & Lu, Y. (2017). Analyzing the Potential Influence of Shanghai Stock

Market Based on Link Prediction Method. Journal of Systems Science and

Information, 5(5), 446–461.

49

You might also like