Research on the Portfolio Optimization Model under Quantitative Constraint Based on Genetic Algorithm *

This paper is based on covariance and expected return, building portfolio risk optimization model. Using Genetic Algorithm and Quadratic Programming, three securities portfolio Optimization model is resolved, and we find that Genetic Algorithm having priority for Restraint Conditions is not a linear model.


Background
The number of securities transactions is generally limited in the capital market.For example, the minimum number of regular trading stocks is 100 shares, and trading less than 100 shares is not accepted in Shanghai Stock Exchange and Shenzhen Stock Exchange.On the other hand, for various considerations, investment institutions and investors often set certain requirements for funds allocation, and portfolio needs to meet these requirements.In order to adapt the need for capital market and practical operation, it is necessary to research portfolio decision problem under risk constraint.But it is difficult to express the portfolio optimization model under numeric constraint from existing literature [1]- [5].
Genetic algorithm is based on the mechanism of natural selection and evolution.For almost 30 years of research and application, genetic algorithm is now widely used in optimization function, neural network learning procession, pattern recognition, industrial process control system and other fields.However, it is still not common to solve portfolio optimization problem under numeric constraint by genetic algorithm.This paper attempts to use genetic algorithm to solve this problem, and in order to verify the reliability of this method, a function with quadratic programming in Matlab to calculate the results is used.

Build the Portfolio Optimization Model under Numeric
Constraint [6] Consider investment institution (e.g.Fund Company) or investors invest in n kinds of risky assets.We denote the expected returns and portfolio weights of risky assets by the vectors ( ) , , , n x x x x ′ =  .The variance-covariance matrix of the risky assets' returns matrix is ( ) , it is positive definite.
( ) , , , n U u u u ′ =  represents all components of the column vector, ( ) ( )  represents all components of the column vector is 1.The efficient portfolio decision model under number constraint is denoted by However, it is difficult to obtain the optimal analytical expression for this problem, so we try to solve this problem by genetic algorithms.

Use Genetic Algorithms to Solve Portfolio Decision Model under Numeric Constraint [7]
3.1.Initialization 1) Determine population size M, crossover probability p c , mutation probability p m , maximum evolution generation maxgen, the vector of upper and lower bounds ( ) 2) Use real-code, each chromosome contains n gene loci which represent insecurities, the genevaluation represents the proportion in securities portfolio.
3) It is easy to know the following super geometry contains feasible set from the constraints.Consider , where U(0,1) represents a random number that should be uniformly distributed between (0,1), then normalize ( ) If the result does not satisfy the constraint, reject it.Then we need to use the third step to generate a new chromosome, if the chromosome is feasible, we can accept it as a member of population, then we use the notation , 1, 2, , to denote M feasible chromosome after finite sampling.Consider the code of x is v, and denoted by Calculate the fitness value of ( ) . It is better to reorder the ( ) according to the target value, and denote the first row chromosome as 0 v .If we find a better chromosome in the fu- ture evolution, use this and replace 0 v .

Selection
1) According to the principle that the more adaptable the chromosomes are, the more chance they would be selected to reproduce.Breeding probabilities for each ( ) .
that the chromosome is the best, j = M explains the chromosome is the worst.
, , .2) We use the notation

Hybridization
to denote the parents, and group them randomly such as  hybridization is performed on all groups.To perform the operation on ( ) ( ) ( ) , generate a random number c from (0,1) firstly, and then perform the hybridization as the following form between to produce two offspring: We can use hybridization on the other group as the same way.

Mutation
1) First, define the mutation probability p m .For the individuals through crossover operation mutate from j = 1 to M, repeat the following step: generate a random number r from [0,1], if m r p < , select it as mutation parent.
2) Generate random integer i and j from [1,n], random r 1 and r 2 are generated from (0,1), the mutation result value r that is the valuation of a ij , a ij represents the gene which is number I on the chromosome a ij .Similarly, a ij represents the gene which is number j on the chromosome a ij .If the constraints are not satisfied, refuse the result.Follow step 2 to generate a new chromosome, if this one is feasible, accept it as a population member.It will generate s new mutated individuals after finite sampling.

3) Consider s new individuals by mutation operation and L-s new individuals that
are not selected from hybridization in step 2, calculate their valuation.And then put them back simultaneously.There are M-L remaining individuals by choosing operation.
All of them consist of a new generation denoted by ( )

4) Termination test
If reach the maximum number of evolution, evolution is terminated, otherwise set k = k + 1, turn to the selection operation.

The Example of the Risk on Optimal Portfolio by Genetic Algorithms and Analysis
Obtain three monthly securities' returns from financial database [8] by downloading and sorting (as shown in Table 1).Compare the above results and the results get by quadratic programming with Matlab function quadprog() [9] and Excel Solver tool, calculate them and show them in Table 2. algorithm also can solve it.Therefore, the advantages of genetic algorithms are incomparable in modeling complex social and economic life.

Overview
In order to make the portfolio optimization problems close to reality, we often need to study the portfolio optimization problem under numeric constraint.This paper is based on this model to calculate the optimal portion by code; selection, crossover and mutation are adapted to portfolio decisions successfully, and optimal solution can be obtained.In order to prove the reliability of the genetic algorithm, we use quadratic programming with function quadprog() in Matlab and solver tool for quadratic programming in excel to solve this problem.This paper shows that the genetic algorithm is better than quadratic programming, because the genetic algorithm can solve non-quadratic programming problems.It is foreseeable that in the future genetic algorithms will be used widely for practical application in portfolio optimization.
) Repeat step 2 and 3 for m times in total, then we can obtain m replicated chromosomes denoted by

1 )
Define c p as the probability of hybridization in advance, the following step from j = 1 to M: Generate a random number denoted by r in [0, 1].Chose The results are running as the above program in Matlab as follows:

Table 1 .
Historical data of returns for three securities.

Table 2 ,
the results of Portfolio Optimization Model with three methods are close.But the function qudprog() in Matlab and solver tool in excel are only

Table 2 .
Results of calculation of the three methods.to linear and quadratic programming model.In addition to Quadratic Programming under liner, genetic algorithm can solve quadratic programming under nonlinear constraint, even to the complex model in which the objective function is a Nonlinear model that is not quadratic programming and the constraint is nonlinear, genetic adapted