Abstract
Portfolio optimization is a mathematical formulation whose objective is to maximize returns while minimizing risks. A great deal of improvement in portfolio optimization models has been made, including the addition of practical constraints. As the number of shares traded grows, the problem becomes dimensionally very large. In this paper, we propose the usage of modified biogeography-based optimization to solve the large-scale constrained portfolio optimization. The results indicate the effectiveness of the method used.
1. Introduction
A portfolio can be defined as a collection of assets, which can include cash, real estate, stocks, or crypto. Portfolio optimization concerns maximizing returns and minimizing risks; returns are the expected profit from the investment, whereas risks are the possible changes in values of the investment. In Markowitz (1952), the authors proposed the use of the means and variances of the portfolio as the return and risk measures. Good practice in portfolio optimization is very crucial in investment, because it greatly affects the outcome of the investment. In this paper, we focus on portfolios consisting of correlated stocks.
The model proposed by Markowitz (1952) has been studied by many researchers over the years. A possible approach for the problem is the capital asset pricing model (CAPM). CAPM has been used extensively by many financial practitioners. In Parmikanti et al. (2020), the authors studied portfolio optimization under CAPM with a heteroscedastic model for the return series. Since its introduction, many improvements have been made to the model. Some improvements add practical constraints, which can be discrete or continuous; hence, the resulting model becomes mixed-integer nonlinear programming (MINLP). For instance, Jobst et al. (2001) and Bartholomew-Biggs and Kane (2009) considered adding roundlot constraints, which means that shares must be bought in a multiple of some integer. In Jobst et al. (2001), the authors used the FortMP solver, whereas Bartholomew-Biggs and Kane (2009) used DIRECT hybridized with quasi-Newton methodology. In Jobst et al. (2001), the authors also noted that the resulting efficiency is not continuous, making CAPM inapplicable in this case. With increasing complexity, various techniques also emerged. AUGMECON2 is a state-of-the-art multi-objective MINLP solver. It was introduced by Mavrotas and Florios (2013) and has been shown to very effective in solving multi-objective MINLP. Recent use of AUGMECON2 in portfolio optimization can be found in Chen et al. (2021). The downside of this method is its computational complexity. In Chen et al. (2021), the authors noted that for some large-dimensional problems, AUGMECON2 did not give a converged solution after 7 days.
To circumvent the complexity of exact methods, an efficient optimizer is needed. One popular approach is to use metaheuristic algorithms. Metaheuristic algorithms are usually inspired by natural processes in biology, chemistry, physics, or society. Most of the time, it is expected that metaheuristic algorithms can produce near-optimal solutions. Furthermore, an exact method is expected to be implemented later to obtain more accuracy, such in Bartholomew-Biggs and Kane (2009). In Chang et al. (2000), the authors proposed a series of modified metaheuristic algorithms that exploit the structure of the MV model with cardinality and quantity constraints. The metaheuristic algorithms used were genetic algorithm (GA), tabu search (TS), and simulated annealing (SA). To handle the cardinality and quantity constraints, they implemented an algorithm to adjust the solutions.
Another example of a metaheuristic algorithm is biogeography-based optimization (BBO). It was developed by Simon (2008); its inspiration is the dynamics of the geography of habitats. It basically consists of migration and mutation. Elitism is also added to ensure faster convergence. BBO has been used to solve numerous optimization problems in the real world. Some newer applications of BBO can be found in Reihanian et al. (2023) and Ren et al. (2023). Those studies concluded that BBO is a very powerful optimizer. For MINLP, Garg (2015) showed the efficiency of BBO in solving reliability problems and the results demonstrated the superiority of BBO over other metaheuristics. In their approach, the integral and discrete constraints were treated as if they were continuous, but in the function evaluation, they were rounded accordingly. This is sensible, because BBO is known for its effectiveness in continuous optimization. One of the reasons why we chose BBO is that it requires minimal parameters and is easy to implement.
For applications in portfolio optimization, there are some entries in the literature that have used BBO as the main optimizer. In Ye et al. (2017), the authors used BBO to solve a portfolio optimization problem with second-order stochastic dominance constraints. In Garg and Deep (2019), the authors used a variant of BBO called Laplacian biogeogeography-based optimization (LX-BBO) to find portfolio allocation from 10 assets in an MV model. In Panwar et al. (2018), the authors used BBO to solve a constrained MV model and applied the results in forecasting via Monte Carlo. The number of assets used in that research was 15.
Over the time, the number of companies listed in the stock markets are increasing. There are many markets with a very large number of companies. Although this provides a good opportunity for investors to choose assets, this also creates the problem in choosing suitable assets. In Perold (2022), the author studied how to efficiently choose a subset of a large set to optimize a portfolio. He considered a constrained portfolio optimization with a cardinality constraint and a quantity constraint. His method was inspired by quadratic programming techniques and was later improved to work very well for solving portfolio optimization. In Qu et al. (2017), the authors considered a multiobjective constrained mean-variance model and used four methods to solve the problem. The methods they used were Normalized Multiobjective Evolutionary Algorithm based on Decomposition (NMOEA/D), Multiobjective Differential Evolution based on Summation Sorting (MODE-SS), and Multiobjective Differential Evolution based on Nondomination Sorting (MODE-NDS), Multiobjective Comprehensive Learning Particle Swarm Optimizer (MO-CLPSO), and Nondominated Sorting Genetic Algorithm II (NSGA-II). The constraint they added to the model was a preselection constraint. They concluded that the methods were efficient for large-scale portfolio optimization. They also suggested adding practical constraints such as the cardinality constraint and the quantity constraint for further research.
In this paper, we proposed the usage of the heuristic ideas of Chang et al. (2000) but implemented in a BBO framework to solve a constrained MV model. The reason we used the ideas of Chang et al. (2000) is that they worked very well on a large-scale portfolio in their study. The dimensions studied by that work were 31, 85, 89, 98, and 225. Their methods could solve a large-scale portfolio optimization problem with high accuracy and in short time. It is clear that standard methods do not solve this problem effectively because the computational complexity is very large.
We used data from ORLibrary, which is available online. The same data were used in Chang et al. (2000) and Kabbani (2022). We also compare our results with theirs using the same performance metric. The results show that BBO is competitive in comparison to other methods.
The organization of this paper is as follows. Section 2 introduces the problems that we solve in this paper and how we solve them. The problem is multiobjective constrained portfolio optimization. Then, introduce biogeography-based optimization (BBO) before detailing the method we propose. Section 3 contains the results of our proposed approach and a comparison with other studies. Conclusions and further improvements are also included in that section.
2. Materials and Methods
2.1. Portfolio Optimization
The aim of this subsection is to introduce the problems discussed in the paper. First, we describe the unconstrained MV model. Then, we discuss the constrained MV model. We follow the formulation used in Kabbani (2022).
2.1.1. Unconstrained MV Model
Suppose there are n assets, . Let denote the budget share or allocation for the assets. The unconstrained MV model can be written as
where R is the target return, is the expected return of the ith asset, and is the covariance between the ith and jth asset. Expression (1) indicates the objective is to minimize risk, where variance is taken as the risk measure. Constraint (2) tells that minimum required return is R. Constraint (3) is called the budget constraint, meaning all the budget must be spent in investment. Constraint (4) means the budget share is never negative, so that short selling is not allowed. (1)–(4) altogher is called the unconstrained MV model.
2.1.2. Constrained MV Model
Formally, the constrained MV model is
where . iff the ith asset is in the portfolio. The variable in expression (5) is the risk attitude parameters. The closer to 1, the more risk aversity occurs. On the other hand, the closer to 0, the more risk seeking occurs. So, instead of finding the optimal values to just one value of target return, we will find a set of pareto optimal solutions. Constraint (6) is still the same budget constraint. Constraint (7) is called the cardinality constraint, i.e., the number of assets in the portfolio must be K. Constraint (8) is called the quantity constraint. It is a conditional bound that limits the maximum and minimum of allocation in the individual asset if the asset is in the portfolio.
2.2. Biogeography-Based Optimization
BBO was first introduced by Simon (2008). Biogeography studies the distribution of species over habitats. Biogeography mathematically models the natural process of how species migrate from a habitat to another habitat, how new species emerge, and how species become extinct. Migration consists of two kinds: immigration is the event of new species entering a new habitat and emigration is the event of species leaving a habitat (but not necessarily fully disappear from the original habitat). Each habitat (mathematically expressed as n-dimensional vectors) has its own characteristics. Each characteristic is called suitability index variable (SIV). Basically, SIV are the decision variables in the optimization problem. Habitat suitability index (HSI) is the fitness value of a habitat. HSI measures how supportive a habitat accomodates its species. In optimization problems, HSI is the objective function. Each habitat is ranked based on the HSI, the habitat with higher HSI is ranked better than habitat with lower HSI.
Let denote N habitats. Habitat has exactly i distinct species. The dth SIV (dth-coordinate) of habitat will be denoted by . Each habitat has its own immigration rate () and emigration rate (). Frequently, linear immigration and emigration rates are used. Guo et al. (2014) listed some of popular migration rate models, such as constant, linear, trapezoidal, quadratic, and sinusoidal models. Each migration model has their own advantages and disadvantages. In addition, they also studied the convergence properties of the BBO algorithm and some techniques on how to improve the convergence of BBO algorithm based on the migration rates. Let E and I denote the maximum emigration rate and immigration rate, respectively, In linear migration rate, we have
This is depicted in Figure 1. High number of species will cause a habitat saturated, resulting its species to search for better habitat and prevent more species to enter the overcrowded habitat. Hence, habitat with big number of species will have big emigration rate and small immigration rate. On the contrary, habitat will a small number of different species has big immigration rate and big emigration rate.
Figure 1.
Immigration rate and Emigration rate.
In BBO, habitat with better HSI will have more species, because it is more suitable to live in. In conclusion, a better habitat will affect worse habitat to become better. The migration process in BBO is given by Algorithm 1.
| Algorithm 1: Migration |
|
Another variation of migration process was introduced by Ma and Simon (2011). It has a blending parameter which makes migration process more random. can be a constant or randomly chosen at each iteration. In this paper, we use constant . Algorithm 2 describes blended migration algorithm.
| Algorithm 2: Blended Migration |
|
Natural events like disaster or pandemic can also happen in a habitat. It can trigger some unpredictable changes in the habitat. In BBO, this is called the mutation process. Mutation is more likely to occur in a habitat with extremely high or low number of species. On the other hand, mutation is improbable in a habitat with medium number of species. The mutation probability of a habitat is
denote the probability that a habitat will have species count i and . According to Wei et al. (2022), is given by
Mutation in BBO is performed based on Algorithm 3.
| Algorithm 3: Mutation |
|
Another essential component in the BBO algorithm is the existence of elitism. In short, elitism is the preservation of optimal habitats. During the elitism process, best habitas (typically a very small subset of high ranked habitats) from previous generation will replace the worst habitats in next generation. This procedure ensures next generation best habitats are not worse than the previous generation best habitats. In their study, Ma et al. (2014) proved an interesting result about the convergence of the BBO algorithm for binary problem. The existence of migration and mutation operators without elitism do not guarantee convergence of the BBO algorithm. However, migration and mutation operators combined with elitism will almost surely produce a convergent solution. Hence, elitism is an essential part of the BBO algorithm. In general, the BBO algorithm follows Algorithm 4.
| Algorithm 4: Biogeography-Based Optimization |
|
2.3. Modified BBO
One technique to solve a constrained optimization problem is using penalty function. But, excessive number of penalty functions will have negative effects in the computational complexity. It also reduces the ability to explore and exploit feasible solutions. Most the time, large amount of candidate solutions are not feasible. A large number of iterations are needed to achieve a convergent solution. For portfolio optimization, Chang et al. (2000) developed an efficient scaling algorithm to handle cardinality constraint and quantity constraint at once. Then, the algorithm is embedded inside three optimization algorithms: GA, TS, and SA. Two interesting results from their research are that the solutions produced are both accurate and the algorithms do not require much time.
We propose using the scaling algorithm inside BBO. Furthermore, we implement some heuristic ideas from Chang et al. (2000). One of the methods they used is genetic algorithm (GA) heuristics. Since GA is similar to BBO in some ways, we modify the BBO algorithm following the idea from GA heuristics. In each iteration, rather than checking all habitats one by one, we only do migration from the good habitats. The best habitat is always chosen. Another habitat is chosen randomly only from small subset of best habitats. Furthermore, migration and mutation occurs iff the ith asset exists in both solutions. This greatly simplifies calculation in the BBO algorithm to focus on a subset of assets exist in good portfolio. The scaling algorithm and modified BBO is given below. This strategy is better than handling the integral constraints using penalty in the objective function, because it will require a lot of resources to find a near optimal solution. For example, Febrianti et al. (2022) used a population of 50,000 elements in solving a constrained portfolio optimization consisting of only 5 assets.
Algorithm 5 aims to modify the candidate solution to satisfy the quantity constraint. The idea is to distribute proportionally the weights of assets after ensuring the lower bound is satisfied. Then, for asset weights that are bigger than the upper bound, they are set to be the upper bound. The excesses are distributed uniformly between weights not exceeding upper bounds. Finally, the objective function is evaluated on this valid portfolio allocation. Note that Step 6 modifies the inputted habitat. This step guarantees that the same function value is produced if the processed habitat is inputted again. Algorithm 5 is crucial for the efficiency of the next algorithm.
| Algorithm 5: Scaling |
|
In step 1, we generate feasible solutions by first generating random subset consisting of K elements from . Afterwards, random weights are generated uniformly from . Afterwards, weights are normalized in order that the sum of weights equals to 1 (budget constraint). The process in Algorithm 6 basically follows the same process as Algorithm 4. The main difference is the Step 5. We choose only from small range of indices, for example can be the set of index . Thus, only the good habitats are migrated with the best habitat (habitat with the lowest function value for minimization). This idea greatly simplifies the complexity in each iteration compared than Algorithm 4, where in Algorithm 4, all habitats are considered for migration. The selection is done via roulette wheel selection. Each habitat are assigned probability proportional to their . Subsequently, a random number is generated to determine which habitat is picked for migration. The elitism in Algoritm 6 is also more efficient than Algorithm 4, since only one habitat is replaced in each iteration.
| Algorithm 6: Modified BBO for Large Scale Portfolio Optimization |
|
3. Results and Conclusions
In this section, we first apply the above ideas to measure its effectiveness. We consider using percentage deviation error as the measure of the model effectiveness as used in Chang et al. (2000) and Kabbani (2022). Let denote the pair of variance and return at a point in constrained efficient frontier (CEF) found using proposed method. Let also denote the point in unconstrained efficient frontier calculated by Chang et al. (2000). For each i, we can find and . Then, is the approximated return from UEF at . The vertical deviation error is calculated using . The horizontal deviation error is calculated in a similar fashion. The percentage deviation error is taken as the minimum of the horizontal and vertical deviation error.
3.1. Results
In this section we solve problem (5)–(9) for 50 values of . We assume (10 assets are chosen for each case), (the minimum budget allocation for each chosen asset is 0.01), and (maximum budget allocation is 1 for each asset). We use the same dataset as Chang et al. (2000) and Kabbani (2022). In total, there are 5 test instances studied. The data used are the Hang Seng (Hong Kong), DAX 100 (Germany), FTSE 100 (UK), S&P 100 (USA) and Nikkei 225 (Japan) index weekly returns from March 1992 to September 1997. In total, there are 5 test instances studied. For each instance, we generated 50 points, one point for each value of . will vary from 0 to 1 uniformly with a step length of . The parameters used are summarized in Table 1. The comparisons between the proposed method with previous studies are given in Table 2.
Table 1.
Parameters in Modified BBO.
Table 2.
Comparison of performance.
3.2. Conclusions
This paper discusses the extensions of the classical MV portfolio model to fit proper real-world situations. The extensions include adding cardinality and quantity constraints which are practical for most investors. The lack of decent approaches to solve the problem, especially the large scale ones, stimulates many alternative approaches. We propose the usage of modified BBO to solve the problem. It uses some ideas from Chang et al. (2000) that handle both constraints effectively. The algorithm makes the candidate solutions always satisfy both constraint. This causes the algorithm to yield a convergent result more quickly than letting them evolve wildly.
Table 3, Table 4, Table 5, Table 6 and Table 7 list the points generated by our proposed approach and their average percentage deviation. Figure 2, Figure 3, Figure 4, Figure 5 and Figure 6 shows the unconstrained efficient frontier (UEF) and constrained efficient frontier (CEF) obtained by proposed method. We see that CEF only deviates by a small amount from UEF. From Table 2, we see that modified BBO works pretty well in large scale portfolio optimization. Although GA works best in most instances, modified BBO can still give good near-optimal solutions. Especially, in the third and fourth instances, modified BBO produce lower mean in percentage deviation error than the other methods. The performance of our proposed apporach for the last instance is the worst compared to other methods. To overcome this, more iterations can be performed to the method at the cost of computation time.
Table 3.
First and last three optimal portfolios of Hang Seng.
Table 4.
First and last three optimal portfolios of DAX.
Table 5.
First and last three optimal portfolios of FTSE.
Table 6.
First and last three optimal portfolios of S&P.
Table 7.
First and last three optimal portfolios of Nikkei.
Figure 2.
Constrained Efficient Frontier for Hang Seng.
Figure 3.
Constrained Efficient Frontier for DAX.
Figure 4.
Constrained Efficient Frontier for FTSE.
Figure 5.
Constrained Efficient Frontier for S&P.
Figure 6.
Constrained Efficient Frontier for Nikkei.
Possible improvements can be made to the proposed method, such as using ideas of set-based metaheuristic algorithms to take care of cardinality and quantity constraints separately. Such approach has been studied by some researches, for instance see Erwin and Engelbrecht (2020). The idea is to choose a certain subset of assets first, then optimize the portfolio allocation for each subsets. Looking at various migration and mutation models are also interesting direction to do.
Another possible future research is to consider some more practical constraints such as roundlot constraint, transaction cost, preselection constraint, and tracking error constraint. The idea of putting in more constraints is so that investor can fully realizes their investment plans. Overall, the performance of the proposed method is satisfying in solving large scale constrained portfolio optimization.
Author Contributions
Supervision, K.A.S.; Writing—original draft, W.W. All authors have read and agreed to the published version of the manuscript.
Funding
This reseach is not externally funded.
Informed Consent Statement
Not applicable.
Data Availability Statement
The data used in this paper are available at http://people.brunel.ac.uk/~mastjjb/jeb/orlib/files/, accessed on 24 April 2023.
Conflicts of Interest
The authors declare no conflict of interest.
References
- Bartholomew-Biggs, Mike C., and Stephen J. Kane. 2009. A global optimization problem in portfolio selection. Computational Management Science 6: 329–45. [Google Scholar] [CrossRef]
- Chang, T.-J., Nigel Meade, John E. Beasley, and Yazid M. Sharaiha. 2000. Heuristics for cardinality constrained portfolio optimisation. Computers & Operations Research 27: 1271–302. [Google Scholar]
- Chen, Yi, Aimin Zhou, and Swagatam Das. 2021. Utilizing dependence among variables in evolutionary algorithms for mixed-integer programming: A case study on multi-objective constrained portfolio optimization. Swarm and Evolutionary Computation 66: 100928. [Google Scholar] [CrossRef]
- Erwin, Kyle, and Andries Engelbrecht. 2023. Multi-Guide Set-Based Particle Swarm Optimization for Multi-Objective Portfolio Optimization. Algorithms 16: 62. [Google Scholar] [CrossRef]
- Febrianti, Werry, Kuntjoro Adji Sidarto, and Novriana Sumarti. 2022. Solving Constrained Mean-Variance Portfolio Optimization Problems Using Spiral Optimization Algorithm. International Journal of Financial Studies 11: 1. [Google Scholar] [CrossRef]
- Garg, Harish. 2015. An efficient biogeography based optimization algorithm for solving reliability optimization problems. Swarm and Evolutionary Computation 24: 1–10. [Google Scholar] [CrossRef]
- Garg, Vanita, and Kusum Deep. 2019. Portfolio optimization using Laplacian biogeography based optimization. Opsearch 56: 1117–41. [Google Scholar] [CrossRef]
- Guo, Weian, Lei Wang, and Qidi Wu. 2014. An analysis of the migration rates for biogeography-based optimization. Information Sciences 254: 111–40. [Google Scholar] [CrossRef]
- Jobst, Norbert J., Michael D. Horniman, Cormac A. Lucas, and Gautam Mitra. 2001. Computational aspects of alternative portfolio selection models in the presence of discrete asset choice constraints. Quantitative Finance 1: 489–501. [Google Scholar] [CrossRef]
- Kabbani, Taylan. 2022. Metaheuristic Approach to Solve Portfolio Selection Problem. arXiv arXiv:2211.17193. [Google Scholar]
- Ma, Haiping, and Dan Simon. 2011. Blended biogeography-based optimization for constrained optimization. Engineering Applications of Artificial Intelligence 24: 517–25. [Google Scholar] [CrossRef]
- Ma, Haiping, Dan Simon, and Minrui Fei. 2014. On the convergence of biogeography-based optimization for binary problems. Mathematical Problems in Engineering 2014: 147457. [Google Scholar] [CrossRef]
- Markowitz, Harry. 1952. Portfolio Selection. The Journal of Finance 7: 77–91. [Google Scholar]
- Mavrotas, George, and Kostas Florios. 2013. An improved version of the augmented ε-constraint method (AUGMECON2) for finding the exact pareto set in multi-objective integer programming problems. Applied Mathematics and Computation 219: 9652–69. [Google Scholar] [CrossRef]
- Panwar, Darsha, Manoj Jha, and Namita Srivastava. 2018. Portfolio selection using Biogeography-based optimization & Forecasting. Journal of Advanced Research in Dynamical and Control Systems 10: 852–63. [Google Scholar]
- Parmikanti, Kankan, Sonny Hersona Gw, and Jumadil Saputra. 2020. Mean-Var investment portfolio optimization under capital asset pricing model (CAPM) with Nerlove transformation: An empirical study using time series approach. Industrial Engineering & Management Systems 19: 498–509. [Google Scholar]
- Perold, Andre F. 1984. Large-scale portfolio optimization. Management Science 30: 1143–60. [Google Scholar] [CrossRef]
- Qu, Bo Yang, Qiankun Zhou, J. M. Xiao, J. J. Liang, and Ponnuthurai Nagaratnam Suganthan. 2017. Large-scale portfolio optimization using multiobjective evolutionary algorithms and preselection methods. Mathematical Problems in Engineering 2017: 4197914. [Google Scholar] [CrossRef]
- Reihanian, Ali, Mohammad-Reza Feizi-Derakhshi, and Hadi S. Aghdasi. 2023. An enhanced multi-objective biogeography-based optimization for overlapping community detection in social networks with node attributes. Information Sciences 622: 903–29. [Google Scholar] [CrossRef]
- Ren, Haoyu, Chenxia Guo, Ruifeng Yang, and Shichao Wang. 2023. Fault diagnosis of electric rudder based on self-organizing differential hybrid biogeography algorithm optimized neural network. Measurement 208: 112355. [Google Scholar] [CrossRef]
- Simon, Dan. 2008. Biogeography-based optimization. IEEE Transactions on Evolutionary Computation 12: 702–13. [Google Scholar] [CrossRef]
- Wei, Lisheng, Qian Zhang, and Benben Yang. 2022. Improved Biogeography-Based Optimization Algorithm Based on Hybrid Migration and Dual-Mode Mutation Strategy. Fractal and Fractional 6: 597. [Google Scholar] [CrossRef]
- Ye, Tao, Ziqiang Yang, and Siling Feng. 2017. Biogeography-based optimization of the portfolio optimization problem with second order stochastic dominance constraints. Algorithms 10: 100. [Google Scholar] [CrossRef]
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2023 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).