# Two-Stage Robust Optimization Model for Uncertainty Investment Portfolio Problems

Authors: Dongqing Luan; Chuming Wang; Zhong Wu; Zhijie Xia
Journal: Journal of Mathematics
 (2021)

---

## Abstract

Investment portfolio can provide investors with a more robust financial management plan, but the uncertainty of its parameters is a key factor affecting performance. This paper conducts research on investment portfolios and constructs a two-stage mixed integer programming (TS-MIP) model, which comprehensively considers the five dimensions of profit, diversity, skewness, information entropy, and conditional value at risk. But the deterministic TS-MIP model cannot cope with the uncertainty. Therefore, this paper constructs a two-stage robust optimization (TS-RO) model by introducing robust optimization theory. In case experiments, data crawler technology is used to obtain actual data from real websites, and a variety of methods are used to verify the effectiveness of the proposed model in dealing with uncertainty. The comparison of models found that, compared with the traditional equal weight model, the investment benefits of the TS-MIP model and the TS-RO model proposed have been improved. Among them, the Sharpe ratio, Sortino ratio, and Treynor ratio have the largest increase of 19.30%, 8.25%, and 7.34%, respectively.


---

## Body

## 1. Introduction

Investment portfolio means that investors invest their own assets in stocks, funds, bonds, and other securities at the same time, in order to achieve higher or more stable profits under lower risk conditions. In the early research, many scholars constructed the mean-variance model and the portfolio effective boundary model, which opened a new era of investment portfolio. Among them, since Markowitz founded the portfolio theory, the development of portfolio theory has been extremely rapid [1,2]. Risks persist due to poor risk management and uncertainty in the market environment. Portfolio theory is one of the important financial theories that discuss the profits and risks in the investment process. In the management of risk, many scholars believe that the research of investment portfolio can effectively measure uncertainty and avoid risk. The investment portfolio mainly embodies the idea of investment diversification. By screening different types of risk asset projects, the purpose of reducing investment risks is achieved. The investment portfolio optimization method provides a powerful tool for risk management [3,4]. Using the model method of investment portfolio optimization to find a reasonable allocation of funds can help investors balance safety and profitability and ensure that they achieve maximum profits within the acceptable risk range. Whether it is the securities and finance industry or other academic fields such as research institutes and universities, how to effectively formulate appropriate investment strategies has always been the focus of research [5,6]. It is found that the game between investment and risk is always accompanied by investors. Continuously improving investment risk management capabilities is a top priority for regulatory authorities, financial institutions, and even individual investors.Some investors tend to avoid risks by looking for the law of risk distribution, so that they can modify their strategies in a timely manner in the face of unexpected situations. In the application process of investment portfolio optimization, there are few or even missing historical data. How to accurately measure risk in the absence of historical data and how to reasonably estimate possible losses taking into account a variety of factors is also a huge challenge. In addition, the study found that financial risk measurement is based on a basic distribution assumption. The selection of appropriate distribution assumptions has a significant impact on the accurate measurement of risk, which in turn affects the efficiency of the overall investment plan. How to choose an appropriate distribution hypothesis is also a pain point in portfolio research. In the research on the uncertainty of portfolio risk distribution, researchers focus on how to incorporate the uncertainty of loss into the investment decision-making process and then improve the problem of portfolio optimization. In addition to the existing research on the specific distribution probability of hypothetical risks, many scholars have tried to conduct research from the risk itself. It is found that the loss is affected by many factors. In an economic environment that is rising frequently, the distribution of losses may be similar to a normal distribution. In a flat economic environment, the risk loss distribution may be similar to a certain distribution [7–9]. In a recessionary economic environment, the risk loss distribution may be similar to a certain Pareto distribution [9,10]. Under different distribution models, the choice of portfolio strategy often leads to significant differences in expected results. How to effectively screen the probability distribution of risks and how to effectively determine the investment portfolio plan are a hot topic in the research.In addition to the research on the probability of risk distribution, many scholars have conducted multidimensional research on the inherent uncertainty by citing models in cross-domains. Garlappi et al. (2007) constructed a portfolio model by estimating the confidence interval of the expected profit. The study found that the fuzzy aversion portfolio only performed stably for a period of time [11]. Tu and Zhou (2010) proposed a method that allows Bayesian Priors to reflect the objectives of economic problems. In terms of measurement of out-of-sample loss function, the model of portfolio strategy based on the objective priori can be significantly superior to the model developed in the classical framework [12]. Bayraktar and Zhou (2017) studied the fundamental theorem of asset pricing and option hedging prices under discrete-time nondominated model uncertainty and portfolio constraints. Research has discovered the duality of superhedging prices in a market where stocks are dynamically traded and options are statically traded [13]. The research of Golosnoy and Okhrin (2008) found that there is general uncertainty in the asset allocation model, and the optimal belief degree can be determined by developing a case-based decision-making method [14]. Some scholars use the linear loss aversion function to construct the model and obtain the optimal solution. This function assumes that the marginal utility of investors’ gains and losses is constant. Investor’s loss aversion degree and reference profit will vary with market conditions and relative wealth. The assumption that the loss aversion coefficient and the reference point remain unchanged does not conform to the true psychology of investors [15,16]. Huang and Qiao (2012) discussed a multiperiod securities investment portfolio selection problem and proposed an uncertain risk index adjustment model. The goal of optimal investment portfolio adjustment is to maximize the total incremental wealth under the constraints of accumulating risk index values during the control investment period and satisfying the constraints of self-raised funds in each period [17]. When analyzing the optimal investment decision of loss aversion investors, the dynamic change characteristics of loss aversion coefficient and reference point should be considered. At present, when building loss aversion models, scholars assume that the expected profit of assets is determined, and the average profit and profit distribution of risky assets in the market are both uncertain. Using the uncertainty of asset profit distribution for reference, the assumption of unknown profit distribution is introduced into robust optimization to describe the fuzzy aversion characteristics of investors, which is more in line with the real psychology of investors. Uncertainties are particularly prominent, and the economy has been affected. In this case, reasonable investment decisions are particularly important. For multiperiod investments, the experience and wisdom of investors are extremely important, where investing, profits, risks, and liquidity are often involved. These three are interrelated and restrict each other. This relationship is in the relationship between profit and risk. The performance is more prominent in time. High risk means high returns, and risk and profit are often proportional, but investors hope to obtain higher profits with less risk, which poses a big problem for investors and researchers. Therefore, it is still necessary to continue to study multistage investment under uncertain conditions.In recent years, with the steady optimization theory and methods being gradually accepted and recognized by scholars, the uncertainty of using robust optimization to study the portfolio has become particularly novel. The robust optimization theory simply expresses the uncertain parameters in a specific interval and can flexibly control the degree of uncertainty. The robust optimization theory proposed by Bertsimas and Sim (2004) and Ben Tal et al. (2007) to deal with the uncertainty in the model is now a commonly used research method [18,19]. Huang et al. (2010) studied how to use robust optimization to analyze uncertain parameter problems and proved the effectiveness of the robust optimization model [20]. Dai and Wen (2014) proposed a robust optimization theory for minimizing the CVaR of the investment portfolio under the general affine data perturbation uncertainty set. Their research uses numerical experiments with real market data to illustrate the practicality of robust optimization models [21]. In venture capital, investors pay more attention to the right-leaning loss distribution risk, and then it is of practical significance to introduce information entropy into risk measurement research in the financial field. Through the review of the above literature, diversification of investment demand and uncertainty of risk preference are also hot issues in investment portfolio research in recent years. Many scholars have conducted in-depth investigations on the uncertainty of risk appetite. Information entropy can be used to measure the degree of deviation from uniform distribution. The deviation corresponds to a point that reflects the uncertainty of the probability distribution over the entire range of values. At the same time, information entropy can express more information about the distribution, more accurately reflect the risk of loss distribution, and then serve as an ideal means of measuring risk. It can be found from the above-mentioned literature that robust optimization, CAaR, and information entropy, as tools to measure stock investment risk, can be well applied in the symmetric and asymmetric distribution of probability. However, although most of the existing algorithms have played a certain role in improving the accuracy of the model solution, the convergence speed is often slow due to the complexity of the solution algorithm.In the research of portfolio optimization, the mean-risk model usually assumes that the expected profit on risky assets is subject to a known probability distribution and that the number of transactions is infinitely divided, which is not consistent with the actual situation. In this paper, a two-stage robust portfolio optimization model is constructed, and the optimal solution in the worst case is found in the uncertain set. Based on the analysis and comparison of the above related literature, the research in this paper mainly includes the following innovations:(i)
This paper summarizes the research results of related scholars, analyzes the classical portfolio problems in depth, and proposes a deterministic TS-MIP model considers the risk and diversity of investment problems.(ii)
On the basis of deterministic model, the research content is further extended to uncertainty, and the mechanism of influence of uncertainty parameters on portfolio efficiency is analyzed in depth.(iii)
In the research of dealing with uncertainty interference, this paper introduces the theoretical method of robust optimization, constructs a TS-RO model, and applies it to the research field of investment portfolio.(iv)
In the numerical case analysis part, this paper uses data crawling technology to obtain the latest real data from real-time websites as the input part of the model and uses real data for a large number of case studies and parameter comparisons, to obtain practical investment advice.The rest of this framework is as follows: Section2 lists related basic theories and methods. In the third section, based on the basic deterministic TS-MIP model, we analyze the problem under uncertain parameters and further construct the TS-RO model. Section 4 obtains relevant data through data crawling technology and constructs numerical cases for analysis. Section 5 compares the key parameters of the model and puts forward some management investment recommendations.


## 2. Basic Theory and Model

### 2.1. Information Entropy

Information entropy can be defined as the possibility of discrete random events [22–24], and the specific expression is shown in (1)S=−∑i=1npilnpi.Among them, the function ofpi is to measure the probability of occurrence of the situation i. In the current stage of theoretical research, information entropy has been widely used to measure the uncertainty of information, and there is a positive correlation between entropy and uncertainty. In addition, the information entropy function also has the following three special properties:(i)
Continuity:S is a continuous function of pi, pi∈0,1(ii)
Nonnegativity:Sp1,p1,p1,…,pn≥0(iii)
Extreme value: if and only if the condition isp1=p2=⋯=pn, the information entropy achieves the maximum value


### 2.2. Value-Added Entropy and Actual Entropy

Value-added entropy is a kind of generalized entropy [25,26], which can be defined as (2)H=∑i=1Wpxilog∑i=1Nxiri.Suppose there areN types of stocks or securities in the market, and the k type contains ni possible prices i=1,2,3,…,N. The number of all possible value combinations is W=n1×n2×n3×⋯×nN. X=x1,x2,x3,…,xk;i=1,2,…,W refers to the investment ratio of the k securities, and R=r1,r2,r3,…,rk is the output ratio in the i price combination. In addition, Ri=1+ri and ri represent the rate of profit, assuming that short selling is not allowed, that is, rk≥0,k=1,2,…,N. The above formula (2) can be further transformed into (3)H=log∏i=1WRipxi,Ri=∑k=1NqkRik.Actual entropy: in the actual financial market, investment transactions require costs, and an investment portfolio that ignores transaction costs will often have a great impact on actual profits and may make investments invalid. Introduce typical transaction costs into the portfolio and define linear transaction costs. However, linear transaction costs rarely appear in investment costs, so the improved transaction cost functionCX=cx1,cx2,cx3,…,cxn can be expressed as(4)cxi=rxi,0≤xi≤a,rkxi2+hxi+q,a≤xi≤b,0≤k≤1,rxi3,b≤xi≤1.This paper draws on the improved typical transaction cost function and establishes a dual-objective portfolio model with the largest profit expectation and the smallest risk expectation. SetX=x1,x2,x3,…,xn as the investment ratio in n stocks, R=r1,r2,r3,…,rn as the expected rate of profit, and MX as the actual rate of profit of stocks and securities, and the portfolio model based on the CVaR measurement is expressed as(5)Π=∑i=1nrixi−∑i=1ncixi.Among them,fX,Y¯j=−X′Y¯j,xi≥0 means that short selling is not allowed, if and only if ωX>ωY and F˜βX,δ,μ<F˜βY,δ,μ. Actual entropy can reflect the speed of appreciation and the cumulative profit of funds. Compared with the mean function that cannot directly reflect the cumulative profit of the fund, the combination of actual entropy and actual entropy can be more effective and more appropriate to reflect the investment profit.


### 2.3. CVaR

VaR can usually be defined as value at risk [27,28], that is, the maximum loss of an investment portfolio in a normal market in a specific period under a specific confidence level of α. Set fX,Y:Rm×Rn⟶Rmn as the loss function of the investment portfolio, and the specific meaning is the expected loss of the investment portfolio. Among them, X is the investment decision vector, which specifically means the proportion of risky securities in the investment portfolio. Y is a 0–1 variable of value at risk, which represents the profit rate of securities stocks. Then, there is fX,Y=−X′Y. When X is fixed, fX,Y is a function of Y. Assuming that Y is a continuous random variable, the probability density function of Y is φY, then ∀δ∈R, and the distribution function is ψX,δ=∫fX,YφYdY, which represents the probability that the loss fX,Y does not exceed δ, δ is the upper limit of risk, and ψX,δ is the nonincreasing right continuous function of δ. Assuming that β0≤β≤1 is used to represent the confidence level, X of VaR is expressed as(6)VaRβX=minδ∈R:ψX,δ≥β.However, becauseVaR is only a quintile within a certain confidence level, the left-tail risk beyond this quintile cannot be measured by VaR, which leads to failure in assessing the overall risk of the portfolio and makes investors may ignore huge losses in some small probability events. At the same time, VaR cannot measure the risks in some extreme situations, such as financial crises. Based on this, VaR under certain CVaR was proposed. CVaR can be defined as the conditional average value of losses exceeding under a certain confidence level, which is used to measure the average excess level of losses [29,30]. According to the research of related scholars, CVaR is more sensitive to the shape of the loss distribution at the tail of the distribution [31,32]. According to the definition of CVaR, we can get(7)CVaRX=EfX,Y|fX,Y≥VaRβX=1−β−1∫fX,Y≥VaRβXfX,YφYdY.It is found thatVaR must be used in the process of solving equation (7), and the mathematical expression is extremely complicated, and it is difficult to calculate the result. In order to solve this problem, Rockafellar and other scholars constructed an auxiliary function FβX,δ and effectively connected CVaR and VaR [33,34]. The auxiliary function is(8)FβX,δ=δ+1−β−1∫Y∈RnmaxfX,Y−δ,0φYdY,where VaRβX=minFβX,δ. Due to the diversity and complexity of the market environment, the loss caused is also uncertain, and the probability density function φY is not easy to calculate. Therefore, the method of using historical data to simulate calculations is selected, and historical data is used to predict the specific future random vector. Assuming that the random variable Y in the past trading day represents m scenarios, the value of each scenario is Y¯j,j=1,2,…,m, and the probability of any one scenario is 1/m. So, it exists that(9)F˜βX,δ=δ+m−11−β−1∑j=1mmaxfX,Y¯−δ,0.Because of the existence of functionmax in equation (9), and because function F˜βX,δ is usually not continuous and differentiable, general algorithms cannot be solved. Here, the aggregation function proposed by related scholars is used to smooth the max function [35,36]. For any μ>0, the above function can be expressed as(10)F˜βX,δ,μ=δ+m−11−β−1∑j=1mμlnexpfX,Y¯−δμ+1.


### 2.4. Two-Stage Mixed Integer Programming (TS-MIP) Model

A diversified investment portfolio has lower volatility risk than personal assets, and increasing the diversification of the investment portfolio can help investors reduce the variance of the investment portfolio. Not only can the risk in the investment portfolio be effectively and accurately measured, but also the investment portfolio can evaluate diversity. According to investment portfolio theory, diversityG can be used to reduce nonsystematic risks. Specifically, the greater the value, the more diversified the investment portfolio. Based on the above theory, in the model proposed in this paper, CVaR is used to adjust the direct function to determine the new objective function to measure the risk of the investment portfolio. The value-added entropy combined with the real entropy function M is used to measure the statistical profit of investment. Skewness function is used to measure investment increment. Based on the above analysis and combined investment portfolio strategy research, this paper proposes the following TS-MIP model, the structure of which is shown in Figure 1. The problem of outer layer maximization benefit planning mainly analyzes the maximization of income and the maximization of investment diversity and the maximization of skewness. Corresponding to it is the problem of internal minimization of risk, which mainly includes the minimization of information entropy and the minimization of investment risk. The investment risk here is measured by the CVaR.Figure 1
The theoretical framework of the TS-MIP model.The stage of maximizing the benefit of the outer layer is the overall stage, and the specific form is as follows:(11)maxZ=αR′X+βS′X+γEδminF˜βX,Ys.t.∑i=1Mαrixi−∑i=1Mcixi≥Πmin,∀ri∈R,i=1,2,3,…,M,∑i=1Mxi=1,∀xi∈X,∑i=1Mβxilnxi≤Gmax,i=1,2,3,…,M,∑i=1Msixi≤Umax,∀si∈S,i=1,2,3,…,M,α,β∈0,1,xi∈0,1,i=1,2,3,…,M.The objective function is combinatorial optimization problem, which maximizes the profit under the condition of the lowest risk. The first line of constraint indicates the lower bound of profit. The second line of constraint indicates the maximum investment ratio, short selling is not allowed, and there is no additional capital inflow. The third line of constraints indicates the upper limit of investment diversity. The fourth line of constraints indicates the upper limit of the investment increment. The fifth and sixth lines of constraints are related variable constraints; the purpose is to ensure the feasibility. The inner minimization problem is second stage, and the form is as follows:(12)EδminF˜λX,Y,K,γ,δ,μ,s.t.−∑i=1M∑j=1NxipjlnrCVaRi∑i=1MrCVaRi≥Kmin,δ+1m1−λ∑i=1M∑j=1NμlnexpγfX,Y−δμ+1≤rCVaRmax,fX,Y=∑i=1M∑j=1Nxiyj,∀xi∈X,∀yi∈Y,∑i=1Mxi=1,∀xi∈X,∑i=1M∑j=1Nxipj=1,pj≥0,∀xi∈X,γ∈0,1,xi∈0,1,∀xi∈X,i=1,2,3,…,M,yj∈0,1,yj∈Y,j=1,2,3,…,N.The specific meaning: the objective function is to minimize information entropy, the risk. The first line of constraints represents that the lowest value of information entropy is higher than the limit threshold. The second line of constraint represents that the risk that investors can bear is lower than the upper bound of the maximum tolerance. The third line of constraints describes the calculation strategy for cumulative risk. The fourth line of constraints indicates the maximum investment ratio and no remittance of external funds. The fifth line of constraints indicates that the probability of all scenarios is 1. The sixth, seventh, and eighth lines of constraints are related variable constraints. In order to calculateCVaR with rVaR, assuming that the rate of profit on investment shows a normal distribution, rVaR can be expressed as rVaR=rq+σqzα according to the law of large numbers, where rq measures the maximum loss of the investment portfolio. Then, we obtained that(13)rCVaR=11−α∂zασq−rq.Among them,∂zα is the probability density function of the standard normal distribution, which can be expressed as(14)∂zα=12πe−zα2/2.In addition, becausepi cannot directly predict and is extremely difficult to calculate, this paper uses a computer program to assist in the solution of the model. In order to introduce the two-stage optimization model and its application in the risk-considering investment portfolio problem, the relevant decision variables and parameters are summarized in Table 1.Table 1
Description of parameters and variables.
AnnotationDescriptionxiContinuous variables,xi∈0,1X=x1,x2,…,xi, represent the investment ratio;yjContinuous variables,yj∈0,1Y=y1,y2,…,yj, represent the risk ratio;α0–1 variable,α∈0,1, indicates the existence or nonexistence of the return;β0–1 variable,β∈0,1, indicates whether the skewness be evaluated;γ0–1 variable,γ∈0,1, indicates whether the risk measure is selected or not;piMeasure the probability of thei th combination, i=1,2,…,M;rCVaRiMeasure theCVaR combination of the investment ratio;RMeasure the output ratio of in portfolio,R=1+r;rThe profit rate;siIndicative stock skewness,si∈S;GmaxIndicates the maximum number of combinations that can be selected;UmaxIndicates the maximum acceptable skewness;KminIndicates the lowest acceptable information entropy;rCVaRmaxIndicate the maximum acceptable risk value;rqMeasure the maximum loss of the portfolio;σqStandard deviation of portfolio;zαThe quintile of normal distribution at the confidence level ofα;δIndicates acceptable expected risk value;Mi=1,2,…,M;Ni=1,2,…,N;


## 2.1. Information Entropy

Information entropy can be defined as the possibility of discrete random events [22–24], and the specific expression is shown in (1)S=−∑i=1npilnpi.Among them, the function ofpi is to measure the probability of occurrence of the situation i. In the current stage of theoretical research, information entropy has been widely used to measure the uncertainty of information, and there is a positive correlation between entropy and uncertainty. In addition, the information entropy function also has the following three special properties:(i)
Continuity:S is a continuous function of pi, pi∈0,1(ii)
Nonnegativity:Sp1,p1,p1,…,pn≥0(iii)
Extreme value: if and only if the condition isp1=p2=⋯=pn, the information entropy achieves the maximum value


## 2.2. Value-Added Entropy and Actual Entropy

Value-added entropy is a kind of generalized entropy [25,26], which can be defined as (2)H=∑i=1Wpxilog∑i=1Nxiri.Suppose there areN types of stocks or securities in the market, and the k type contains ni possible prices i=1,2,3,…,N. The number of all possible value combinations is W=n1×n2×n3×⋯×nN. X=x1,x2,x3,…,xk;i=1,2,…,W refers to the investment ratio of the k securities, and R=r1,r2,r3,…,rk is the output ratio in the i price combination. In addition, Ri=1+ri and ri represent the rate of profit, assuming that short selling is not allowed, that is, rk≥0,k=1,2,…,N. The above formula (2) can be further transformed into (3)H=log∏i=1WRipxi,Ri=∑k=1NqkRik.Actual entropy: in the actual financial market, investment transactions require costs, and an investment portfolio that ignores transaction costs will often have a great impact on actual profits and may make investments invalid. Introduce typical transaction costs into the portfolio and define linear transaction costs. However, linear transaction costs rarely appear in investment costs, so the improved transaction cost functionCX=cx1,cx2,cx3,…,cxn can be expressed as(4)cxi=rxi,0≤xi≤a,rkxi2+hxi+q,a≤xi≤b,0≤k≤1,rxi3,b≤xi≤1.This paper draws on the improved typical transaction cost function and establishes a dual-objective portfolio model with the largest profit expectation and the smallest risk expectation. SetX=x1,x2,x3,…,xn as the investment ratio in n stocks, R=r1,r2,r3,…,rn as the expected rate of profit, and MX as the actual rate of profit of stocks and securities, and the portfolio model based on the CVaR measurement is expressed as(5)Π=∑i=1nrixi−∑i=1ncixi.Among them,fX,Y¯j=−X′Y¯j,xi≥0 means that short selling is not allowed, if and only if ωX>ωY and F˜βX,δ,μ<F˜βY,δ,μ. Actual entropy can reflect the speed of appreciation and the cumulative profit of funds. Compared with the mean function that cannot directly reflect the cumulative profit of the fund, the combination of actual entropy and actual entropy can be more effective and more appropriate to reflect the investment profit.


## 2.3. CVaR

VaR can usually be defined as value at risk [27,28], that is, the maximum loss of an investment portfolio in a normal market in a specific period under a specific confidence level of α. Set fX,Y:Rm×Rn⟶Rmn as the loss function of the investment portfolio, and the specific meaning is the expected loss of the investment portfolio. Among them, X is the investment decision vector, which specifically means the proportion of risky securities in the investment portfolio. Y is a 0–1 variable of value at risk, which represents the profit rate of securities stocks. Then, there is fX,Y=−X′Y. When X is fixed, fX,Y is a function of Y. Assuming that Y is a continuous random variable, the probability density function of Y is φY, then ∀δ∈R, and the distribution function is ψX,δ=∫fX,YφYdY, which represents the probability that the loss fX,Y does not exceed δ, δ is the upper limit of risk, and ψX,δ is the nonincreasing right continuous function of δ. Assuming that β0≤β≤1 is used to represent the confidence level, X of VaR is expressed as(6)VaRβX=minδ∈R:ψX,δ≥β.However, becauseVaR is only a quintile within a certain confidence level, the left-tail risk beyond this quintile cannot be measured by VaR, which leads to failure in assessing the overall risk of the portfolio and makes investors may ignore huge losses in some small probability events. At the same time, VaR cannot measure the risks in some extreme situations, such as financial crises. Based on this, VaR under certain CVaR was proposed. CVaR can be defined as the conditional average value of losses exceeding under a certain confidence level, which is used to measure the average excess level of losses [29,30]. According to the research of related scholars, CVaR is more sensitive to the shape of the loss distribution at the tail of the distribution [31,32]. According to the definition of CVaR, we can get(7)CVaRX=EfX,Y|fX,Y≥VaRβX=1−β−1∫fX,Y≥VaRβXfX,YφYdY.It is found thatVaR must be used in the process of solving equation (7), and the mathematical expression is extremely complicated, and it is difficult to calculate the result. In order to solve this problem, Rockafellar and other scholars constructed an auxiliary function FβX,δ and effectively connected CVaR and VaR [33,34]. The auxiliary function is(8)FβX,δ=δ+1−β−1∫Y∈RnmaxfX,Y−δ,0φYdY,where VaRβX=minFβX,δ. Due to the diversity and complexity of the market environment, the loss caused is also uncertain, and the probability density function φY is not easy to calculate. Therefore, the method of using historical data to simulate calculations is selected, and historical data is used to predict the specific future random vector. Assuming that the random variable Y in the past trading day represents m scenarios, the value of each scenario is Y¯j,j=1,2,…,m, and the probability of any one scenario is 1/m. So, it exists that(9)F˜βX,δ=δ+m−11−β−1∑j=1mmaxfX,Y¯−δ,0.Because of the existence of functionmax in equation (9), and because function F˜βX,δ is usually not continuous and differentiable, general algorithms cannot be solved. Here, the aggregation function proposed by related scholars is used to smooth the max function [35,36]. For any μ>0, the above function can be expressed as(10)F˜βX,δ,μ=δ+m−11−β−1∑j=1mμlnexpfX,Y¯−δμ+1.


## 2.4. Two-Stage Mixed Integer Programming (TS-MIP) Model

A diversified investment portfolio has lower volatility risk than personal assets, and increasing the diversification of the investment portfolio can help investors reduce the variance of the investment portfolio. Not only can the risk in the investment portfolio be effectively and accurately measured, but also the investment portfolio can evaluate diversity. According to investment portfolio theory, diversityG can be used to reduce nonsystematic risks. Specifically, the greater the value, the more diversified the investment portfolio. Based on the above theory, in the model proposed in this paper, CVaR is used to adjust the direct function to determine the new objective function to measure the risk of the investment portfolio. The value-added entropy combined with the real entropy function M is used to measure the statistical profit of investment. Skewness function is used to measure investment increment. Based on the above analysis and combined investment portfolio strategy research, this paper proposes the following TS-MIP model, the structure of which is shown in Figure 1. The problem of outer layer maximization benefit planning mainly analyzes the maximization of income and the maximization of investment diversity and the maximization of skewness. Corresponding to it is the problem of internal minimization of risk, which mainly includes the minimization of information entropy and the minimization of investment risk. The investment risk here is measured by the CVaR.Figure 1
The theoretical framework of the TS-MIP model.The stage of maximizing the benefit of the outer layer is the overall stage, and the specific form is as follows:(11)maxZ=αR′X+βS′X+γEδminF˜βX,Ys.t.∑i=1Mαrixi−∑i=1Mcixi≥Πmin,∀ri∈R,i=1,2,3,…,M,∑i=1Mxi=1,∀xi∈X,∑i=1Mβxilnxi≤Gmax,i=1,2,3,…,M,∑i=1Msixi≤Umax,∀si∈S,i=1,2,3,…,M,α,β∈0,1,xi∈0,1,i=1,2,3,…,M.The objective function is combinatorial optimization problem, which maximizes the profit under the condition of the lowest risk. The first line of constraint indicates the lower bound of profit. The second line of constraint indicates the maximum investment ratio, short selling is not allowed, and there is no additional capital inflow. The third line of constraints indicates the upper limit of investment diversity. The fourth line of constraints indicates the upper limit of the investment increment. The fifth and sixth lines of constraints are related variable constraints; the purpose is to ensure the feasibility. The inner minimization problem is second stage, and the form is as follows:(12)EδminF˜λX,Y,K,γ,δ,μ,s.t.−∑i=1M∑j=1NxipjlnrCVaRi∑i=1MrCVaRi≥Kmin,δ+1m1−λ∑i=1M∑j=1NμlnexpγfX,Y−δμ+1≤rCVaRmax,fX,Y=∑i=1M∑j=1Nxiyj,∀xi∈X,∀yi∈Y,∑i=1Mxi=1,∀xi∈X,∑i=1M∑j=1Nxipj=1,pj≥0,∀xi∈X,γ∈0,1,xi∈0,1,∀xi∈X,i=1,2,3,…,M,yj∈0,1,yj∈Y,j=1,2,3,…,N.The specific meaning: the objective function is to minimize information entropy, the risk. The first line of constraints represents that the lowest value of information entropy is higher than the limit threshold. The second line of constraint represents that the risk that investors can bear is lower than the upper bound of the maximum tolerance. The third line of constraints describes the calculation strategy for cumulative risk. The fourth line of constraints indicates the maximum investment ratio and no remittance of external funds. The fifth line of constraints indicates that the probability of all scenarios is 1. The sixth, seventh, and eighth lines of constraints are related variable constraints. In order to calculateCVaR with rVaR, assuming that the rate of profit on investment shows a normal distribution, rVaR can be expressed as rVaR=rq+σqzα according to the law of large numbers, where rq measures the maximum loss of the investment portfolio. Then, we obtained that(13)rCVaR=11−α∂zασq−rq.Among them,∂zα is the probability density function of the standard normal distribution, which can be expressed as(14)∂zα=12πe−zα2/2.In addition, becausepi cannot directly predict and is extremely difficult to calculate, this paper uses a computer program to assist in the solution of the model. In order to introduce the two-stage optimization model and its application in the risk-considering investment portfolio problem, the relevant decision variables and parameters are summarized in Table 1.Table 1
Description of parameters and variables.
AnnotationDescriptionxiContinuous variables,xi∈0,1X=x1,x2,…,xi, represent the investment ratio;yjContinuous variables,yj∈0,1Y=y1,y2,…,yj, represent the risk ratio;α0–1 variable,α∈0,1, indicates the existence or nonexistence of the return;β0–1 variable,β∈0,1, indicates whether the skewness be evaluated;γ0–1 variable,γ∈0,1, indicates whether the risk measure is selected or not;piMeasure the probability of thei th combination, i=1,2,…,M;rCVaRiMeasure theCVaR combination of the investment ratio;RMeasure the output ratio of in portfolio,R=1+r;rThe profit rate;siIndicative stock skewness,si∈S;GmaxIndicates the maximum number of combinations that can be selected;UmaxIndicates the maximum acceptable skewness;KminIndicates the lowest acceptable information entropy;rCVaRmaxIndicate the maximum acceptable risk value;rqMeasure the maximum loss of the portfolio;σqStandard deviation of portfolio;zαThe quintile of normal distribution at the confidence level ofα;δIndicates acceptable expected risk value;Mi=1,2,…,M;Ni=1,2,…,N;


## 3. Two-Stage Robust Optimization (TS-RO) Model with Uncertainty

### 3.1. Portfolio Optimization Problem with Uncertainty

The real capital market environment is full of instability and randomness, and it is extremely difficult or even impossible to obtain the accuracy of data parameters. In the research of dealing with uncertain information, many scholars have cited the theory of robust optimization. Robust optimization model can effectively provide an effective measure of uncertainty. Studies have found that it plays an extremely restrictive role in dealing with uncertain information parameters. In this section, by citing the theory of robust optimization, a two-stage robust optimization model for solving portfolio problems under uncertain conditions is constructed [37]. Based on the analysis of real securities and stock markets, this paper takes the two-stage basic model as the research object to explore the impact of uncertainty in depth. In the actual market analysis process, the upper bound of the expected risk probability is not always certain. In other words, in a complex capital market environment, investors’ risk attitudes are not always consistent. As investors’ risk attitudes change, the original assumptions of expected risk probability as deterministic will not reflect the reality. Therefore, this section extends the expected risk probability from certainty to uncertainty. According to the relevant theory of robust optimization, the assumptions are as follows. Set the expected risk probability that δi⟶δ˜i is δ˜i=δi0+δ^i, where δi0 is the nominal demand, δ^i=εδi0 and ε are the disturbance items [38]. Based on the above problem description and feasibility assumptions, this paper builds the TS-RO model. The expected risk of uncertainty in the model is δ˜i, and the uncertainty set is the most commonly used ellipsoid set EE [39]. The l2 norm is used to define the uncertain ellipsoid sets ∪E, ∪E|εj:εj2≤Ω⟺εj∑Jεj2≤Ω, and Ωj as adjustable safety parameters, as well as the spherical diameter of the uncertain set. It means that at most Ωj disturbance items deviate from the nominal set ∪E=δ˜j∈ℝ,∑Jδ˜j−δj0/δ^j2≤Ωj2 [40,41].Theorem 1.
For the given condition thatδ˜i is closed and convex, when the parameter ε=0 is uncertain, the constraint adjustment of the second stage part of the TS-RO model under uncertain conditions is equivalent to TS-MIP model, that is, maxδ˜i+HX,Y,δ˜i≤rCVaRmax⟺supδ˜i+ε|ε=0ΗX,Y,ε,δ˜i≤rCVaRmax, in which, in order to simplify the expression, set HX,Y=1/m1−λ∑i=1M∑j=1NμlnexpγfX,Y−δ/μ+1.Proof.
The conventional ellipsoid uncertainty set∪E is ci∈Rn:ci=c¯i+Δξ,ξ≤Ω, where Δ=∑1/2, and its constraints maxciTX≤B can be translated as maxciTX:ci−c¯iTΣ−1ci−c¯i∈Ω2. For ∀Σ is positive and closed, it is a convex problem. Therefore, convex problem can be solved by Karush-Kuhn-Tucher condition. minℱci∗=−ci∗TX with s.t.gci∗=ci∗−c¯iTΣ−1ci∗−c¯i−Ω2≤0. Therefore, the meaningful solution to deal with uncertain problems is its robust feasible solution. In all robust feasible solutions, how to interpret the value of the target (and possibly uncertain) still needs deeper analysis. When applied to the target problem, it is natural to quantify the quality of the solution through the guaranteed value supEEEδ˜i:c (i.e., the maximum value) with the help of the “worst case-oriented” concept of robust theory. Thus, the best possible robust feasible solution is the one that solves the TS-MIP model maxδ˜i+HX,Y,δ˜i≤rCVaRmax, or which is the same, the optimization problem supδ˜i+ε|ε=0HX,Y,ε,δ˜i≤rCVaRmax in the TS-RO model. The latter problem is called the robust counterpart of the original TS-MIP problem. Above all, Theorem 1 can be proved.


### 3.2. Two-Stage Robust Optimization (TS-RO) Model with Uncertainty

Based on the above analysis and combined investment portfolio strategy research, this paper proposes the following TS-RO model. Under uncertain conditions, the expression form of the outer maximization stage is the same as the TS-MIP model, and the specific form is as follows:(15)supε∈EZ=αR′X+βS′X+γδinfε∈EEF˜βX,Y,δ˜j,s.t.∑i=1Mαrixi−∑i=1Mcixi≥Πmin,∀ri∈R,i=1,2,3,…,M,∑i=1Mxi=1,∀xi∈X,∑i=1Mβxilnxi≤Gmax,i=1,2,3,…,M,∑i=1Msixi≤Umax,∀si∈S,i=1,2,3,…,M,α,β∈0,1,xi∈0,1,i=1,2,3,…,M.Since the risk attitude of investors is considered, the expression form of the second stage inner minimization problem is significantly different from the basic model. The specific form is as follows:(16)δinfε∈EF˜λX,Y,K,γ,δ˜j,μ,s.t.−∑i=1M∑j=1NxipjlnrCVaRi∑i=1MrCVaRi≥Kmin,δj0+Ωj1m1−λ∑i=1M∑j=1NμlnexpγfX,Y−δ^jμ+1≤rCVaRmax,fX,Y=∑i=1M∑j=1Nxiyj,∀xi∈X,∀yi∈Y,∑i=1Mxi=1,∀xi∈X,∑i=1M∑j=1Nxipj=1,pj≥0,∀xi∈X,γ∈0,1,xi∈0,1,∀xi∈X,i=1,2,3,…,M,yj∈0,1,yj∈Y,j=1,2,3,…,N.It is worth noting that, in the inner minimization problem with uncertainty, the objective of the objective function is rewritten to solve the infimum problem due to the heterogeneity of investors’ risk attitudes. The meaning of the second term of the constraint is the risk probability scenario under the worst scenario. When the disturbance term of the uncertain parameter fluctuates within the range of the ellipsoid set, the adjustable safety parameter reflects the decision under the worst scenario. Its purpose is to solve the most stable investment income scenario, that is, the most stable income. In the process of calculation, the planning problem is more difficult due to the solution of multiple quadratic functions. Therefore, in the follow-up study, in the program involving a large number of calculations, computer software and existing commercial software are used to solve the problem. The package is used for solving calculations to ensure the accuracy of the obvious results.


## 3.1. Portfolio Optimization Problem with Uncertainty

The real capital market environment is full of instability and randomness, and it is extremely difficult or even impossible to obtain the accuracy of data parameters. In the research of dealing with uncertain information, many scholars have cited the theory of robust optimization. Robust optimization model can effectively provide an effective measure of uncertainty. Studies have found that it plays an extremely restrictive role in dealing with uncertain information parameters. In this section, by citing the theory of robust optimization, a two-stage robust optimization model for solving portfolio problems under uncertain conditions is constructed [37]. Based on the analysis of real securities and stock markets, this paper takes the two-stage basic model as the research object to explore the impact of uncertainty in depth. In the actual market analysis process, the upper bound of the expected risk probability is not always certain. In other words, in a complex capital market environment, investors’ risk attitudes are not always consistent. As investors’ risk attitudes change, the original assumptions of expected risk probability as deterministic will not reflect the reality. Therefore, this section extends the expected risk probability from certainty to uncertainty. According to the relevant theory of robust optimization, the assumptions are as follows. Set the expected risk probability that δi⟶δ˜i is δ˜i=δi0+δ^i, where δi0 is the nominal demand, δ^i=εδi0 and ε are the disturbance items [38]. Based on the above problem description and feasibility assumptions, this paper builds the TS-RO model. The expected risk of uncertainty in the model is δ˜i, and the uncertainty set is the most commonly used ellipsoid set EE [39]. The l2 norm is used to define the uncertain ellipsoid sets ∪E, ∪E|εj:εj2≤Ω⟺εj∑Jεj2≤Ω, and Ωj as adjustable safety parameters, as well as the spherical diameter of the uncertain set. It means that at most Ωj disturbance items deviate from the nominal set ∪E=δ˜j∈ℝ,∑Jδ˜j−δj0/δ^j2≤Ωj2 [40,41].Theorem 1.
For the given condition thatδ˜i is closed and convex, when the parameter ε=0 is uncertain, the constraint adjustment of the second stage part of the TS-RO model under uncertain conditions is equivalent to TS-MIP model, that is, maxδ˜i+HX,Y,δ˜i≤rCVaRmax⟺supδ˜i+ε|ε=0ΗX,Y,ε,δ˜i≤rCVaRmax, in which, in order to simplify the expression, set HX,Y=1/m1−λ∑i=1M∑j=1NμlnexpγfX,Y−δ/μ+1.Proof.
The conventional ellipsoid uncertainty set∪E is ci∈Rn:ci=c¯i+Δξ,ξ≤Ω, where Δ=∑1/2, and its constraints maxciTX≤B can be translated as maxciTX:ci−c¯iTΣ−1ci−c¯i∈Ω2. For ∀Σ is positive and closed, it is a convex problem. Therefore, convex problem can be solved by Karush-Kuhn-Tucher condition. minℱci∗=−ci∗TX with s.t.gci∗=ci∗−c¯iTΣ−1ci∗−c¯i−Ω2≤0. Therefore, the meaningful solution to deal with uncertain problems is its robust feasible solution. In all robust feasible solutions, how to interpret the value of the target (and possibly uncertain) still needs deeper analysis. When applied to the target problem, it is natural to quantify the quality of the solution through the guaranteed value supEEEδ˜i:c (i.e., the maximum value) with the help of the “worst case-oriented” concept of robust theory. Thus, the best possible robust feasible solution is the one that solves the TS-MIP model maxδ˜i+HX,Y,δ˜i≤rCVaRmax, or which is the same, the optimization problem supδ˜i+ε|ε=0HX,Y,ε,δ˜i≤rCVaRmax in the TS-RO model. The latter problem is called the robust counterpart of the original TS-MIP problem. Above all, Theorem 1 can be proved.


## 3.2. Two-Stage Robust Optimization (TS-RO) Model with Uncertainty

Based on the above analysis and combined investment portfolio strategy research, this paper proposes the following TS-RO model. Under uncertain conditions, the expression form of the outer maximization stage is the same as the TS-MIP model, and the specific form is as follows:(15)supε∈EZ=αR′X+βS′X+γδinfε∈EEF˜βX,Y,δ˜j,s.t.∑i=1Mαrixi−∑i=1Mcixi≥Πmin,∀ri∈R,i=1,2,3,…,M,∑i=1Mxi=1,∀xi∈X,∑i=1Mβxilnxi≤Gmax,i=1,2,3,…,M,∑i=1Msixi≤Umax,∀si∈S,i=1,2,3,…,M,α,β∈0,1,xi∈0,1,i=1,2,3,…,M.Since the risk attitude of investors is considered, the expression form of the second stage inner minimization problem is significantly different from the basic model. The specific form is as follows:(16)δinfε∈EF˜λX,Y,K,γ,δ˜j,μ,s.t.−∑i=1M∑j=1NxipjlnrCVaRi∑i=1MrCVaRi≥Kmin,δj0+Ωj1m1−λ∑i=1M∑j=1NμlnexpγfX,Y−δ^jμ+1≤rCVaRmax,fX,Y=∑i=1M∑j=1Nxiyj,∀xi∈X,∀yi∈Y,∑i=1Mxi=1,∀xi∈X,∑i=1M∑j=1Nxipj=1,pj≥0,∀xi∈X,γ∈0,1,xi∈0,1,∀xi∈X,i=1,2,3,…,M,yj∈0,1,yj∈Y,j=1,2,3,…,N.It is worth noting that, in the inner minimization problem with uncertainty, the objective of the objective function is rewritten to solve the infimum problem due to the heterogeneity of investors’ risk attitudes. The meaning of the second term of the constraint is the risk probability scenario under the worst scenario. When the disturbance term of the uncertain parameter fluctuates within the range of the ellipsoid set, the adjustable safety parameter reflects the decision under the worst scenario. Its purpose is to solve the most stable investment income scenario, that is, the most stable income. In the process of calculation, the planning problem is more difficult due to the solution of multiple quadratic functions. Therefore, in the follow-up study, in the program involving a large number of calculations, computer software and existing commercial software are used to solve the problem. The package is used for solving calculations to ensure the accuracy of the obvious results.


## 4. Numerical Experiment

Suppose that an investor conducts investment activities on a stock exchange and selects 10 securities stocks as alternatives through multiple comparisons in multiple securities markets. After rigorous data comparison and advantage analysis, the best investment plan combination is screened out in order to achieve the purpose of maximizing the comprehensive benefits. In the process of selecting securities and stocks, the following factors and principles need to be considered comprehensively. First, the ultimate goal of investors is to maximize profits, but, at the same time, they must also take into account their risk tolerance. In other words, investors are pursuing the maximization of profits on the basis of certain risk expectations. Second, the investor’s investment assets are fixed, and the initial investment proceeds will be used again for investment. Third, the investment process is rational. When investors face the risk of resisting the initial threshold, the investment quota will no longer be added. According to the above basic elements and principles, this paper first uses data crawling technology to obtain the relevant database, then uses the computer to simulate and check the model, and finally obtains investment management recommendations and research enlightenments through a large number of comparisons.


### 4.1. Data Collection

In this section, we use actual financial securities market data to conduct simulation experiments to verify the effectiveness of the model. In the data acquisition stage, this section uses python to write the technical framework,Python 3.6, requests, math, time, pandas, matplotlib, pyecharts, statsmodels, scipy, jieba, and pylab. Figure 2 describes the calculation steps of the data crawling technology. First, log in to the target web page, browse the relevant web page information (Eastern Fortune.com), and search for the online information of the target web page. Secondly, analyze the web page structure, view the source code of the web page, and click on the next page to observe the change of the url in the search bar of the browser. Thirdly, use the dictionary method to read the data directly, and save the read data to the preset file database. Next, use a loop strategy to crawl the data step by page, jump to the next page after completing the crawling of one page of data, and repeat the same data collection process. Finally, when the acquired data is stored in the database, the crawling process is terminated.Figure 2
Data crawling process steps.This section obtains historical data of historical stocks from a real website (Eastern Fortune.com). The data is obtained from the period from July 24, 2020, to December 20, 2020, about 1,000 statistical data generated by 100 exchanges of 10 stocks on the next day. Since the trading of stocks is only carried out on the trading day, the data sequence is sorted by time, but the time sequence is not continuous. In order to facilitate statistical calculations, this section sorts them according to the order of the trading days, which are 1 to 100 trading days. Table2 describes the initial part of the data form of the obtained stock information. Before the numerical simulation, we conducted a simple statistical analysis of the historical profits of 10 stocks. Table 2 lists the average profit, standard deviation, skewness, and kurtosis of a single stock.Table 2
Original stock data table (partial data).
CodeDateClosing pointOpening.PHighest.PLowest.PUps and downsQuoteVolume000001.SH07243196.76843310.64493319.12683184.9645128.3418−3.8598427054026000001.SH07233325.11023306.14893336.30023257.8269−8.0533−0.2416407042499000001.SH07223333.16353315.18163381.97573311.786212.26880.3694393335335000001.SH07213320.89473330.54673336.67913300.57196.74570.2035359252029000001.SH07203314.1493243.91053314.1493220.684100.02033.1119418555306000001.SH07173214.12873214.40223252.77863181.27454.03010.1255359652413000001.SH07163210.09863356.3593373.53173209.7272151.2058−4.4984490613123000001.SH07153361.30443422.07783432.45063345.7488−53.3142−1.5614492030542000001.SH07143414.61863435.02373451.22243366.0828−28.6677−0.8326543211492000001.SH07133443.28633379.38673458.79143369.037859.96411.7723558006875000001.SH07103383.32223418.93473433.10853372.5066−67.2713−1.9496556120011………………………The relevant parameter settings in this section are as follows: when investors sell securities in the securities market, the ratio of securities lending margin shall not be less than 50%, sok = 0.5. In the process of stock trading, the transaction cost includes commission, stamp duty, and transfer fee, which is generally 0.3% of the transaction amount. Due to the existence of transaction fees, stock trading should not be too frequent. This paper studies wind as three levels; one is based on a 30-day cycle, another is based on a 60-day cycle, and the third is based on a 90-day cycle. Analyze the relevance and influence of various indicators of stock trading. The profit rate of the stock is fitted according to historical parameters, and the fitted value of the historical data is used as the profit rate for analysis. On the assumption of the confidence interval, this paper, respectively, assumes 85%, 90%, 95%, and 99% confidence intervals and analyzes the parameters of each confidence interval.Figure3 depicts the volatility of the profit rate of the selected 10 stocks 100 times. It can be seen that the fluctuation of stocks is relatively large, which shows that the volatility of investment income is relatively large. It can also be found that there is no obvious law for the fluctuation of stocks, so there are no algorithms and tools that can accurately predict stock investment profits. Overall, the volatility of individual stocks is affected by objective economic factors, which is manifested in the overall change trend of the macro. From the above figure, it can be seen that the volatility of stocks has a certain time regularity; that is, there are overall ups and downs. The trend of. Therefore, in the investment process, it is necessary to take into account the various factors of the investment, as well as to make a reasonable plan in combination with objective conditions and risk tolerance.Figure 3
Volatility of stocks (100 Trades).Figure4 depicts the overall (100 trading days) average amount of fluctuations in 10 stocks. Only from the perspective of the average value, among the 10 stocks, the average value of volatility of 8 stocks is higher than 0, and the average value of volatility of 2 stocks is lower than 0. This shows that the overall stock market at this stage shows a good development trend. Stockholders showed a positive attitude towards the improvement of economic conditions and actively invested funds in the stock market.Figure 4
Average value of stock volatility.


### 4.2. Model Algorithm Design

In this paper, based on the Matlab (R2016a) platform, the algorithm framework is designed, and the algorithms of the two-stage basic model and the TS-RO model under uncertain conditions are constructed, respectively. Solve by calling the solver Gurobi (9–1–0). In order to ensure the rigor and scientificity of the experiment, all algorithms are operated in the same computing environment (Windows 10, Intel (R) Core (TM) i5-8300H CPU @2.3 GHz, RAM 8 GB, 512 G SSD). The algorithm framework and calculation steps of the model are shown in Algorithm1.Algorithm 1: Specific steps of models algorithm.
(i)
Input Measurement data(ii)
Initialization: Input the initial value; Setting parameter value boundary;(iii)
Step 1:(iv)
For TS-MIP model: Define variable type; Set probability function;(v)
else TS-RO model(vi)
Define the variable type; Generate random number; Set the safety parameters;(vii)
End(viii)
Step 2:While(ix)
Inputε,ξ∈UBj,UBj, do step 3; Otherwise: re-step 1;(x)
End while(xi)
Step 3: Initialize(xii)
Input Parameter constraints; Variable constraints;(xiii)
End(xiv)
Step 4:Do for: Set the solution environment; Solved by Gurobi;(xv)
If met step 3: Out the result and time(xvi)
Else: profit step 2;(xvii)
End do(xviii)
ProfitX∗


## 4.1. Data Collection

In this section, we use actual financial securities market data to conduct simulation experiments to verify the effectiveness of the model. In the data acquisition stage, this section uses python to write the technical framework,Python 3.6, requests, math, time, pandas, matplotlib, pyecharts, statsmodels, scipy, jieba, and pylab. Figure 2 describes the calculation steps of the data crawling technology. First, log in to the target web page, browse the relevant web page information (Eastern Fortune.com), and search for the online information of the target web page. Secondly, analyze the web page structure, view the source code of the web page, and click on the next page to observe the change of the url in the search bar of the browser. Thirdly, use the dictionary method to read the data directly, and save the read data to the preset file database. Next, use a loop strategy to crawl the data step by page, jump to the next page after completing the crawling of one page of data, and repeat the same data collection process. Finally, when the acquired data is stored in the database, the crawling process is terminated.Figure 2
Data crawling process steps.This section obtains historical data of historical stocks from a real website (Eastern Fortune.com). The data is obtained from the period from July 24, 2020, to December 20, 2020, about 1,000 statistical data generated by 100 exchanges of 10 stocks on the next day. Since the trading of stocks is only carried out on the trading day, the data sequence is sorted by time, but the time sequence is not continuous. In order to facilitate statistical calculations, this section sorts them according to the order of the trading days, which are 1 to 100 trading days. Table2 describes the initial part of the data form of the obtained stock information. Before the numerical simulation, we conducted a simple statistical analysis of the historical profits of 10 stocks. Table 2 lists the average profit, standard deviation, skewness, and kurtosis of a single stock.Table 2
Original stock data table (partial data).
CodeDateClosing pointOpening.PHighest.PLowest.PUps and downsQuoteVolume000001.SH07243196.76843310.64493319.12683184.9645128.3418−3.8598427054026000001.SH07233325.11023306.14893336.30023257.8269−8.0533−0.2416407042499000001.SH07223333.16353315.18163381.97573311.786212.26880.3694393335335000001.SH07213320.89473330.54673336.67913300.57196.74570.2035359252029000001.SH07203314.1493243.91053314.1493220.684100.02033.1119418555306000001.SH07173214.12873214.40223252.77863181.27454.03010.1255359652413000001.SH07163210.09863356.3593373.53173209.7272151.2058−4.4984490613123000001.SH07153361.30443422.07783432.45063345.7488−53.3142−1.5614492030542000001.SH07143414.61863435.02373451.22243366.0828−28.6677−0.8326543211492000001.SH07133443.28633379.38673458.79143369.037859.96411.7723558006875000001.SH07103383.32223418.93473433.10853372.5066−67.2713−1.9496556120011………………………The relevant parameter settings in this section are as follows: when investors sell securities in the securities market, the ratio of securities lending margin shall not be less than 50%, sok = 0.5. In the process of stock trading, the transaction cost includes commission, stamp duty, and transfer fee, which is generally 0.3% of the transaction amount. Due to the existence of transaction fees, stock trading should not be too frequent. This paper studies wind as three levels; one is based on a 30-day cycle, another is based on a 60-day cycle, and the third is based on a 90-day cycle. Analyze the relevance and influence of various indicators of stock trading. The profit rate of the stock is fitted according to historical parameters, and the fitted value of the historical data is used as the profit rate for analysis. On the assumption of the confidence interval, this paper, respectively, assumes 85%, 90%, 95%, and 99% confidence intervals and analyzes the parameters of each confidence interval.Figure3 depicts the volatility of the profit rate of the selected 10 stocks 100 times. It can be seen that the fluctuation of stocks is relatively large, which shows that the volatility of investment income is relatively large. It can also be found that there is no obvious law for the fluctuation of stocks, so there are no algorithms and tools that can accurately predict stock investment profits. Overall, the volatility of individual stocks is affected by objective economic factors, which is manifested in the overall change trend of the macro. From the above figure, it can be seen that the volatility of stocks has a certain time regularity; that is, there are overall ups and downs. The trend of. Therefore, in the investment process, it is necessary to take into account the various factors of the investment, as well as to make a reasonable plan in combination with objective conditions and risk tolerance.Figure 3
Volatility of stocks (100 Trades).Figure4 depicts the overall (100 trading days) average amount of fluctuations in 10 stocks. Only from the perspective of the average value, among the 10 stocks, the average value of volatility of 8 stocks is higher than 0, and the average value of volatility of 2 stocks is lower than 0. This shows that the overall stock market at this stage shows a good development trend. Stockholders showed a positive attitude towards the improvement of economic conditions and actively invested funds in the stock market.Figure 4
Average value of stock volatility.


## 4.2. Model Algorithm Design

In this paper, based on the Matlab (R2016a) platform, the algorithm framework is designed, and the algorithms of the two-stage basic model and the TS-RO model under uncertain conditions are constructed, respectively. Solve by calling the solver Gurobi (9–1–0). In order to ensure the rigor and scientificity of the experiment, all algorithms are operated in the same computing environment (Windows 10, Intel (R) Core (TM) i5-8300H CPU @2.3 GHz, RAM 8 GB, 512 G SSD). The algorithm framework and calculation steps of the model are shown in Algorithm1.Algorithm 1: Specific steps of models algorithm.
(i)
Input Measurement data(ii)
Initialization: Input the initial value; Setting parameter value boundary;(iii)
Step 1:(iv)
For TS-MIP model: Define variable type; Set probability function;(v)
else TS-RO model(vi)
Define the variable type; Generate random number; Set the safety parameters;(vii)
End(viii)
Step 2:While(ix)
Inputε,ξ∈UBj,UBj, do step 3; Otherwise: re-step 1;(x)
End while(xi)
Step 3: Initialize(xii)
Input Parameter constraints; Variable constraints;(xiii)
End(xiv)
Step 4:Do for: Set the solution environment; Solved by Gurobi;(xv)
If met step 3: Out the result and time(xvi)
Else: profit step 2;(xvii)
End do(xviii)
ProfitX∗


## 5. Sensitivity Analysis

### 5.1. The Computational Efficiency of the Model

In the same computing environment and the same computing scale, this section analyzes the factors affecting the running time of the model. After fixing the relevant parameters, the investment cycle is the only variable. We divide the time period (L/DAY) into 30, 60, and 90 trading days and compare the differences in the running time of the model. The calculation results are shown in Table3. The analysis found that the length of the time period has a positive correlation with the calculation time; that is, the longer the time, the longer the calculation time of the model. Secondly, the calculation time of different models is slightly different. Among them, the calculation time of the equal-weight model is the shortest, the calculation time of the TS-MIP model is in the middle, and the calculation time of the TS-RO model is the longest. The increase in computing time reflects the increase in computing volume, which means that the computing volume and complexity of the TS-RO model are also the largest.Table 3
CPU calculation time of three models under different time windows.
Period (L/DAY)30 (s)60 (s)90 (s)Equal weight method1.9833.7818.093TS-MIP model2.0814.2347.781TS-RO model2.1454.6898.071


### 5.2. Autocorrelation Analysis

The long memory of financial securities asset profits refers to the significant autocorrelation of distant time intervals in the time series of profits; that is, historical events will continue to affect the future. Since stock securities data has obvious long memory, historical data information can be used to predict future profits and other related parameters. In this section, the parameters obtained are normalized, and the correlation effects can be compared more clearly. In this section, using the autocorrelation coefficient method, research and analysis found that the income of the industrial average index has significant long memory, as shown in Figures5 and 6. The autocorrelation function is a measure of correlation, that is, a measure of similarity, which is the correlation between the function and the function itself. When there are periodic components in the function, the maximum value of the autocorrelation function can well reflect this periodicity. Cross-correlation is the similarity between two functions. When both functions have the same periodic component, the maximum value can also reflect this periodic component. From the perspective of linear space, correlation operation is actually an inner product operation, and the inner product of two vectors in linear space represents the projection of one vector to another vector, indicating the similarity of the two vectors, so the correlation operation reflects this kind of similarity.Figure 5
Autocorrelation analysis (Stocks 1–5).Figure 6
Autocorrelation analysis (Stocks 6–10).From Figures5 and 6, we can find that the fluctuation of the curve tends to be flat. For the autocorrelation graph test, stationary series have short-term correlation. This property indicates that, for stationary series, only recent series values usually have a more obvious influence on the current value. The farther apart the past value, the smaller the influence on the current value. As the number of delay periods increases, the autocorrelation coefficient of a stationary series will decay relatively quickly to zero and fluctuate randomly around zero, while the autocorrelation coefficient of a nonstationary series decays slowly. This is the use of autocorrelation graphs, the standard for the stationarity test.


### 5.3. Influence of Safety Parameters

To ensure the unbiased and scientific nature of the experiment, the parameters are fixed. The model under the condition of deterministic information is the TS-MIP model. With the increase of security parameters, the parameters in the model such as rate of profit, diversity, skewness, information entropy, and CVaR are not affected. In the environment of uncertain risk preference, the model is the TS-RO model. The parameter diversity, skewness, and information entropy are not disturbed by uncertainty. Under the environment of uncertain risk appetite, the risk attitude of investment has changed. Here, through the method of robust optimization, the relevant risk preference range and boundary are constructed with the help of uncertain sets. The benefits of important parameters, CVaR, and total revenue are significantly affected by safety parameters.Figure7 describes the impact of security parameters on A: revenue and B: diversity. It can be seen from Figure 7 that, under deterministic information conditions, changes in security parameters will not have an impact on revenue and diversity. The figure shows that the influence curve of the TS-MIP model is a horizontal straight line. Of course, the deterministic TS-MIP model cannot cope with the problem of portfolio optimization under uncertain conditions. Under conditions of uncertain information, changes in security parameters have a positive impact on profits, but not on the diversity of investment portfolios. Specifically, as the level of security parameters increases, investors’ investment income also shows an increasing trend. That is, when the risk is controllable, the rate of profit on investment is higher, and the investment ratio is larger.Figure 7
Revenue and diversity in SP.Figure8 describes the impact of security parameters on C: skewness and D: information entropy.Figure 8
Information entropy and skewness in SP.It can be seen from Figure8 that, under deterministic information conditions, changes in security parameters will not have an impact on skewness and information entropy. The figure shows that the influence curve of the TS-MIP model is a horizontal straight line. Of course, the deterministic TS-MIP model cannot cope with the problem of portfolio optimization under uncertain conditions. Under uncertain conditions, changes in security parameters will not have an impact on skewness and information entropy. This shows that it is not the controllability of risk that affects investor confidence, but other deeper factors.Figure9 describes the impact of safety parameters on E : CVaR and F: total benefits. From the change trend of the curve in Figure 9, it can be found that, under certain information conditions, changes in safety parameters will not have an impact on CVaR and overall benefits. The figure shows that the influence curve of the TS-MIP model is a horizontal straight line. Under uncertain conditions, changes in safety parameters will have a significant impact on CVaR and overall benefits. As the security parameters increase, the risk of investment shows an increasing trend, which is often referred to as a robust price, which is the price paid to resist risks. But, at the same time, the increase in safety parameters also makes the overall benefit show an increasing trend, which can increase investors’ investment confidence when they choose investment.Figure 9
The impact of SP on CVaR and presidential benefits.


### 5.4. Testing the Effectiveness of the Portfolio

For comparison, three financial ratios are listed below to measure the pros and cons of stocks and securities. The Sharpe ratioShR is used to help investors understand the profit on investment related to their risk. Unlike the ShR, the Sortino ratio SoR is used to evaluate the excess profit of a portfolio given a downside risk. The Treynor ratio (TrR) represents a risk-adjusted profit based on systemic risk. Generally speaking, the greater the value of the Sharpe/Sortino/Treynor ratio, the greater the risk-adjusted profit, and the more attractive the risk-adjusted profit for rational investors.ShR is an indicator proposed by William to research and measure fund performance [42]. This indicator is not only a standardized indicator for fund performance evaluation, it has been successfully applied in many fields as well. The purpose of the ShR is to calculate how much excess profit will be generated per unit of total risk assumed by the portfolio. When all assets in the portfolio are risk assets, the Sharpe ratio applies. The formula for calculating the ShR is(17)ShR=∑iERpi−Rfσpi,i∈I.Among them,ERpi is the expected annualized profit of the investment portfolio, Rf is the annualized risk-free interest rate, and σpi is the standard deviation of the annualized profit of the investment portfolio. The Sharpe ratio represents how much excess profit investors can get for each additional risk point. If it is greater than 1, it means that the fund’s profit is higher than the volatility risk; if it is less than 1, it means that the operational risk of the fund is greater than the rate of profit.In this way, the Sharpe ratio of each investment portfolio can be calculated, that is, the ratio of investment profits to more risks.The higher the Sharpe ratio, the better the portfolio. Through experimental verification, it is found (Table4) that when L=30, the equal weight method is the lowest (11), the TS-MIP model is in the middle ShR=0.5004, and the TS-RO model is the best ShR=0.5407. Compared with the equal weight method, the Sharpe value of the TS-RO model increased by 18.97%. In addition, in each model, as the time period increases L=30⟶L=60⟶L=90, the Sharpe ratio gradually increases. This law shows that long-term investment is due to short-term investment, which can provide decision-making suggestions for investors’ investment cycle planning.Table 4
Sharpe ratio under different time window lengths.
Period (L/DAY)30Increase60Increase90IncreaseEqual weight method0.351000.365400.37890TS-MIP model0.50040.14940.51370.14830.52450.1456TS-RO model0.54070.18970.55460.18920.57190.1930SoR is the standard for quantitatively dealing with the trade-off between the profit and risk of investment plans and the final selection of investment plans. Its calculation formula is as follows:(18)SoR=∑iRpi−riδiR,MARR,δiR,MARR=EminR−MARR,02,i∈I.Among them,Rpi is the profit rate of the investment portfolio, which is replaced by the average value of the profit rate of the investment plan obtained by the simulation. ri is the minimum profit required by investors of 2%. δiR,MARR is the risk that the actual rate of profit is lower than the average value, that is, the downside risk of the rate of profit, MARR is the lowest acceptable rate of profit, and MARR can be the risk-free rate or 0. The SoR is a measure that is more in line with investors who are more sensitive to the decline in asset value. The higher the ratio, the higher the profit rate by the fund if it bears the same unit of downside risk.The result verification in Table5 found that, taking L=60 as an example, the equal weight method is the lowest SoR=0.4758, the TS-MIP model is in the middle SoR=0.5012, and the TS-RO model is the best SoR=0.5578. Compared with the equal weight method, the SoR of the TS-RO model has an increase of 8.20%. In addition, in each model, as the time period grows L=30⟶L=60⟶L=90, the SoR is gradually increasing, further verifying the conclusions obtained by the Sharpe Ratio. It should be pointed out that risk is the uncertainty of the result. This uncertainty includes situations where the actual rate of profit is lower than expected and situations where the actual rate of profit is higher than expected. From the perspective of project investors, it is undoubtedly beneficial for the actual rate of profit to be higher than the expected value (i.e., average) when making investment decisions. This uncertainty brings unexpectedly high profits to investors. Therefore, we should not pay attention to these risks in the investment but should pay attention to the risk that the actual rate of profit is lower than the expected value of the investment decision.Table 5
SoR of the model under different time window lengths.
Period (L/DAY)30Increase60Increase90IncreaseEqual weight method0.451400.475800.49850TS-MIP model0.49040.03900.50120.02540.51760.0191TS-RO model0.53970.08830.55780.08200.58100.0825TrR is the ratio of the value of the fund’s profit rate exceeding the risk-free interest rate to the systemic risk. TrR measures the excess profit that the fund receives from the systemic risk of the unit. The larger the TrR, the higher the risk-adjusted profit. The TrR is based on the fact that nonsystematic risks have been completely diversified; that is, it is believed that the portfolio of assets held by the fund has fully diversified the risks of individual stocks or industries. TrR is suitable for evaluating nonsystematic risk of completely diversified funds, such as large-cap index funds.(19)TrR=∑iERp−Rfβpi,βpi=Covri,rmσm2,∀i∈I.The numerator of the Treynor ratio is still the excess profit of the asset portfolio,ERpi is the expected annualized profit of the portfolio, Rf is the annualized risk-free interest rate, and the denominator becomes systemic risk βpi. Its economic meaning is that every unit of systemic risk is assumed. For risk, ri represents the profit of a single stock, rm represents the market profit, and σm2 represents the variance of the market profit.As shown in Table6, through experimental verification, when L=90, the equal weight method is the lowest TrR=0.3985, the TS-MIP model is in the middle TrR=0.4367, and the TS-RO model is the best TrR=0.4719. Compared with the equal weight method, the TrR of the TS-RO model increased by 7.34%. In addition, in each model, as the time period increases L=30⟶L=60⟶L=90, TrR is gradually increasing, which further verifies the conclusions obtained by ShR and TrR. Regarding the excess profit the investment portfolio can get, the greater the value of the TrR, the stronger the ability of the fund manager. The TrR applies to a fully diversified investment portfolio, at which time nonsystematic risks have been completely diversified, and only systemic risks in the market are considered [43,44].Table 6
TheTrR of different models.
Period (L/Day)30Increase60Increase90IncreaseEqual weight method0.351400.375800.39850TS-MIP model0.41870.06730.42560.04980.43670.0382TS-RO model0.42600.07460.46350.08770.47190.0734


## 5.1. The Computational Efficiency of the Model

In the same computing environment and the same computing scale, this section analyzes the factors affecting the running time of the model. After fixing the relevant parameters, the investment cycle is the only variable. We divide the time period (L/DAY) into 30, 60, and 90 trading days and compare the differences in the running time of the model. The calculation results are shown in Table3. The analysis found that the length of the time period has a positive correlation with the calculation time; that is, the longer the time, the longer the calculation time of the model. Secondly, the calculation time of different models is slightly different. Among them, the calculation time of the equal-weight model is the shortest, the calculation time of the TS-MIP model is in the middle, and the calculation time of the TS-RO model is the longest. The increase in computing time reflects the increase in computing volume, which means that the computing volume and complexity of the TS-RO model are also the largest.Table 3
CPU calculation time of three models under different time windows.
Period (L/DAY)30 (s)60 (s)90 (s)Equal weight method1.9833.7818.093TS-MIP model2.0814.2347.781TS-RO model2.1454.6898.071


## 5.2. Autocorrelation Analysis

The long memory of financial securities asset profits refers to the significant autocorrelation of distant time intervals in the time series of profits; that is, historical events will continue to affect the future. Since stock securities data has obvious long memory, historical data information can be used to predict future profits and other related parameters. In this section, the parameters obtained are normalized, and the correlation effects can be compared more clearly. In this section, using the autocorrelation coefficient method, research and analysis found that the income of the industrial average index has significant long memory, as shown in Figures5 and 6. The autocorrelation function is a measure of correlation, that is, a measure of similarity, which is the correlation between the function and the function itself. When there are periodic components in the function, the maximum value of the autocorrelation function can well reflect this periodicity. Cross-correlation is the similarity between two functions. When both functions have the same periodic component, the maximum value can also reflect this periodic component. From the perspective of linear space, correlation operation is actually an inner product operation, and the inner product of two vectors in linear space represents the projection of one vector to another vector, indicating the similarity of the two vectors, so the correlation operation reflects this kind of similarity.Figure 5
Autocorrelation analysis (Stocks 1–5).Figure 6
Autocorrelation analysis (Stocks 6–10).From Figures5 and 6, we can find that the fluctuation of the curve tends to be flat. For the autocorrelation graph test, stationary series have short-term correlation. This property indicates that, for stationary series, only recent series values usually have a more obvious influence on the current value. The farther apart the past value, the smaller the influence on the current value. As the number of delay periods increases, the autocorrelation coefficient of a stationary series will decay relatively quickly to zero and fluctuate randomly around zero, while the autocorrelation coefficient of a nonstationary series decays slowly. This is the use of autocorrelation graphs, the standard for the stationarity test.


## 5.3. Influence of Safety Parameters

To ensure the unbiased and scientific nature of the experiment, the parameters are fixed. The model under the condition of deterministic information is the TS-MIP model. With the increase of security parameters, the parameters in the model such as rate of profit, diversity, skewness, information entropy, and CVaR are not affected. In the environment of uncertain risk preference, the model is the TS-RO model. The parameter diversity, skewness, and information entropy are not disturbed by uncertainty. Under the environment of uncertain risk appetite, the risk attitude of investment has changed. Here, through the method of robust optimization, the relevant risk preference range and boundary are constructed with the help of uncertain sets. The benefits of important parameters, CVaR, and total revenue are significantly affected by safety parameters.Figure7 describes the impact of security parameters on A: revenue and B: diversity. It can be seen from Figure 7 that, under deterministic information conditions, changes in security parameters will not have an impact on revenue and diversity. The figure shows that the influence curve of the TS-MIP model is a horizontal straight line. Of course, the deterministic TS-MIP model cannot cope with the problem of portfolio optimization under uncertain conditions. Under conditions of uncertain information, changes in security parameters have a positive impact on profits, but not on the diversity of investment portfolios. Specifically, as the level of security parameters increases, investors’ investment income also shows an increasing trend. That is, when the risk is controllable, the rate of profit on investment is higher, and the investment ratio is larger.Figure 7
Revenue and diversity in SP.Figure8 describes the impact of security parameters on C: skewness and D: information entropy.Figure 8
Information entropy and skewness in SP.It can be seen from Figure8 that, under deterministic information conditions, changes in security parameters will not have an impact on skewness and information entropy. The figure shows that the influence curve of the TS-MIP model is a horizontal straight line. Of course, the deterministic TS-MIP model cannot cope with the problem of portfolio optimization under uncertain conditions. Under uncertain conditions, changes in security parameters will not have an impact on skewness and information entropy. This shows that it is not the controllability of risk that affects investor confidence, but other deeper factors.Figure9 describes the impact of safety parameters on E : CVaR and F: total benefits. From the change trend of the curve in Figure 9, it can be found that, under certain information conditions, changes in safety parameters will not have an impact on CVaR and overall benefits. The figure shows that the influence curve of the TS-MIP model is a horizontal straight line. Under uncertain conditions, changes in safety parameters will have a significant impact on CVaR and overall benefits. As the security parameters increase, the risk of investment shows an increasing trend, which is often referred to as a robust price, which is the price paid to resist risks. But, at the same time, the increase in safety parameters also makes the overall benefit show an increasing trend, which can increase investors’ investment confidence when they choose investment.Figure 9
The impact of SP on CVaR and presidential benefits.


## 5.4. Testing the Effectiveness of the Portfolio

For comparison, three financial ratios are listed below to measure the pros and cons of stocks and securities. The Sharpe ratioShR is used to help investors understand the profit on investment related to their risk. Unlike the ShR, the Sortino ratio SoR is used to evaluate the excess profit of a portfolio given a downside risk. The Treynor ratio (TrR) represents a risk-adjusted profit based on systemic risk. Generally speaking, the greater the value of the Sharpe/Sortino/Treynor ratio, the greater the risk-adjusted profit, and the more attractive the risk-adjusted profit for rational investors.ShR is an indicator proposed by William to research and measure fund performance [42]. This indicator is not only a standardized indicator for fund performance evaluation, it has been successfully applied in many fields as well. The purpose of the ShR is to calculate how much excess profit will be generated per unit of total risk assumed by the portfolio. When all assets in the portfolio are risk assets, the Sharpe ratio applies. The formula for calculating the ShR is(17)ShR=∑iERpi−Rfσpi,i∈I.Among them,ERpi is the expected annualized profit of the investment portfolio, Rf is the annualized risk-free interest rate, and σpi is the standard deviation of the annualized profit of the investment portfolio. The Sharpe ratio represents how much excess profit investors can get for each additional risk point. If it is greater than 1, it means that the fund’s profit is higher than the volatility risk; if it is less than 1, it means that the operational risk of the fund is greater than the rate of profit.In this way, the Sharpe ratio of each investment portfolio can be calculated, that is, the ratio of investment profits to more risks.The higher the Sharpe ratio, the better the portfolio. Through experimental verification, it is found (Table4) that when L=30, the equal weight method is the lowest (11), the TS-MIP model is in the middle ShR=0.5004, and the TS-RO model is the best ShR=0.5407. Compared with the equal weight method, the Sharpe value of the TS-RO model increased by 18.97%. In addition, in each model, as the time period increases L=30⟶L=60⟶L=90, the Sharpe ratio gradually increases. This law shows that long-term investment is due to short-term investment, which can provide decision-making suggestions for investors’ investment cycle planning.Table 4
Sharpe ratio under different time window lengths.
Period (L/DAY)30Increase60Increase90IncreaseEqual weight method0.351000.365400.37890TS-MIP model0.50040.14940.51370.14830.52450.1456TS-RO model0.54070.18970.55460.18920.57190.1930SoR is the standard for quantitatively dealing with the trade-off between the profit and risk of investment plans and the final selection of investment plans. Its calculation formula is as follows:(18)SoR=∑iRpi−riδiR,MARR,δiR,MARR=EminR−MARR,02,i∈I.Among them,Rpi is the profit rate of the investment portfolio, which is replaced by the average value of the profit rate of the investment plan obtained by the simulation. ri is the minimum profit required by investors of 2%. δiR,MARR is the risk that the actual rate of profit is lower than the average value, that is, the downside risk of the rate of profit, MARR is the lowest acceptable rate of profit, and MARR can be the risk-free rate or 0. The SoR is a measure that is more in line with investors who are more sensitive to the decline in asset value. The higher the ratio, the higher the profit rate by the fund if it bears the same unit of downside risk.The result verification in Table5 found that, taking L=60 as an example, the equal weight method is the lowest SoR=0.4758, the TS-MIP model is in the middle SoR=0.5012, and the TS-RO model is the best SoR=0.5578. Compared with the equal weight method, the SoR of the TS-RO model has an increase of 8.20%. In addition, in each model, as the time period grows L=30⟶L=60⟶L=90, the SoR is gradually increasing, further verifying the conclusions obtained by the Sharpe Ratio. It should be pointed out that risk is the uncertainty of the result. This uncertainty includes situations where the actual rate of profit is lower than expected and situations where the actual rate of profit is higher than expected. From the perspective of project investors, it is undoubtedly beneficial for the actual rate of profit to be higher than the expected value (i.e., average) when making investment decisions. This uncertainty brings unexpectedly high profits to investors. Therefore, we should not pay attention to these risks in the investment but should pay attention to the risk that the actual rate of profit is lower than the expected value of the investment decision.Table 5
SoR of the model under different time window lengths.
Period (L/DAY)30Increase60Increase90IncreaseEqual weight method0.451400.475800.49850TS-MIP model0.49040.03900.50120.02540.51760.0191TS-RO model0.53970.08830.55780.08200.58100.0825TrR is the ratio of the value of the fund’s profit rate exceeding the risk-free interest rate to the systemic risk. TrR measures the excess profit that the fund receives from the systemic risk of the unit. The larger the TrR, the higher the risk-adjusted profit. The TrR is based on the fact that nonsystematic risks have been completely diversified; that is, it is believed that the portfolio of assets held by the fund has fully diversified the risks of individual stocks or industries. TrR is suitable for evaluating nonsystematic risk of completely diversified funds, such as large-cap index funds.(19)TrR=∑iERp−Rfβpi,βpi=Covri,rmσm2,∀i∈I.The numerator of the Treynor ratio is still the excess profit of the asset portfolio,ERpi is the expected annualized profit of the portfolio, Rf is the annualized risk-free interest rate, and the denominator becomes systemic risk βpi. Its economic meaning is that every unit of systemic risk is assumed. For risk, ri represents the profit of a single stock, rm represents the market profit, and σm2 represents the variance of the market profit.As shown in Table6, through experimental verification, when L=90, the equal weight method is the lowest TrR=0.3985, the TS-MIP model is in the middle TrR=0.4367, and the TS-RO model is the best TrR=0.4719. Compared with the equal weight method, the TrR of the TS-RO model increased by 7.34%. In addition, in each model, as the time period increases L=30⟶L=60⟶L=90, TrR is gradually increasing, which further verifies the conclusions obtained by ShR and TrR. Regarding the excess profit the investment portfolio can get, the greater the value of the TrR, the stronger the ability of the fund manager. The TrR applies to a fully diversified investment portfolio, at which time nonsystematic risks have been completely diversified, and only systemic risks in the market are considered [43,44].Table 6
TheTrR of different models.
Period (L/Day)30Increase60Increase90IncreaseEqual weight method0.351400.375800.39850TS-MIP model0.41870.06730.42560.04980.43670.0382TS-RO model0.42600.07460.46350.08770.47190.0734


## 6. Conclusion

Research on investment portfolio issues can provide investors with more robust investment plans, and the uncertainty in it is a key factor affecting investment performance. Aiming at the investment portfolio problem, this paper comprehensively considers the five dimensions of profit, diversity, skewness, information entropy, and conditional risk value and constructs a two-stage mixed integer programming (TS-MIP) model. However, the deterministic TS-MIP model cannot cope with the problem of uncertain information. Therefore, this paper constructs a two-stage robust optimization (TS-RO) model by introducing robust optimization theory.In terms of case experiments, this paper uses data crawler technology to obtain actual data from real websites for analysis and verifies the effectiveness of the proposed model in dealing with uncertain problems. The comparison of models found that, compared with the traditional equal weight model, the investment benefits of the TS-MIP model and the TS-RO model proposed in this paper have been improved. Among them, the Sharpe ratio, Sortino ratio, and Treynor ratio have the largest increase of 19.30%, 8.25%, and 7.34%, respectively. Combined with the results of empirical analysis, this paper analyzes the investment decisions of investors and puts forward some suggestions to investors.The content and contributions of this paper mainly include the following: first, in response to the uncertainty of the rate of profit, this paper uses historical data as the basis to predict the rate of profit and express the uncertainty scenario. Second, after the analysis of the mean-variance model, this paper uses the two-stage integer programming theory to establish a portfolio model that maximizes profits, minimizes risks, and considers both profits and risks. Third, the empirical analysis of the model using the data of 10 stock indexes in my country’s stock market shows that the model is feasible and effective, giving investment decision-makers a simple, clear, and intuitive guidance. Fourth, relevant suggestions are made to investors. Investors should strengthen their ability to obtain relevant information and be able to identify and analyze the information and then use relevant technologies to predict stock profits. Moreover, conservative, prudent, and aggressive investors must consider their own circumstances when investing and should not invest blindly.



---

*Source: 3087066-2021-12-07.xml*