Research on intelligent algorithms for solving portfolio problems

Investment is a behavior of coexistence of the benefits and risks. In the context of rich asset types, an effective investment portfolio can help investors obtain stable returns and diversify risks. In reality, portfolio problems often contain multiple constraints and objectives that cannot be effectively solved by traditional mathematical optimization methods. This paper proposes a hybrid beetle antennae search sine cosine algorithm based on non-linear inertia weight. Experiments are performed on five portfolio problem datasets in the real stock market. The results show that the proposed algorithm is effective and has some performance advantages in solving portfolio problems.


Introduction
How to make high-yield and low-risk investments in the stock market has always been a hot spot for investors. At the same time, with the continuous enrichment of stock types, investors' choices are becoming more diverse. How to configure the portfolio of investment stocks to maximize investment returns within a certain risk range is of practical significance. However, there are many limiting factors in the real market, which lead to the complicated calculation process, huge amount of calculation, and difficulty in solving problems when the model dimension is high. Therefore, it is very important to study new solution methods under the background of the rapid development of intelligence.
The traditional analysis methods of investment portfolios are mostly based on the meanvariance model proposed by Markowitz. Many scholars use quantitative analysis methods to study modern investment portfolio theory on this basis. Sehgal et al. [1] proposed an enhanced indexed portfolio optimization model, in order to seek to maximize the excess returns beyond the benchmark index. Huang Dongbin et al. [2] used the entropy-TOPSIS method to calculate the comprehensive preference strength of effective factors based on the Shanghai and Shenzhen 300 constituent stocks, and proposed a comprehensive preference strength-mean-CVaR portfolio optimization model for effective factors. Piao Fenghua et al. [3] studied the uncertainty and ambiguity in the portfolio problem, based on the fuzzy stochastic theory, and constructed a probabilistic space nonlinear programming portfolio model considering transaction costs. With the advent of the intelligent era, many scholars have used intelligent optimization algorithms to make further research on the solution of complex portfolio problems. Chen Min et al. [4] used the cluster differential evolution algorithm (DEClu algorithm) to solve the mean-VaR model that does not allow short selling. Zhai et al. [5] used the whale optimization algorithm to solve the multi-constrained portfolio optimization model, which significantly improves the rate of return of the simple diversified buy-and-hold strategy or the FTSE100 index. S. Almahdi and S.Y. Yang [6] used particle swarm optimization to extend the recurring reinforcement portfolio allocation and rebalancing management system with complex portfolio constraints.
The sine cosine algorithm [7] (SCA) is a new intelligent optimization algorithm based on mathematical features proposed in recent years. It has fast convergence speed, simple structure and easy implementation. At present, the sine cosine algorithm has been used in many fields to solve practical problems, but there are few applied researches in the field of investment portfolio. Therefore, introducing this algorithm into this field has a good research prospect. At the same time, studying the improvement strategy of the algorithm to make it have better performance on the investment portfolio problem, which has important significance in both theoretical research and practical application.
This paper proposes a hybrid beetle antennae search sine cosine algorithm (BASSCA) based on non-linear inertia weight. Non-linear inertia weights are used to coordinate the balance between global search and local search of the algorithm. The beetle antennae search is introduced to enhance the local search ability of the algorithm and improve the convergence performance of the algorithm. The experiment is based on the real market test data set in the OR-library, analyzes and compares the solution results of different algorithms, and verifies the effectiveness and superiority of the BASSCA to solve the portfolio problem with cardinality constraints.

Basic theory 2.1 Portfolio with cardinality constraint
The mean-variance model does not consider a series of constraints such as upper and lower limits and the number of portfolio assets. These constraints are called cardinal constraints [8]. In fact, the investment portfolio with cardinal constraints reflects the real-world investment situation. In this article, the Markowitz portfolio model with cardinality constraints that minimizes investment risk is used as the objective function. The formula is as follows: Among them, zi is a 0-1 decision variable, zi =1 indicates that the i-th asset is selected into the investment portfolio, and zi =0 indicates that the i-th asset is not selected. εi and δi represent the minimum and maximum investment ratio of asset i, respectively.

Non-linear inertia weight
Through the analysis of the update formula of SCA, the reliance of the individual's position update on the individual's own position remains the same throughout the algorithm's entire optimization iteration process, resulting in the algorithm's weak global search ability in the early stage of optimization. Moreover, the population is mainly guided by the current optimal solution during the entire iteration process, resulting in a sharp decline in the population diversity in the later iterations and easy to fall into a local optimal. In view of this, the non-linear inertia weight ω is introduced to adjust the dependence of search individuals on the current position information in the population iteration process, and balance the global search and local search capabilities of the algorithm. The formula is as follows: Among them, r is a random number on (0,1), 0.1r can increase the derivative change range in the later stage, thus speeding up the algorithm convergence.
The individual position update formula after introducing the non-linear inertia weight factor is:

Beetle antennae search(BAS)
SCA focuses on the influence of groups on search individuals, but the individual's own experience and cognitive information in the search process has not been fully utilized, while BAS uses beetle individuals to search. Therefore, this article combines BAS and SCA to enhance the local search capability of SCA. The search formula for beetle antennae search is as follows:

Algorithm description
The steps of the hybrid beetle antennae search sine cosine algorithm based on non-linear inertia weight are as follows: Step 1: Set the basic parameters of BASSCA such as the number of populations N, the maximum number of iterations Tmax, and the problem dimension D, etc; Step 2: Initialize the positions of individuals randomly to generate the currently searched global optimal position gbest and the historical optimal position pbest searched by each individual; Step 3: Update the position information of the population search individual according to formula (8); Step 4: Add BAS operation to the historical optimal solution pbest of each search individual according to formula (9), evaluate the fitness value, and compare it with the current pbest and gbest, and then update pbest and gbest; Step 5: Judge whether the algorithm meets the end condition, if it is satisfied, output the optimal value, otherwise go to step 3.

Experiment and analysis
In order to test the effect of the BASSCA on the cardinal constraint portfolio problem. Five portfolio problem data sets from the real market in the OR-library database are selected for testing. The 5 capital market indexes are Hong Kong Hang Seng Index (Hang Seng), German Composite Index (DAX100), UK FTSE Index (FTSE100), US Standard & Poor's Index (S&P100) and Japan's Nikkei Index (Nikkei).The number of assets in each stock index is 31, 85, 89, 98 and 225, respectively. Table 1 shows the effect of different algorithms in solving the portfolio problem under 5 market indexes. It can be seen from Table 1: No matter what kind of market index, BASSCA obtains the best solution effect. Compared with PSO, SCA and BAS, BASSCA is better than these algorithms in the four evaluation indexes of best value, worst value, average value and standard deviation. It can be seen that BASSCA has better solution quality, search accuracy and stability when solving the portfolio problem with cardinality constraints. Compared with the standard SCA, the solution effect of BASSCA is far better than that of SCA. The results show that the solution performance of SCA can be effectively enhanced by introducing nonlinear inertia weights and beetle antennae search.