#使用神经网络和遗传算法进行股市预测
该模块采用神经网络和遗传算法来预测股票市场的未来价值。
用于模拟的测试数据来自孟买证券交易所(BSE)过去40年。
## 1. 导言
股票市场预测是"确定在交易所交易的公司股票或其他金融工具的未来价值的工具"。 成功预测股票的未来价格可能会产生可观的利润。 有效市场假说表明,股票价格反映了所有当前可用的信息,任何价格变化都不是基于新披露的信息,因此本质上是不可预测的。
在这个项目中,我们提出了一个使用遗传算法和神经网络的股票市场预测模型。 该技术利用七个不同的特征作为训练的输入参数,并给出"库存定价"作为输出。
使用神经网络进行预测是有利的,因为它们能够仅从示例中学习,并且在学习完成后,它们能够捕获隐藏的和强烈的非线性依赖关系,即使在训练集中有遗传算法更适合优化问题。 因此,它被用于优化神经网络的参数以获得更准确的预测。
编程语言必须与支持必须执行的任务的特殊工具相结合,无论是建模数据还是分析图像。 因此,在这个项目中,MATLAB被用作MATLAB工具箱,为科学和工程应用提供专业开发,经过严格测试和完整记录的功能。
## 2. 背景
### 2.1. 神经网络
####什么是人工神经网络?
人工神经网络(Ann)是一种信息处理范式,其灵感来自生物神经系统(如大脑)处理信息的方式。 这种范式的关键要素是信息处理系统的新颖结构。
它由大量高度互连的处理元件(神经元)组成,它们齐声工作以解决特定的问题。 ANNs和人们一样,以身作则学习。 ANN通过学习过程为特定应用(例如模式识别或数据分类)配置。
#### Basic Structure of ANNs
ANNs are composed of multiple nodes, which imitate biological neurons of human brain. The neurons are connected by links and they interact with each other. The nodes can take input data and perform simple operations on the data. The result of these operations is passed to other neurons. The output at each node is called its activation or node value.Each link is associated with weight. ANNs are capable of learning, which takes place by altering weight values. The following illustration shows a simple ANN
![Figure 1: Simple Neural Network](https://github.com/Shikhar1998/Stock-Market-Prediction-using-Neural-Networks-and-Genetic-Algorithm/blob/master/Figures/1.png)
#### Feed Forward Neural Networks:
The information flow is unidirectional. A unit sends information to other unit from which it does not receive any information. There are no feedback loops. They are used in pattern generation/recognition/classification. They have fixed inputs and outputs.
![Figure 2: Back Propogation Network](https://github.com/Shikhar1998/Stock-Market-Prediction-using-Neural-Networks-and-Genetic-Algorithm/blob/master/Figures/2.png)
#### Back Propagation Algorithm:
It is the training or learning algorithm. It learns by example. If you submit to the algorithm the example of what you want the network to do, it changes the network鈥檚 weights so that it can produce desired output for a particular input on finishing the training.Back Propagation networks are ideal for simple Pattern Recognition and Mapping Tasks.
### 2.2. Genetic Algorithm
#### What is Genetic Algorithm?
The genetic algorithm is a method for solving both constrained and unconstrained optimization problems that is based on natural selection, the process that drives biological evolution.
The genetic algorithm repeatedly modifies a population of individual solutions. At each step, the genetic algorithm selects individuals at random from the current population to be parents and uses them to produce the children for the next generation. Over successive generations, the population "evolves" toward an optimal solution.The genetic algorithm uses three main types of rules at each step to create the next generation from the current population:
鈥? Selection rules select the individuals, called parents, that contribute to the population at the next generation.
鈥? Crossover rules combine two parents to form children for the next generation.
鈥? Mutation rules apply random changes to individual parents to form children.
#### Outline of the Algorithm:
1. The algorithm begins by creating a random initial population.
2. The algorithm then creates a sequence of new populations. At each step, the algorithm uses the individuals in the current generation to create the next population. To create the new population, the algorithm performs the following steps:
a. Scores each member of the current population by computing its fitness value. These values are called the raw fitness scores.
b. Scales the raw fitness scores to convert them into a more usable range of values. These scaled values are called expectation values.
c. Selects members, called parents, based on their expectation.
d. Some of the individuals in the current population that have lower fitness are chosen as elite. These elite individuals are passed to the next population.
e. Produces children from the parents. Children are produced either by making random changes to a single parent鈥攎utation鈥攐r by combining the vector entries of a pair of parents鈥攃rossover.
f. Replaces the current population with the children to form the next generation.
3. The algorithm stops when one of the stopping criteria is met
#### Genetic Algorithm Terminology
鈥? Fitness Functions:
The fitness function is the function you want to optimize. For standard optimization algorithms, this is known as the objective function. The toolbox software tries to find the minimum of the fitness function.
鈥? Individuals:
An individual is any point to which you can apply the fitness function. The value of the fitness function for an individual is its score. For example, if the
鈥? Populations and Generations:
A population is an array of individuals. For example, if the size of the population is 100 and the number of variables in the fitness function is 3, you represent the population by a 100-by-3 matrix. The same individual can appear more than once in the population
At each iteration, the genetic algorithm performs a series of computations on the current population to produce a new population. Each successive population is called a new generation.
鈥? Diversity
Diversity refers to the average distance between individuals in a population. A population has high diversity if the average distance is large; otherwise it has low diversity.
Diversity is essential to the genetic algorithm because it enables the algorithm to search a larger region of the space.
鈥? Fitness Values and Best Fitness Values
The fitness value of an individual is the value of the fitness function for that individual. Because the toolbox software finds the minimum of the fitness function, the best fitness value for a population is the smallest fitness value for any individual in the population.
鈥? Parents and Children
To create the next generation, the genetic algorithm selects certain individuals in the current population, called parents, and uses them to create individuals in the next generation, called children. Typically, the algorithm is more likely to select parents that have better fitness values.
3. Proposed Work
### 3.1. Features
In machine learning and pattern recognition, a feature is an individual measurable property or characteristic of a phenomenon being observed.
Choosing informative, discriminating and independent features is a crucial step for effective algorithms in pattern recognition, classification and regression.
The features used in this project are as follows:
1. Opening Price:The opening price is the price at which a security first trades upon the opening of an exchange on a given trading day.
2. High Price: Today's highis the highest price at which a stock traded during the course of the day. Today'shigh is typically higher than the closing or opening price.
3. Low Price: Today's low is the lowest price at which a stock trades over the course of a trading day. Today's low is typically lower than the opening or closing price.
Simple moving average (SMA): The simple moving average is the most basic of the moving averages used for trading. The simple moving average formula is calculated by taking the average closing price of a stock over the last "x" periods.
4. Simple moving average over 10 days: This valu
使用神经网络和遗传算法的股票市场预测大师
需积分: 9 83 浏览量
2022-02-09
17:49:58
上传
评论
收藏 1.12MB ZIP 举报
EarsSky
- 粉丝: 54
- 资源: 3
最新资源
- Screenshot_20240509_034911_com.tencent.mtt.jpg
- 基于python实现的医学影像体脂分割+源代码+文档说明(课程设计)
- 基于python实现的医学影像(MIR, CT )图像分割源码+文档说明(高分课程设计)
- 基于python+JavaScript实现的医学影像分割+源代码+文档说明+截图演示+数据(高分毕业设计)
- 基于U-net+pytorch实现的医学影像分割python源码+文档说明+数据+界面截图+博客介绍
- 课程设计-基于Pytorch实现MNIST数据集的手写数字识别源码+数据(Gui界面)+文档说明+模型
- 软件开发国家标准.xls
- pytorch-CNN-SBATM-ubuntudemo
- matplotlibdemo
- pytorch-CNN-dht11温湿度传感器笔记
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
评论0