Professional Documents
Culture Documents
PII: S0378-4371(17)30339-4
DOI: http://dx.doi.org/10.1016/j.physa.2017.04.036
Reference: PHYSA 18138
Please cite this article as: T. Zhang, Z. Liu, Fireworks algorithm for mean-VaR/CVaR models,
Physica A (2017), http://dx.doi.org/10.1016/j.physa.2017.04.036
This is a PDF file of an unedited manuscript that has been accepted for publication. As a
service to our customers we are providing this early version of the manuscript. The manuscript
will undergo copyediting, typesetting, and review of the resulting proof before it is published in
its final form. Please note that during the production process errors may be discovered which
could affect the content, and all legal disclaimers that apply to the journal pertain.
*Highlights (for review)
Highlights
1. Introduction
Intelligent algorithms have received extensive attentions from academia because
of its advantages in solving complex optimization problems. Actually, many classical
intelligent algorithms, such as genetic algorithm, particle swarm optimization
algorithm, ant colony algorithm, etc., have been used in this field and made a lot of
great achievements.
Fireworks algorithm, as a novel algorithm and a new member of intelligent
algorithm family, is proposed by Tan and Zhu(2010)[1]. By mimicking the fireworks
explosion process, fireworks algorithm can make an efficient search to obtain the
optimal solution. The Figure 1 shows the basic flowchart of fireworks algorithm.
*
Corresponding author. Email:zhfliu@126.com
Select n initial locations
x x1 , x2 , , xd f x
Where is a d-dimensions vector in the solution domain; is an
objective function of a specific optimization problem, which also can be called fitness
function;
xmin and xmax are the lower and upper bounds of the solution domain,
respectively.
For the above optimization problem, the basic idea of fireworks algorithm is to
initialize M fireworks, detonate them in the solution space, and then select M
descendant fireworks to continue the iterative process according to certain rules.
Specifically, fireworks algorithm mainly consists of the following four parts:
explosion operator, mutation operator, mapping rule and selection strategy. Among
them, the explosion operator includes three parts, i.e., explosion intensity, explosion
amplitude and displacement operator. The mutation operator uses the Gauss mutation
to increase the diversity of population. Modular arithmetic is the common method to
be use in the mapping rules, which maps the sparks that fall outside of the feasible
domain into the feasible zone. To ensure the iteration continuing, some sparks will be
selected using the selection strategy, and the distance selection strategy and the
random selection are the frequently used strategies.
Explosion operator is the core component of fireworks algorithm, and it
constitutes by three parts: explosion intensity, explosion amplitude and displacement
operator. Intuitively, explosion intensity is measured by the number of explosion
sparks, while the explosion amplitude is measured by the displacement distance. The
basic idea to decide the explosion intensity and amplitude is that, for every ‘firework’
(representing the potential solution), the less the value of corresponding fitness
function is, the bigger the explosion intensity is, and the less the explosion amplitude
is (and vice versa).
The explosion intensity, measured by the number of sparks, can be shown like
this:
ymax f xi
si m (2.2)
y f xi
n
i 1 max
Where
si is the number of sparks which is generated by the i-th fireworks; m is a
f xi
constant to limit the total amount of sparks; is the fitness value of the i-th
ymax max f xi i 1,2, , n
firework; is the largest fitness value for the current
round a m , if si am;
sˆi round b m , if si bm, a b 1; (2.3)
round si , otherwise.
sˆi
Where is the number of sparks which is generated by the i-th fireworks,
round
is an rounding function returning an integer, and a and b are the
constants given in advance.
The explosion amplitude, measured by the displacement distance, is given as the
following formula:
f xi ymin
Ai Aˆ n
i 1 f xi ymin (2.4)
Ai
Where represents the explosion amplitude of the i-th fireworks, Â is a constant,
rand 0,1
Here, d is the dimension of x , and is a function to generate a single
uniformly distributed random number between 0 and 1. For the selected dimension,
the displacement formula is given by:
xik xik rand 0, Ai (2.6)
rand 0, Ai Ai .
Where also returns a random number between 0 and
From the above operations, we can obtain many sparks and only some can be
selected for the next generation. The basic idea of selection strategy is to ensure the
spark in current population with the smallest fitness value will always been selected,
and the remaining n-1 sparks are determined by the Euclidean distance between it and
other sparks. The Euclidean distance is defined by Equation (2.7):
R xi d xi , x j xi x j (2.7)
jK jK
Where K is the full set of current population, including not only the fireworks but
also the sparks derived from the explosions. In order to guarantee the diversity, the
farther the sparks are away from the other locations, the more likely they will be
elected out. The corresponding selection probability of each spark is decided by the
following formula:
R xi
p xi
Rxj
(2.8)
jK
The Equation (2.8) shows that the spark which has larger average distance will
has higher probability to be selected, while the spark with a smaller average distance
will be selected at a lower probability.
Equations (2.2)-(2.8) form a complete iteration step of fireworks algorithm, and
sparks selected in this step will be the initial location of the next iteration. The
iteration terminates when the stopping criterion is satisfied.
the risk of the portfolio P, and if we use the standard deviation to measure it, it can be
calculated as follows:
N N
Risk P p x x
i 1 j 1
i j ij
(3.2)
ij
Here, is the covariance of asset i and j.
This paper will use other two different risk measures, VaR and CVaR, of which
there are some big advantages over the variance risk measure. VaR is a classical
method to measure risk proposed by JP Morgan. The intuitive meaning of VaR is the
maximum possible loss of a portfolio in the specific period, at a given probability
level. As VaR method is simple and easy to calculate, it has been widely used in
financial risk management. The calculation of VaR, under the confidence level of ,
is given as follows[17]:
VaR x min R : x, (3.3)
x,
Where is the cumulative distribution function of the loss, and under the
hypothesis of normal distribution, VaR can be written as follows:
VaR 1 P RP (3.4)
Where is the distribution function of normal distribution.
However, VaR method also has some inherent defects itself, especially does not
satisfy the consistency axiom, so Rockafellar and Uryasev (2000) provide a CVaR
method which satisfies the consistency axiom perfectly[17], and
CVaR is calculated by the following equation:
CVaR x 1 f x, y p y dy.
1
f x , y VaR x
(3.5)
x max x, 0 f x, y
under the confidence level of . Thus, this function gives a connection with
More specifically, if we consider the historical data generated from the sampling, then
the corresponding approximation to F x , can be written as:
q
1
F x,
q 1 k 1
xT . (3.7)
3.2 Coding
When solving the portfolio problem, each firework represents a feasible solution
and carries two kinds of information: the investment proportion in each asset and the
corresponding fitness function value. Therefore, the code formula of each firework is
as follows:
x1 , x2 , , xN ; fitness x (3.8)
Since there is a normalized constraint on the investment proportion, i.e., the
sum of proportions equals one, and the original fireworks algorithm is only coded to
the problem with a bounded constraint, we need to modify the generation mechanism
of sparks to satisfy the constraint condition. This paper adopts the simplest way to
deal with this process: based on the original algorithm code, after each step of the
selection strategy in is executed, we add a normalized constraint to the selected sparks.
Then, the modified code can be written as:
' x1 , x2 , , xN s ; fitness x ' (3.9)
N
s xi
Where i 1 , which is the key to guarantee the optimization solution satisfy the
normalized constraint. Essentially, it maps all sparks generated from the explosion
process to a unit space. Of course, for the normalization method, some possible better
ways of mapping needs further investigation.
price of stock.
The detailed steps to obtain this 10-stocks portfolio are as follows. First, we
exclude all the “special treatment” stocks. And then, we sort all the remaining stocks
in descending order according to their market capitalization at the end of the year
2014. Finally, we select the 10 stocks by equal spacing (1st, 101st, 201st, …,901st).
Table 1 shows the descriptive statistics of the selected 10 stocks, and Table 2
shows the covariance matrix.
In order to verify the efficiency of fireworks algorithm in solving the mean-VaR
model and the mean-CVaR model, this paper chooses the standard genetic algorithm
for comparison. There are some other intelligent algorithms applied to solve the
portfolio optimization problems, but among them, the genetic algorithm is the most
well-known and influential one, which is originally proposed by Holland. Based on
the evolutionary process of biological organisms in nature, studies have shown that
genetic algorithm is a promising approach to this field and has shown its superiority.
For example, Shoaf and Foster (1996) introduce the genetic algorithm for the efficient
set portfolio problem and find that its time complexity is better than that of quadratic
programming[18]. Chang et al.(2000) use three heuristic algorithms for solving the
standard and constrained portfolio optimization model, and find the genetic
algorithm[19].
Specifically, we consider the models under the different confidence levels (90%,
95%, 99%) and different degrees of risk aversion( 0.2 , 0.5 , 0.8 ). The
number of iterations for each experiment will be fixed to 1000, and each experiment
will be repeated 100 times. In fireworks algorithm, how to set the initial number of
fireworks and the number of sparks generated from firework explosion process
depends on the specific optimization problem, which needs to seek a balance between
the accuracy of solution and the elapsed time. In general, more initial fireworks and
sparks from the explosion will lead to a higher accuracy, but more time consuming. In
order to avoid the distortion of comparison result caused by parameter setting, this
paper sets both the initial fireworks’ number and the corresponding sparks’ number as
1. With this simplest parameter setting, there will to be a worst accuracy. For other
parameters, this paper uses the original parameters setting of the basis fireworks
algorithm which is given by the computational intelligence laboratory of Peking
University. And all the parameters of genetic algorithm are the same as the default
settings in the genetic algorithm toolbox in Matlab 12.0, except the terminating
condition. Note here that we run the programs on a PC with a 3.70 GHz Intel i3-6100
CPU and 8 GB of RAM.
Table 3 and Table 4 show the optimization results of the mean-VaR model and
mean-CVaR model respectively. Given different confidence level and different risk
aversion coefficient, we can obtain the results from fireworks algorithm and genetic
algorithm, including return of the portfolio, risk (VaR or CVaR) of the portfolio, the
objective function value and the computer time in seconds (note here that all the times
reported only include the optimization time). All these values are averages of 100
experiments, and the number in brackets is the corresponding standard deviation.
From the above tables we can find that, at different confidence level and different
risk aversion level, the optimal objective function value obtained by fireworks
algorithm is smaller than that obtained by genetic algorithm, no matter in mean-VaR
model or in mean-CVaR model. It means that fireworks algorithm has better
performance than the genetic algorithm. A smaller optimal objective function value
also exhibits a more efficient frontier. For example, given a confidence level of 99%
and a risk aversion level of 0.2 in the mean-VaR model, the mean return from
fireworks algorithm (0.068204) is higher than that from genetic algorithm (0.067402),
indicating a higher return, while the variance of return is lower, indicating a lower risk.
That is to say, to invest such a portfolio according to the optimal proportion of each
stock from fireworks algorithm can make a higher return with a lower risk.
Further, we can also find that fireworks algorithm can greatly improve the
optimization speed, which is roughly a hundred times faster than the genetic
algorithm. This is an amazing result, and we think it may be partly because we adopt
the genetic algorithm from the default Matlab toolbox. But we have tried the program
written by ourselves and the result still holds.
Finally, by comparing the standard deviation of 100 repetitive experiments, we
can further find that all the standard deviations of each output result from fireworks
algorithm are less than those from genetic algorithm. And it indicates that fireworks
algorithm has better stability than genetic algorithm when solving the portfolio
models.
5、Conclusions
This paper introduces the fireworks algorithm which is a novel intelligent
algorithm into the field of portfolio optimization. We use it to solve the mean-VaR
model and the mean-CVaR model, repeat each experiment 100 times, and then
compare the results with that from genetic algorithm. All the average results from
fireworks algorithm show its better optimization performance than that from genetic
algorithm. It indicates that, when solving the portfolio optimization problem,
fireworks algorithm has more advantages than genetic algorithm. More accurately,
fireworks algorithm can make a more optimal result with lower time-consumption and
the results are more stable when repeated, showing a higher accuracy, a faster speed
and a better reliability. And it also means that, it is feasible to apply fireworks
algorithm to the field of portfolio optimization, and as an emerging method, it is
worthy of further attention.
The results presented in this paper are preliminary and future efforts should be
devoted to extending the application of fireworks algorithm. Specifically, the
following detailed investigations are needed for further discussion: 1) to verify the
efficiency of some improved fireworks algorithms; 2) to verify its efficiency in more
general portfolio optimization problems; 3) to make a more comprehensive
comparison with other classical intelligent algorithms.
Acknowledgements
This research was supported by the Natural Science Foundation of Hainan
Province(20167242,20167250),the Colleges and Universities Scientific Research Proj
ects of the Education Department of Hainan Province(Hnky2016-7), and the Youth
Fund of Hainan University(qnjj1507).
Reference
[1] Tan Y, Zhu Y. Fireworks algorithm for optimization[M]. Advances in Swarm Intelligence,
Springer, 2010: 355-364.
[2] Pei Y, Zheng S, Tan Y, et al. An empirical study on influence of approximation approaches on
enhancing fireworks algorithm[Z]. IEEE International Conference on Systems, Man, and
Cybernetics (SMC), 2012: 1322-1327.
[3] Liu J, Zheng S, Tan Y. The improvement on controlling exploration and exploitation of firework
algorithm[M]. Advances in swarm intelligence, Springer, 2013: 11-23.
[4] Zheng S, Janecek A, Tan Y. Enhanced fireworks algorithm[Z]. IEEE Congress on Evolutionary
Computation (CEC), 2013: 2069-2077.
[5] Li J, Zheng S, Tan Y. Adaptive fireworks algorithm[Z]. IEEE Congress on Evolutionary
Computation (CEC), 2014: 3214-3221.
[6] Zheng S, Janecek A, Li J, et al. Dynamic search in fireworks algorithm[Z]. IEEE Congress on
Evolutionary Computation (CEC), 2014: 3222-3229.
[7] Yu C, Kelley L, Zheng S, et al. Fireworks algorithm with differential mutation for solving the cec
2014 competition problems[Z]. IEEE Congress on Evolutionary Computation (CEC), 2014:
3238-3245.
[8] Gao H, Diao M. Cultural firework algorithm and its application for digital filters design[J].
International Journal of Modelling, Identification and Control. 2011, 14(4): 324-331.
[9] Zhang B, Zhang M, Zheng Y. A hybrid biogeography-based optimization and fireworks
algorithm[Z]. IEEE Congress on Evolutionary Computation (CEC), 2014: 3200-3206.
[10] Janecek A, Tan Y. Swarm intelligence for non-negative matrix factorization[J]. Recent Algorithms
and Applications in Swarm Intelligence Research. 2012: 168.
[11] Zheng S, Tan Y. A unified distance measure scheme for orientation coding in identification[Z].
International Conference on Information Science and Technology (ICIST), 2013: 979-985.
[12] He W, Mi G, Tan Y. Parameter optimization of local-concentration model for spam detection by
using fireworks algorithm[M]. Advances in swarm intelligence, Springer, 2013: 439-450.
[13] Dai Z, Li D, Wen F. Worse-case conditional value-at-risk for asymmetrically distributed asset
scenarios returns[J]. Journal of Computational Analysis and Applications. 2016, 20(2): 237-251.
[14] Wen F, He Z, Dai Z, et al. Characteristics of investors’ risk preference for stock markets[J].
Economic Computation and Economic Cybernetics Studies and Research. 2014, 48(3): 235-254.
[15] Zhang W, Zhang T, Liu Z. Fireworks algorithm for Markowitz portfolio optimization[J]. Working
paper. 2016.
[16] Tan Ying. An Introduction to Fireworks Algorithm, Science Press, 2015(In Chinese).
[17] Rockafellar R T, Uryasev S. Optimization of conditional value-at-risk[J]. Journal of risk. 2000, 2:
21-42.
[18] Shoaf J S, Foster J A. A Genetic Algorithm Solution to the Efficient Set Problem: A Technique for
Portfolio Selection Based on the Markowitz Model: Proceedings of the Decision Science
Institute[Z]. Orlando: 1996.
[19] Chang T, Meade N, Beasley J E, et al. Heuristics for cardinality constrained portfolio
optimisation[J]. Computers & Operations Research. 2000, 27(13): 1271-1302.