Abstract—Firefly algorithm is an effective and global searching algorithm which has been widely used in a lot of areas successfully. This paper proposes an improved firefly algorithm that is called DFA algorithm and focuses on the application of DFA to the portfolio optimization problem. The experimental results show that DFA algorithm is more efficient than genetic algorithm, particle swarm optimization algorithm, differential evolution algorithm and firefly algorithm, and it has higher convergence precision and faster convergence speed.
Index Terms—firefly algorithm, meta-heuristic algorithm, global optimization, portfolio optimization problem
I. INTRODUCTION
In order to avoid or distract large risks, investors can be a different proportion of a variety of securities for organic combination. The portfolio optimization is a portfolio-based management based on the combination of revenue and risk, which is the most appropriate, best-of-breed optimal allocation of different securities under different uncertain conditions to match the benefits and risks satisfactory method of the portfolio. Modern combination theory was first proposed by American famous economist Markowitz in 1952[1], Markowitz model presents the idea and method of the smallest variance portfolio of assets (securities) and becomes an important investment tool. Markowitz model involves calculating the covariance matrix of all assets, and it is quite computational in the face of hundreds of alternative assets(securities).The traditional mathematical solution method has been difficult to adapt to a large number of assets options.
Recently, using the meta-heuristic algorithm to solve the Markowitz model has attracted more and more researchers' attention[2-5]. Zhang[6] proposes a fireworks algorithm, to solve the mean-VaR/CVaR model, experiment results show that fireworks algorithm has more advantages than genetic algorithm in solving the portfolio optimization problem. Differential Evolution is applied to obtaining the optimal portfolio by H. Zaheer and M. Pant [7], they have considered the Markovitz's Mean-Variance portfolio optimization model and the data is considered from National Stock Exchange (NSE). Kamili [8] has made a comparative study of
Manuscript received August 10, 2017; revised July 08, 2018. (Write the date on which you submitted your paper for review.) This work was supported by the National Natural Science Foundation of China (No.: 61866014, 61862027, 61762040, 61762041).
Jing Wang is with the School of Software and Communication Engineering, Jiangxi University of Finance and Economics (JXUFE), Nanchang, Jiangxi, 330013 China. E-mail:[email protected]
meta-heuristics (Cat Swarm Optimization CSO, bat algorithm BA and particle swarm optimization PSO) in the portfolio optimization problem. Zhu [9] has presented a meta-heuristic approach to portfolio optimization problem using Particle Swarm Optimization (PSO) technique, preliminary results show that the approach is very promising and achieves results comparable or superior with the state of the art solvers. Anagnostopoulos [10] has compared the effectiveness of five state-of-the-art multiobjective evolutionary algorithms (MOEAs) together with a steady state evolutionary algorithm on the mean–variance cardinality constrained portfolio optimization problem (MVCCPO). Cura [11] has used PSO technique to solve portfolio optimization problem, comparing with genetic algorithms, simulated annealing, and tabu search approaches, he has found that particle swarm optimization approach is successful in portfolio optimization. In recent years, FA algorithm has been paid more and more attention by researchers, Saraei [12] has used FA algorithm to solve the portfolio optimization problem, the test results has indicated that compared with other algorithms FA algorithm is more
power and accuracy. Tuba [13] has proposed an improved FA algorithm to the portfolio optimization problem, the test results show that the upgraded firefly algorithm is better in most cases measured by all performance indicators.
Firefly algorithm (FA) is a new population-based meta-heuristic algorithm which has outstanding performance on many optimization problems. In this paper, we use an improved FA algorithm to solve the problem of portfolio optimization. We observe the standard FA algorithm, with the number of iterations increased, in the middle of the iteration; the algorithm search ability is significantly reduced. In order to avoid this defect, we upgrade he search mechanism of the FA algorithm during that period.
The rest of this paper is organized as follows. In Section 2, Markowitz model is briefly reviewed. FA algorithm, our proposed DFA algorithm and DFA’s application in portfolio optimization problem are described in Section 3. Experimental results and analysis are presented in Section 4. Finally, the work is concluded in Section 5.
II. MARKOWITZ MODEL
Markowitz's portfolio theory argues that investors investing in equity investments have a certain investment rationality, and they always want to make a big profit with less risk when making investment decisions. Or in the case of a certain rate of return, investment is facing as little as possible investment risk. These two cases can be attributed to the classical numerical optimization problem. This paper mainly discusses the second case.
A Novel Firefly Algorithm for Portfolio
Optimization Problem
Jing Wang
IAENG International Journal of Applied Mathematics, 49:1, IJAM_49_1_07
Assuming that the investor chooses M kinds of securities as the investment object, the yield of the ith(i = 1, 2, …, M) security is , the variance is , the covariance between the securities i and the securities j is , and the investment ratio of the investors to the i-th securities is . The Markowitz model is described as follows:
(1)
(2)
(3)
Markowitz model is a quadratic objective function with linear constraints. Eq. 1 is the objective function that represents the risk, so this is an optimization problem that requires Eq. 1to be minimized. is the expected rate of return for the portfolio chosen by the investment decision maker, and Eq. 2 is a constraint to ensure that investors get a minimum yield. The total amount of investment constraints is shown in Eq. 3, to ensure that the proportion of all securities investment together will not exceed 100%.
It should be noted that the M model needs to be discussed under certain assumptions.
(1) Stock share can be unlimited division, investors can buy 1 or even 0.5 shares.
(2) There is a risk-free interest rate, and for each investor, the risk rate is the same.
(3)
Investors have no transaction costs during the securities trading process.(4)
Investors do not distinguish between the types of stocksIII. A BRIEF REVIEW OF FA
Firefly algorithm is an efficient optimization method, since it was proposed, has aroused the concern of many researchers. In this chapter, we will briefly review the current research status of FA.
In FA, the light intensity I(r) is defined by Yang[14]:
(4)
where is the initial brightness. The parameter is the light absorption coefficient, r is the distance between two fireflies.
The intensity of light is closely related to the objective function. Hence, in the optimization problem, the light intensity of the firefly x is proportional to the objective function and can be considered as I(x) f(x).
The attractiveness of a firefly is monotonically decreasing as the distance increases, and the attractiveness is as follows[14]:
(5)
where β0 is the attractiveness at r = 0.
The Stand FA is listed as follow:
Algorithm1: Framework of the proposed DFA
1 Randomly initialize N fireflies (solutions) as an initial population ;
2 Calculate the fitness v of each firefly ; 3 FEs = N and t =0;
4 while FEs ≤ MAX FEs
5 for i= 1 toN
6 forj = 1 to N
7 if
8 Move towards according to Eq. 4; 9 Calculate the fitness value of the new ; 10 FEs++;
11 end if
12 end for
13 end for
14 end while
The light absorption coefficient will determine the variation of attractiveness and .For most practical implementations, Yang suggest that and .For two fireflies and , r is defined by Yang[14]:
(6)
The light intensity of the weak firefly will move to another brighter firefly, assuming that a firefly is more brighter than firefly , the position update equation given by the following formula[14]:
(7)
Where t is the iterations.The third term of the right is a random disturbance term which contains and , is the step factor, is a random number vector obtained by Gaussian distribution or Levy flight[15].
Fister et al.[16] proposed a memetic-based firefly algorithm(MFA), which makes the dynamic change of the step factor with the evolutionary iteration. It is redefined as follows:
, (8)
where t represents the current iteration. In the above-mentioned MFA[16], Fister also changes the fireflies’s movement strategy, which can be defined by the following equation:
, (9)
where
, (10)
, (11) denotes the d-dimensional variable of the i-th firefly, is usually set to 0.2 that is the minimum value in ,
is the length of the domain of the initialization variable. and are the maximum and minimum boundaries of the variable, respectively. The proposed MFA algorithm is compared with the hybrid evolution algorithm, Tabucol and the evolutionary algorithm with SAW, the results show that the firefly algorithm is very promising and can be successfully applied in other combinatorial optimization problems.
IAENG International Journal of Applied Mathematics, 49:1, IJAM_49_1_07
IV. OUR PROPOSED FA A. Analysis of Attractiveness
From Equation 4, we know that is the attractiveness component. When tends to zero, its attraction and brightness are constant, that is, all fireflies are the same attractive, which is essentially a particle swarm optimization algorithm. On the contrary, if the is very large, the attractiveness and brightness will be a sharp decline, causing the fireflies to be completely unable to attract other fireflies or see each other. is the attractiveness coefficient, but in standard FA, is suggest to . Such regulation may not be suitable for some complex optimization problems. For a clearer understanding of the change in attractiveness
, Fig. 1 records the change trajectory of in the case of , the test function is Schwefel 2.22 (D = 30), and is set to . As shown in the Fig. 1, the attractiveness will increase as the number of iterations increases, but in the middle and late iterations, the attractiveness will quickly approach the maximum value of 1, this means that during this period, all the fireflies have a very strong attraction, which may lead to premature convergence of the algorithm and fall into the local optimum.
Therefore, based on this phenomenon, we design a simple and effective parameter strategy to dynamically adjust , it can be defined as follow:
(12)
where t is the current iteration, and is set to 0.8 in this paper. Actually, can set to , so that it can linearly adjust the rate of change of attractiveness for different optimization problems. We will discuss it in future woks. We incorporate this dynamic attraction model into the standard FA algorithm, and called it DFA.
Fig. 1 The changes of the attractiveness β based on during the search process
B. The framework of DFA
The framework of the proposed DFA is listed in algorithm2. We can see that the algorithm does not increase the number of loops, so the algorithm and the standard FA algorithm have the same algorithm complexity. Compared with the standard FA algorithm, we modified the three places.
First, we use Equation 6 in the 5th line to update the step size
α. Secondly, the attractiveness is modified by equation 14 on line 6. Thirdly, at line 10, we move the fireflies by equation 9.
Algorithm2: Framework of the proposed DFA
1 Randomly initialize N fireflies (solutions) as an initial population ;
2 Calculate the fitness value of each firefly ; 3 FEs = N and t =0;
4 while FEs ≤ MAX FEs
5 Update the step factor α according to Eq. 6; 6 Update the attractiveness β according to Eq. 14; 7 for i= 1 to N
8 for j = 1 to N 9 if
10 Move towards according to Eq. 9; 11 Calculate the fitness value of the new 12 FEs++;
13 end if 14 end for 15 end for 16 end while
C. The Application of DFA in Portfolio Optimization As can be seen from the section 2, the portfolio optimization problem can be transformed into a set of minimized optimization problems with constraints. What we need to do is to find the ratio of a set of portfolios p= ( , , … ), so that the risk of the portfolio is minimal under the premise that the expected rate of return is guaranteed.
In the FA algorithm, each firefly has a j-dimensional vector, and each j-th dimension vector which represents the proportion of a security can be generated randomly between solution spaces (0, 1).
For the constraints in Eq. 3, we make a simple normalization by the following equation, which makes the ratio of each security satisfying the constraint.
(13)
We add a punishment mechanism to the objective function to deal with the constraint of the expected yield .The Eq. 1 is changed to Eq. 14.
(14)
As shown in Eq. 14, R is a big natural number, when the portfolio does not meet the constraints of Eq. 2, the objective function Eq.14 will become very large, so as to achieve the purpose of constraints.
The Application of DFA in Portfolio Optimization is described as follow:
IAENG International Journal of Applied Mathematics, 49:1, IJAM_49_1_07
[image:3.595.61.263.490.647.2]Algorithm3:The Application of DFA in Portfolio Optimization
1 Randomly initialize N fireflies (solutions) as an initial population ;
2 Normalized initial solution by Eq. 13;
2 Calculate the fitness value of each firefly by Eq. 14; 3 FEs = N and t =0;
4 while FEs ≤ MAX FEs
5 Update the step factor α according to Eq. 8; 6 Update the attractiveness β according to Eq. 12; 7 for i= 1 toN
8 forj = 1 to N 9 if
10 Move towards according to Eq. 9; Normalized new solution by Eq. 13;
11 Calculate the fitness value of the new by Eq. 14;
12 FEs++; 13 end if 14 end for 15 end for 16 end while
V. EXPERIMENTAL AND ANALYSE A. Experimental Setup
In this section, in order to ensure the fairness of the algorithm, the following parameters of all algorithms are set to the same, and list as follow:
Population size: 20
Max generations: 1000
Run times: 50
Expected rate of return: 17%
B. Computational Results
We choose the 9 kinds of stock securities which are representatives of different industries, different circulation plates and different regions [17, 18]. The yield and covariance of securities are shown in Table 1.
Table2: The Computational Results of FA and DFA
FA DFA
Average Best Value 1.12E-02 6.95E-03
Best Value 8.28E-03 5.17E-03
Worst Value 1.30E-02 7.80E-03
[image:4.595.323.516.62.214.2]Standard Deviation 8.77E-04 6.09E-04
Table 2 records the computational results of FA and DFA. As shown in Table 1, the average best value, best value, worst value and standard deviation of FA are 1.12E-02, 8.28E-03, 1.30E-02 and 8.77E-04 respectively, while the average best value, best value, worst value and standard deviation of DFA are 6.95E-03, 5.17E-03, 7.80E-03 and 6.09E-04. The average best value and worst value of DFA are better than FA significantly. The standard deviation of DFA is also better than FA, which means DFA's 50 runs are much more stable than FA.
[image:4.595.43.295.522.614.2]In order to more visually show the DFA and FA running process, we increase the evolutionary generations to 500000 and record the trajectories of DFA and FA during the search
Fig. 2 The convergence curves of FA and DFA
progress. in figure 2. It shows FA is easy to fall into local optimum, for a long period of time, the solution of the algorithm has not been improved(about in 35000~470000 period). DFA is more efficient than FA, the solution of the algorithm has been improved with the increase of evolutionary generations. Through the curve of algorithm’s convergence, we can see that DFA can find a better solution than FA in less evolutionary generations.
In order to more objectively demonstrate the performance of the DFA algorithm, we compare FA to GA, DE, PSO, and standard FA. The comparison data of GA, DE and PSO are derived from literatures[17, 18]. All parameters are the same as those set in the literature, as shown in Section A. The comparative results are recorded in Table 3. The GA’s Minimum risk and Average risk are 0.04184 and 0.04292. The PSO’s Minimum risk and Average risk are 0.025821 and 0.027214. The DE’s Minimum risk and Average risk are 0.022612 and 0.023242. The FA’s Minimum risk and Average risk are 0.008282 and 0.011163. The DFA’s Minimum risk and Average risk are 0.005175 and 0.006951. We can find that the minimum risk and average risk of FA algorithm is better than GA algorithm but slightly worse than DE algorithm and PSO algorithm from the experimental data. The minimum and average risk of DFA are significantly better than all other algorithms, the minimum risk and average risk decreased by 77.1% and 70.9% compared to the DE algorithm, and decreased by 3% and 37% compared to the FA algorithm which is the second best algorithm. For the securities investment people, the effect is very impressive.
VI. CONCLUSION
This paper presents a new FA algorithm (DFA) and introduces DFA into the current popular portfolio research issues. The experimental results show that the DFA algorithm is superior to the standard FA algorithm, GA algorithm, DE algorithm and PSO algorithm, and has higher convergence precision and faster convergence speed.
In the future’s work, we will further study Markowitz model, adding transaction costs, taxes and other factors to the Markowitz model, and try to use the multi-objective evolutionary algorithm to solve the improved Markowitz model.
IAENG International Journal of Applied Mathematics, 49:1, IJAM_49_1_07
Table 1: Securities Yield and Covariance Securities Yield
(%)
Covariance
1 2 3 4 5 6 7 8 9
1 0.07099 0.04042 0.01593 0.01933 0.03277 0.01046 0.02665 0.0183 0.02816 0.02077
2 0.07012 0.01593 0.01119 0.01701 0.01875 0.00771 0.00705 0.00912 0.02106 0.01518
3 0.19645 0.01933 0.01701 0.09852 0.06287 0.04545 0.00694 0.0035 0.07752 0.03114
4 0.20610 0.03277 0.01875 0.06287 0.07954 0.04465 0.02072 0.00904 0.07894 0.01964
5 0.23390 0.01046 0.00771 0.04545 0.04465 0.09713 0.00585 0.01096 0.086 0.0285
6 0.05317 0.02665 0.00705 0.00694 0.02072 0.00585 0.0405 0.00953 0.01952 0.01095
7 0.13619 0.0183 0.00912 0.0035 0.00904 0.01096 0.00953 0.01986 0.01784 0.0079
8 0.21603 0.02816 0.02106 0.07752 0.07894 0.086 0.01952 0.01784 0.13343 0.03455
9 0.14386 0.02077 0.01518 0.03114 0.01964 0.0285 0.01095 0.0079 0.03455 0.06211
Table 3: The Computational Results of DE, PSO, GA, FA and DFA
GA PSO DE FA DFA
Minimum risk 0.04184 0.025821 0.022612 0.008282 0.005175
Average risk 0.04292 0.027214 0.023242 0.011163 0.006951
Optimal portfolio p
0.06954 0.02517 0 1.43E-02 1.40E-03
0.06759, 0.04754 0 1.98E-02 7.37E-02
0.1125 0.04985 0 1.08E-02 1.43E-06
0.1584 0.13141 0.15467 1.10E-03 2.41E-06
0.2448 0.27714 0.23599 6.56E-01 7.63E-01
0.04285 0.0102 0 1.23E-01 1.62E-01
0.15352 0.41015 0.60934 1.57E-01 4.18E-04
0.1454 0.01043 0 5.13E-03 3.62E-07
0.011 0.03812 0 1.33E-02 3.17E-06
ACKNOWLEDGMENT
The authors would like to thank anonymous reviewers for their detailed and constructive comments that help us to increase the quality of this work.
REFERENCES
[1] H. Markowitz, "Portfolio selection," The journal of finance, vol. 7, pp. 77-91, 1952.
[2] L. Jiang and D. Xie, "An efficient differential memetic algorithm for clustering problem," Iaeng International Journal of Computer Science, vol. 45, pp. 118-129, 2018.
[3] X. Zhang and D. Yuan, "A niche ant colony algorithm for parameter identification of space fractional order diffusion equation," Iaeng International Journal of Applied Mathematics, vol. 47, pp. 197-208, 2017.
[4] M. Abdelbarr, "Ant Colony Heuristic Algorithm For Multi-Level Synthesis of Multiple-Valued Logic Functions," Iaeng International Journal of Computer Science, vol. 37, pp. 58-63, 2010.
[5] A. Sahu and R. Tapadar, "Solving the Assignment Problem using Genetic Algorithm and Simulated Annealing," Iaeng International Journal of Applied Mathematics, vol. 36, 2007.
[6] T. Zhang and Z. Liu, "Fireworks algorithm for mean-VaR/CVaR models," Physica A: Statistical Mechanics and its Applications, vol. 483, pp. 1-8, 10/1/ 2017.
[7] H. Zaheer and M. Pant, "Solving portfolio optimization problem through differential evolution," in 2016 International Conference on Electrical, Electronics, and Optimization Techniques (ICEEOT), 2016, pp. 3982-3987.
[8] H. Kamili and M. E. Riffi, "A comparative study on portfolio optimization problem," in 2016 International Conference on Engineering & MIS (ICEMIS), 2016, pp. 1-8.
[9] H. Zhu, Y. Wang, K. Wang, and Y. Chen, "Particle Swarm Optimization (PSO) for the constrained portfolio optimization problem," Expert Systems with Applications, vol. 38, pp. 10161-10169, 8// 2011.
[10] K. P. Anagnostopoulos and G. Mamanis, "The mean–variance cardinality constrained portfolio optimization problem: An experimental evaluation of five multiobjective evolutionary algorithms," Expert Systems with Applications, vol. 38, pp. 14208-14217, 10// 2011.
[11] T. Cura, "Particle swarm optimization approach to portfolio optimization," Nonlinear Analysis: Real World Applications, vol. 10, pp. 2396-2406, 8// 2009.
[12] M. Saraei, J. Parsafard, and S. Khajouri, "A New Approach for Portfolio Optimization Problem Based on a Minimum Acceptance Level of Risk Using Firefly Meta-heuristic Algorithm," vol. 4, pp. 101-106, 2016.
[13] M. Tuba and N. Bacanin, "Upgraded firefly algorithm for portfolio optimization problem," in Computer Modelling and Simulation (UKSim), 2014 UKSim-AMSS 16th International Conference on, 2014, pp. 113-118.
[14] X.-S. Yang, Engineering Optimization: An Introduction with Metaheuristic Applications: Wiley Publishing, 2010.
[15] X.-S. Yang, "Firefly Algorithm, Lévy Flights and Global Optimization," pp. 209-218, 2010.
[16] I. Fister Jr, X.-S. Yang, I. Fister, and J. Brest, "Memetic firefly algorithm for combinatorial optimization," arXiv preprint arXiv:1204.5165, 2012.
[17] L. Jiali and J. Dazhi, "Study on the Portfolio Problem Based on Differential Evolution," Journal of Shantou University (Natural Science Edition), pp. 4-8, 2012.
IAENG International Journal of Applied Mathematics, 49:1, IJAM_49_1_07
[image:5.595.62.536.297.457.2][18] Y. Li, "Research on Securities Portfolio Based on Evolutionary Computation," CONTEMPORARY FINANCE & ECONOMICS, pp. 59-61, 2007.
Jing Wang received his Ph.D. degree from State Key Laboratory of
Software Engineering (SKLSE) at Wuhan University (WHU), China, in 2011. He is presently a Lecture in School of Software and Communication Engineering at Jiangxi University of Finance and Economics (JXUFE). His current research interests include evolutionary computation and parallel computing.