# Portfolio Implementation Risk Management Using Evolutionary Multiobjective Optimization
## 2 Materials and Methods
### Proposed Approach
#### 2.2.1 General Framework  
SMS-EMOA is a hypervolume-based algorithm with a steady-state selection. It falls into a general framework of evolutionary algorithms, where, after a random initialization, a population of individuals is evolved by successively applying mating selection, variation and environmental selection procedures.  
The algorithm starts by randomly generating an initial populating of size \(N\). Each population member \(a_{i}\)\(i\in\{1,\ldots,N\}\) is characterized by the decision vector \(\mathbf{x}\in\mathbb{R}^{n}\), the objective vector \(\mathbf{f}\in\mathbb{R}^{m}\) and the robustness measure \(R\in\mathbb{R}\). Every portfolio \(\mathbf{w}\) is encoded by a vector of real numbers \(\mathbf{x}\in\mathbb{R}^{n}\) in which each variable represents the percentage of investment per asset. Since there is a set of constraints involved in selecting investment portfolios, each population member must satisfy these constraints in order to represent a feasible investment strategy. Therefore, each time a new individual is generated, it is then repaired to ensure its feasibility. Since the individual reparation procedure is complex, we present a simplified version of it in Algorithm 1.  
```
1:Input: \(\mathbf{x}=[x_{0}...x_{n}]\), \(C_{\text{min}}\), \(C_{\text{max}}\), \(l=[l_{0}...l_{n}]\), \(u=[u_{0}...u_{n}]\), \(\forall i\in\{1,\ldots,n\}\),
2:while\(\sum_{i}1_{x_{i}\
eq 0}<C_{\text{min}}\)do
3: randomly select \(i\) such that \(x_{i}=0\)
4:\(x_{i}\gets l_{i}\)
5:endwhile
6:while\(\sum_{i}1_{x_{i}\
eq 0}>C_{\text{max}}\)do
7: select the smallest \(x_{i}\
eq 0\) of the set
8:\(x_{i}\gets 0\)
9:endwhile
10:while\(\|\mathbf{x}\|_{1}\
eq 1\)do
11:while (\(\sum_{i}l_{i/x_{i}\
eq 0}>1\)) or (\(\sum_{i}u_{i/x_{i}\
eq 0}<1\))do
12:if\(\sum_{i}l_{i/x_{i}\
eq 0}>1\)then
13: randomly select \(i\) such that \(x_{i}\
eq 0\)
14:\(x_{i}\gets 0\)
15:endif
16:if\(\sum_{i}u_{i/x_{i}\
eq 0}<1\)then
17: randomly select \(i\) such that \(x_{i}=0\)
18:\(x_{i}\gets u_{i}\)
19:endif
20:endwhile
21:if\(\|\mathbf{x}\|_{1}\
eq 1\)then
22: randomly select \(i\) such that \(x_{i}\in[l_{i},u_{i}]\)
23: introduce \(\Delta x_{i}\) to make \(\|\mathbf{x}\|_{1}=1\)
24:endif
25:endwhile
26:Output: \(\mathbf{x}\)
```  
**Algorithm 1** Reparation  
The mating selection procedure selects two parents for producing an offspring. The selection can be performed in various ways. In the original study [15], two population members are picked uniformly at random from the current population. In this work, a binary tournament selection is used, based on the fitness values of population members, to provide a selection strategy in which fitter individuals have more chance for reproduction, thereby propagating useful characteristics among the population. The fitness assignment strategy, which is a crucial feature of the proposed approach, is described in detail later in this section. The variation procedure recombines two parents by the simulated binary crossover (SBX) [36] followed by applying the polynomial mutation [37]. Since the recombination results in a pair of offspring, one randomly selected offspring is discarded. After the evaluation, the offspring is added to the populating and the environmental selection procedure determines, on the basis of fitness values, which individuals must form the population of the next generation. This is done by removing an individual having the worst fitness value among the population.