Design of Optimum Portfolio Scheme Based on Improved NSGA-II Algorithm

In the financial industry, it is of great significance to study the multiobjective portfolio optimization for obtaining a reasonable investment strategy. This paper designs the financial portfolio scheme based on the multiobjective optimization algorithm that is based on the framework of the NSGA-II algorithm. In order to introduce convergence information, aiming at the actual problem of the portfolio, the mixed individual coding mechanism with asset information expands the application of the multiobjective evolutionary algorithm in portfolio optimization. The portfolio scheme obtained is effective, which is helpful to improve the decision-making efficiency of financial investors and enriches the application of modern financial theory.


Introduction
With the rapid development of the financial market, investment and financial management are no longer limited to a single way of saving with more investments in securities. How to use more scientific and rational investment strategies to realize capital appreciation has become a problem that investors must consider and pay attention to. Generally speaking, the purpose of investment and financial management is to maximize the income, but benefits and risks often exist at the same time. A portfolio can spread risks, and the key lies in how to allocate assets and how to deal with the relationship between risks and benefits.
At present, the financial industry, as one of the important components of China's economy, has been widely concerned by people in various fields. In reality, the investment fields and fund types are complicated, so the essence of designing a relatively optimal portfolio is a highdimensional multiobjective optimization problem [1][2][3][4]. Meanwhile, the heuristic algorithm can get a satisfactory solution in polynomial time, such as evolutionary algorithm, simulated annealing algorithm, artificial neural network, and quantum algorithm [5][6][7]. Because of the inherent multiobjective nature of portfolio problem, many scholars usually use a multiobjective evolutionary algorithm to solve it, such as weighting method, constraint method, objective programming method, and minimax method. A multiobjective optimization algorithm does not need to obtain the derivative information of the problem nor does it need to aggregate optimization objectives with different properties. It can deal with enormous scope search space autonomously, where the problem can be solved by parallel search of cyclic iteration, and the average fitness of the species is improved generation by generation to approach the global optimal solution [8,9]. erefore, the customized improvement of the problem model can not only expand its related research but also help to advance the decision-making efficiency of investors.

Theoretical Basis of Portfolio
With the rapid development of science and technology and the continuous improvement of the financial system, China's financial market is actively integrated with foreign countries where financial products are becoming more diversified, and bonds, stocks, futures, foreign exchange, and various Internet financial derivatives are gradually moving towards the investment scope of ordinary people [10]. Investment is the act of converting funds into assets or capital in a certain period of time, so as to obtain economic returns or valueadded benefits. No matter what kind of investment is made, the purpose is to obtain higher returns. However, benefits and risks often coexist. Investors want to get as many benefits as possible and at the same time bear as little risk as possible. erefore, how to maintain and increase the value of assets through investment and financial management is a great challenge.

Single Investment.
e quantitative relationship is applied to the research of portfolio theory, the benefits and risks are quantified, and the two goals of maximizing benefits and minimizing risks are put forward to solve the problems of selection of financial products and allocation of capital proportion for investors [11,12].
In actual investment activities, the average historical real rate of return is usually used to replace the expected rate of return to measure the pros and cons of the portfolio. Assuming that there are M securities in the securities pool, the actual rate of return of securities is calculated as shown in the following formula: where r i is the actual rate of return of a security, S i (t) is the closing price of the securities at the end of the holding period, and S i (0) is the closing price of the securities at the initial stage of the cycle. e company's operation and performance usually have certain stability; therefore, the average historical actual rate of return can be used as the estimate of the expected rate of return of the securities. Assuming that vector R i � (r 1 i , r 2 i , . . . , r T i ) T represents the vector composed of multiperiod historical return rate of the ith asset, so the expected return rate is shown in the following formula: where R i is the expected return on a security, T is the number of periods with the historical real return, r t i is the real return on the security in term t, and p t i is the probability that the real return is r t i . In investment activities, it is uncertain to use the historical rate of return to estimate the expected rate of return because the real return may be higher than expected or lower than expected, which is the risk faced by many investors. erefore, the risk needs to be quantified by the variance of the expected rate of return. For a single security, the risk can be calculated by the following formula: e above formula uses the volatility of security returns; that is, the variance σ 2 of the expected return rate of a security is adopted to quantify the risk. e larger the variance is, the greater the deviation between the actual return rate and the expected return rate is, which indicates that the returns of security are highly uncertain, and the investment risk is strong.

Portfolio
Investment. Assuming a portfolio chooses N sorts of resources from the protections pool and joins them as indicated by a specific venture proportion, then in a certain investment cycle, the pay of the portfolio is measured by the weighted normal amount of the return paces of every resource, which can be calculated by the following formula: where r p represents the expected return rate of the portfolio and x i represents the proportion of the ith asset in the portfolio, which meets the budget constraint N i�1 x i � 1, In the actual market, all kinds of securities are not completely independent, and there are always some connections.
is correlation between securities is usually expressed by covariance, which is the expectation to measure the overall error between two variables [13]. In the actual portfolio, investors usually want to choose some unrelated assets as far as possible to spread the risk as much as possible, so set R � (R 1 , R 2 , . . . , R N ) T as the actual rate of return of each security in the portfolio, and the covariance between i and j securities is calculated by the following formula: Using variance σ 2 p as a measure of portfolio risk, we should consider not only the characteristics of individual securities but also the relationship between them. e portfolio risk is expressed by the following formula:

Multiobjective Optimization Algorithm
3.1. Algorithm Design. NSGA-II algorithm is a far-reaching multiobjective optimization algorithm at present. Since it was put forward, because of its simplicity and high efficiency, this algorithm has become one of the basic algorithms in problems of multiobjective optimization [14]. As shown in Figure 1, the main advantages of this algorithm compared with traditional NSGA are as follows.
(1) e fast nondominated sorting algorithm reduces the computational complexity from the original mN 3 to mN 2 , where n is the species size and m is the quantity of goal capacities.

Computational Intelligence and Neuroscience
(2) e addition of the crowding degree and crowding degree comparison operator not only solves the shortcoming of artificial designation of shared parameters in the algorithm but also enables the species to be homogeneously extended to the whole Pareto domain through crowding degree, thus ensuring the diversity of the species. (3) Introduction of elite strategy and expansion of sampling space combine the parent and the offspring together to produce the next generation of the species by competition is beneficial to preserve the excellent individuals of the previous generation of the species. At the same time, the stratified storage of individuals in the species reduces the loss of the best individuals, improves the overall level of the species, and greatly optimizes the accuracy of the algorithm.
e NSGA-II algorithm adopted in this paper can improve the diversity of the species and make the level of the species improve rapidly. e flow chart of the algorithm is shown in Figure 2.
(1) Initialize the species and set its size as n, after the nondominated sorting of the species with the size of n, execute the traditional genetic algorithm, and obtain the first-generation progeny species through crossover, mutation, and selection (2) Combine the parent and offspring species into a species, calculate the crowding degree of individuals in the nondominant layer simultaneously through rapid nondominant sorting, and select suitable individuals to form a new parent species by using crowding degree and nondominant relationship (3) Generate a new progeny species through the basic operations of crossover, mutation, and selection in a traditional genetic algorithm, and repeat the above steps until the maximum number of iterations is met 3.2. Optimized Algorithm. t-SNE algorithm is introduced to reduce the problem of target redundancy in high-dimensional multitargets, which greatly decreases the running time and the load of devices and improves the accuracy of the algorithm. e flow chart is shown in Figure 3.
Firstly, the original target set I 0 was selected to initialize the species, and then, the NSGA-II algorithm was performed to optimize the species to form a new parent species P 0 . en, t-SNE algorithm is optimized for P 0 to obtain the nonredundant target set I 1 . Finally, the above steps are repeated until the maximum number of iterations is satisfied, and the species P 2 , P 3 , . . . P t− 2 P t− 1 , and target set I 3 , . . . , I t , when I t− 1 � I t , the Pareto optimal solution P t− 1 of the target set can be obtained.

Implementation Process of Algorithm.
Assuming that the number of targets is N, the target set is I t , and gen is the number of iterations.
(1) Set t � 0, the initial target set is I 0 � 1, 2, . . . , N { }, and then, the species of the target set is initialized. P, where selection, suitable individuals are selected to form a new parent species P 0 by fast nondominated sorting and calculating crowding degree. e binary crossover can be simulated as follows: Among them, , else.
(2) Calculate the pairs of Euclidean distances between samples of P 0 species, and calculate the joint probability p ij between pairs of data points in highdimensional space.
where δ i represents the variance of the Gaussian function centered on the data point, x i represents the initial population characteristic matrix, and p ji represents the conditional probability of similarity between the data point x i and data point x j of the species characteristic matrix.
(3) Calculate joint probability q ij between low dimensional spatial data point pairs in P 0 Eigenmatrix.
where y i , y j , y l , and y k represent the data point of the species characteristic matrix.

Computational Intelligence and Neuroscience
(4) Calculate the KL divergence between p ij and q ij , and work out the objective function C: (5) Solve the gradient of P and Q: (6) Get the target set I 1 , and repeat (1) ∼ (5) until the set maximum iteration algebra is met, and the species is obtained. P 2 , P 3 , . . . , P t− 2 , P t− 1 and target set I 3 , . . . , I t , when I t− 1 � I t , and find the Pareto optimal solution of the target set P t− 1 . Calculate the target set I 1 , and repeat step (1) ∼ (5) until the maximum iteration algebra is satisfied, and the species P 2 , P 3 , . . . , P t− 2 , P t− 1 and target set I 3 , . . . , I t , when I t− 1 � I t , the Pareto optimal solution P t− 1 of the target set can be obtained.

Problem Description.
e financial market has many nonrandom factors, such as fuzziness and uncertainty. erefore, this paper tries to express the fuzzy uncertainty of the financial market with fuzzy theory. Investors usually refer to financial intermediaries. e main reason why diversified investment reduces the risk is that the correlation of different types of companies is poor or even negative. After the formation of the portfolio, the correlation of the portfolio is dissolved, so that the variance of the portfolio decreases; that is, the risk decreases. In investment theory, diversified investment is common that it can effectively reduce risks [17,18]. Based on the fuzzy theory, a profit-risk optimization model is established with constraints, where the profit and risk are regarded as two optimization objectives in the model.
Assuming that R represents all real numbers, A is the convex fuzzy number defined on R with continuous membership function μ A (x), and F is the whole fuzzy set defined on the real number field R.

Definition 1. Assume A ∈ F, [A] c � [a(c), a(c)](c ∈
[0, 1]), and A represents the c-horizontal cut set, then the probability mean of fuzzy number A is defined as Lower half probability variance of A is Upper half probability variance of A is If A � (a, b, α, β) is A trapezoidal fuzzy number, its membership function μ A (x) is shown in Figure 4.
So, the c-horizontal cut set of trapezoidal fuzzy number In this paper, we consider the following constraints [19]: (1) Constraint on the number of portfolio assets: in the process of real investment decision-making, there are certain requirements for the number of assets held. Assume that the maximum number of assets held is M, then the constraint is n i�1 sign(x i ) � M. (2) Investment ratio constraint: the sum of investment ratios for each asset should be 1. Namely, n i�1 x i � 1.

Model Building.
As skewness is introduced as a new goal, cardinality constraints and upper and lower bound constraints are added, historical data are replaced by Computational Intelligence and Neuroscience predicted returns, and the specific portfolio model is shown in function (18).
Among them, n is the number of available assets X is the weight vector formed by the proportion of investment into various assets when each goal achieves the optimal tradeoff x i is the proportion invested in the ith asset; 12, R i 12 is the expected return on the ith asset σ ij is the return covariance between asset i and asset j s 3 i , s ii , and s ijj are skewness and oblique skewness R(x) is the expected return on the portfolio x V(x) is the return variance of the portfolio x S(x) is the skew of the portfolio x θ i specifies whether an asset θ i exists in the portfolio K min and K max are the minimum and maximum number of assets allowed in a portfolio l i and u i are the lowest and highest proportion of the investment in asset i to the total investment, respectively e advancement objective of the model is to limit the gamble of the portfolio and expand the normal return of the portfolio and the skewness of the portfolio. erefore, constraints conclude budget constraints, upper and lower limit constraints, and cardinality constraints. Cardinality constraint ensures that the number of assets in the portfolio is within a certain range where substantial diversified income can be achieved by owning 6 to 15 stocks [20].

Test Index.
Generation distance (GD) and spatial distribution (SS) are selected to test the convergence and accuracy of the algorithm in this paper.  Computational Intelligence and Neuroscience GD refers to the average minimum distance from each point in the solution set P to the reference set P ′ , indicating the degree of deviation from the truly optimal boundary. e larger the GD value, the farther away from the true optimal boundary, and the worse the convergence. e specific calculation formula is as follows: where n is the number of points on the Pareto frontier and d i is the minimum Euclidean distance between an individual and the real Pareto frontier. SD indicates the extent of the obtained solution set. e smaller the value of SD, the more homogeneous the solution set. e specific calculation formula is as follows:

Test Environment.
e hardware environment used in this experiment is Intel Xeon (R) CPU ES-2620V4 @ 2.10 GHz, NVIDIA Quadro M4000 GPU, and the running memory is 32G. In addition, the experiment is realized by Matlab simulation. In order to test the performance of the algorithm under different numbers of the target, they are set as 3, 5, and 10, respectively, in the test function. DTLZ (I, M) represents the spatial distribution of targets in the I dimension, where I is the target dimension and M is the number of target objects. e specific parameters are shown in Table 1.

Test Results.
Function (18) was tested with the NSGA-II algorithm and its improved algorithm, respectively, running independently for 10 times, and the test indexes were GD and SD. e experimental results are shown in Table 2. Table 2 shows that the indicators of GD and SD obtained by the improved algorithm are 2.6509E − 05,0.33982, respectively; the GD and SD of the NSGA-II algorithm are 5.7065E − 02 and 0.35211, respectively, which shows that the optimization algorithm has the smallest deviation from the real optimal boundary, the best convergence, and the smallest breadth of the solution set. erefore, the optimized multiobjective algorithm has better convergence, and the distribution of the solution set is more homogeneous.

Evaluation of Portfolio Design
5.1. Scheme Analysis. By taking the fund as an example, if the original capital Y yuan is used for financial investment, then the investment in A, B, C, D, and E funds can be expressed as where Y is the original fund, a, b, c, d, e and W A , W B , W C , W D , W E are the weight and income of funds invested in A, B, C, D, E, respectively, and W is the total income.

Evaluation Indicators.
e raw data of this experiment come from the daily trading data of Chinese funds from December 2014 to December 2021, which contains transaction data of various fund prices, each of which consists of time, opening price, maximum price, minimum price, closing price, increase rate, and turnover rate. e daily price data of 10 kinds of funds are selected as experimental data, and only 733 fund price data are selected.
In this paper, the mainstream measurable performance indicators of investment in the current market are adopted, namely, the annual rate of profit, sharp ratio, and forecast rate of profit [21,22].
(1) Annualized rate of profit e annualized rate of profit is a measure of the profitability of investors during the investment period of one year Annualized rate of return � Income/capital Investment days/365 × 100%.
(2) Sharp ratio Sharp ratio is a standardized index to evaluate the fund performance where E(R P ) represents the expected return rate of risk asset portfolio; R f is the risk-free rate of return, which can be replaced by the interest rate of 10-year Treasury bonds, that is, 2.85%; E(R P ) − R f is the risk premium. When the Sharp ratio <0, the return on investment is not as good as the return on Treasury bonds.  (3) Predicted rate of profit e estimated pace of profit from the venture, otherwise called the speculation benefit rate, alludes to the proportion of the absolute yearly net gain of the speculation plan to the all speculation of the plan in a year subsequent to arriving at the planned limit of creation Predicted rate of profit � Annual pre − tax profit Total investment of project × 100%. (24)

Analysis of Results.
e multiobjective portfolio model algorithm mentioned above is iterated for 50 times to get the weight of each industry coefficient in the scheme of the portfolio. e results are shown in Table 3.
According to a certain capital, the annual return, investment profit, and Sharp ratio within 2 years are calculated, respectively, according to the portfolio scheme obtained by NSGA-II and its optimization algorithm, as shown in Table 4.
From the data in the table, it can be seen that the annualized profits of the portfolio scheme within two years obtained by NSGA-II and its optimization algorithm are 37.60% and 41.25%, respectively. e predicted profits on investment are 63.24% and 70.08%, respectively; the Sharp ratio of the two portfolio schemes is greater than 0, which indicates that the income of investment exceeds that of the Treasury bonds. erefore, the portfolio scheme obtained by the multiobjective optimization algorithm is the best.

Conclusion
Based on the portfolio theory, this paper introduces the t-SNE optimized NSGA-II algorithm to establish a multiobjective portfolio model for the multiobjective optimization of portfolio investment in the financial industry, where the expected return, risk, skewness, and other indexes of securities are quantified, and the solving algorithm of the model is evaluated by the generation distance and spatial distribution. e evaluation results show that the annualized profits of the portfolio scheme obtained by the optimized algorithm are 41.25%, the predicted profits on investment are 70.08% within two years, and its evaluation of performance is higher than that of the NSGA-II algorithm.
Data Availability e dataset can be accessed upon request.

Conflicts of Interest
e authors declare that they have no conflicts of interest.