Next Article in Journal
Fractional Calculus—Theory and Applications
Next Article in Special Issue
Three Hybrid Scatter Search Algorithms for Multi-Objective Job Shop Scheduling Problem
Previous Article in Journal
Algebraic Basis of the Algebra of All Symmetric Continuous Polynomials on the Cartesian Product of p-Spaces
Previous Article in Special Issue
Rough Approximation Operators on a Complete Orthomodular Lattice
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

SAIPO-TAIPO and Genetic Algorithms for Investment Portfolios

by
Juan Frausto Solis
*,
José L. Purata Aldaz
,
Manuel González del Angel
,
Javier González Barbosa
and
Guadalupe Castilla Valdez
Graduate Program Division, Tecnológico Nacional de México/Instituto Tecnológico de Ciudad Madero, Ciudad Madero 89440, Mexico
*
Author to whom correspondence should be addressed.
Axioms 2022, 11(2), 42; https://doi.org/10.3390/axioms11020042
Submission received: 1 December 2021 / Revised: 7 January 2022 / Accepted: 17 January 2022 / Published: 21 January 2022
(This article belongs to the Special Issue Softcomputing: Theories and Applications II)

Abstract

:
The classic model of Markowitz for designing investment portfolios is an optimization problem with two objectives: maximize returns and minimize risk. Various alternatives and improvements have been proposed by different authors, who have contributed to the theory of portfolio selection. One of the most important contributions is the Sharpe Ratio, which allows comparison of the expected return of portfolios. Another important concept for investors is diversification, measured through the average correlation. In this measure, a high correlation indicates a low level of diversification, while a low correlation represents a high degree of diversification. In this work, three algorithms developed to solve the portfolio problem are presented. These algorithms used the Sharpe Ratio as the main metric to solve the problem of the aforementioned two objectives into only one objective: maximization of the Sharpe Ratio. The first, GENPO, used a Genetic Algorithm (GA). In contrast, the second and third algorithms, SAIPO and TAIPO used Simulated Annealing and Threshold Accepting algorithms, respectively. We tested these algorithms using datasets taken from the Mexican Stock Exchange. The findings were compared with other mathematical models of related works, and obtained the best results with the proposed algorithms.

1. Introduction

In finance, applying the diversification of assets that make up an investment portfolio aims to maximize profits and minimize risk. The mean-variance portfolio integration model developed by Harry Markowitz in 1952 has been a widely accepted tool for asset portfolio integration [1]. Markowitz’s portfolio theory states that the investor should analyze the portfolio as a whole, studying the characteristics of risk and global return. The participation of each asset is chosen based on its expected return. In other words, volatility is treated as a risk factor, and the portfolio is integrated, considering the risks and seeking the maximum level of profitability available [2]. Some investigations have expanded the work of the Markowitz model, such as the mean semi-variance model [3], mean objective model [4], and portfolio optimization models with fuzzy logic [5]. Different metaheuristics algorithms have been applied to solve difficult problems, and recently important overviews have been published regarding these types of problems [6,7,8]. The reason for employing these algorithms is that they obtain suitable solutions within reasonable execution times [9]. For instance, a two-stage multi-attribute portfolio analysis framework using genetic algorithms (GA) to solve a multi-attribute portfolio selection problem was proposed [10]. Moreover, Genetic Algorithms have been used for selecting and evaluating investment portfolios [11]. As seen in [12], the mean-variance approach was used as a reference to propose a new model which included different constraints, using GA as an optimization method. Chen et al., applied machine learning algorithms to predict asset values of the Shanghai stock market; they used a GA to solve a multi-objective optimization problem [13]. Pekar et al., used differential evolution (DE) to solve the portfolio selection problem [14]; where they employed the Omega function and Sortino ratio to measure the portfolio’s risk based on the Sharpe Ratio. Presently, DE algorithms have been applied in several portfolio applications: Dow Jones [14], S&P, BOFA, Frank Russell, MSCI [15], and National Stock Exchange [16]. The use of DE combined with other methods has increased the quality of results [15,17]. Notably, in a previous study [15], the following algorithms were evaluated: NSGA-II, Differential Evolution (GDE3), SMPSO, and SPEA2; where SPEA and Differential Evolution were reported as the best algorithms. A modified Particle Swarm Optimization (PSO) method is used in different indexes such as S&P 100, Hang Seng, DAX 100, FTSE 100, and Nikkei [18]; the mathematical model includes bounding and cardinality constraints. A Firefly Algorithm (FA) and an Imperialist Competitive Algorithm (ICA) are used to select the best set of assets using the mean semi-variance approach as the objective function [19]. In [20] a hybrid algorithm was proposed that combines Ant Colony Optimization (ACO), Artificial Bee Colony (ABC) optimization, and GA for solving the cardinality constrained portfolio optimization problem.
Different classical and hybrid methods or techniques for portfolio integration have been applied, such as Threshold Accepting (TA) and Simulated Annealing (SA). TA was used to select sets of assets that minimized portfolio risks [21,22] and optimized tracking errors [23]. Chang et al., [24] attempted to find the efficient frontier by using GA, TA, and SA over several stock markets (DAX, FTSE, S&P, and Nikkei). Fogarasi and Levendovszky [25] explored a solution to sparse mean reverting portfolio selection using a Greedy method and an SA algorithm. In [26], the following algorithms were used: GA, Genetic network programming (GNP), SA, and PSO. In [27], the quality of SA and GA in rectifying this problem was performed by adding an aversion risk coefficient to the Markowitz model. The results were similar; however, SA obtained shorter runtimes. Wang et al., used a modified Generalized Simulated Annealing GSA and the Sharpe Ratio to construct optimal portfolios; they used stocks from S&P 500 [28]. A High-Speed Hill-Climbing algorithm, called HC-S-R, was proposed for the DAX stock exchange in [29]; where they applied a similar acceptance criterion to TA and reported better results than the classical algorithm. In [30], the Archive Multi-objective Simulated Annealing (AMOSA) was used to solve the two objectives of the mean-variance model with eight stock indexes that included NASDAQ, S&P 500, FTSE 100, and Hang Seng. In [31], a hybrid FA–SA algorithm was proposed; the experimental results showed this algorithm performed better than FA, SA, GA, and PSO when the transaction costs were considered. Kumar et al., applied a modified SA combined with ABC, Radial Basis Function Network (RBFN), and an Artificial Neural Network (ANN); where they integrated portfolios with stocks from NSE [32]. SA, GA, and Quantum Annealing was applied in [33], with stocks from S&P 500, Nasdaq, Russel 2000, and Wilshire 5000.
The algorithms GENPO, SAIPO, and TAIPO proposed in this work are based on the Genetic Algorithm (GA), Simulated Annealing (SA), and Threshold Accepting (TA). These proposed algorithms use the closing prices of the assets to calculate the indicators to obtain the Sharpe Ratio (SR) [34] value of the portfolio, which is used as an evaluation function in the search process of the algorithms. The algorithms used are focused on portfolio integration and aimed at both diversification of assets and minimization of portfolio risks; this was achieved through the model proposed by Sharpe [35] and is standard in using the correlation between candidate assets [36,37]. In addition, a constraint was used that allowed for the consideration of only the assets that had an expected return equal to or greater than the Minimum Acceptable Rate of Return (MARR). To test the proposed algorithms, assets from the Mexican Stock Exchange were used, then results were compared with the hybrid algorithms developed by the mathematical models of related works.
The rest of this paper is organized as follows. In Section 2, we review the related models, including the Markowitz model. Moreover, we describe the classical Simulated Annealing, Threshold Accepting, and Genetic Algorithms. In Section 3, the algorithms proposed in this work are described. In Section 4, we present the experiments and results. Finally, in Section 5, the conclusions of this work are presented.

2. Background & Related Works

As we mentioned before, this work proposes the use of classical algorithms GA, TA, and SA. We present a general description of these algorithms in the first subsection. Moreover, new successful models are usually based on the Markowitz model; they are referred to here as Yu, Gilli, and Masese models. Then, we briefly present all these models in the Related Works subsection.

2.1. Classical Genetic and Simulated Annealing like Algorithms

2.1.1. Genetic Algorithms

John Holland proposed Genetic Algorithms (GA) in 1975 [38]. These algorithms imitate nature for solving complex problems [39,40,41]. They select solutions from the solution space of the problems considered. Basically, a GA evolves a population of individuals (solutions) by selecting operations similar to those in biological evolution (for instance, mutation and crossing over). The procedure of the Classic GA is shown in Algorithm 1.
Algorithm 1. Classic Genetic Algorithm
1:Set first gen i = 0
2:Begin /* Produce new generation */
3:Begin /* Reproductive cycle */
4:  Select two individuals, X1 y X2 of P(i),
5:  Crossing point random selection.
6:  Cross X1 y X2 getting two offspring Xh1, Xh2.
7:  Insertion Xh1 y Xh2 in P(i)
8:  Mutation random τ elements of P(i);
9:  Compute fitness function (i) of τ elements,
10:  Order individuals best evaluated in P(i).
11:  Limit the population to its original size.
12:End
13:IF convergence = true or gen = max generation
14:End

2.1.2. Simulated Annealing and Threshold Accepting

Proposed by Kirkpatrick in the 1980s [42], the Simulated Annealing (SA) algorithm is based on the Metropolis algorithm [43], which is used in the heat treatment of metals. SA begins with an initial solution; then, a neighbor solution is selected randomly. A new solution is accepted if it is better than the old solution; otherwise, the new solution is accepted with a probability based on the Boltzmann distribution; with this criterion, the acceptance rate of incorrect solutions decreases during the execution of the algorithm. This strategy is used to escape from local optima. The parameters of this algorithm include an initial temperature T i , final temperature T f , cooling rate α , and the number of iterations for each metropolis cycle, as shown in Algorithm 2.
Algorithm 2. Classic Simulated Annealing
1:Simulated Annealing ( T i , T f , α )
2:   T k = T i
3:   s c u r r e n t = r a n d o m   i n i t i a l   s o l u t i o n
4:   while  T k T f  do
5:    while M e t r o p o l i s   l e n g h t  do
6:       s n e w = g e n e r a t e N e i g h b o r   ( s c u r r e n t )
7:       Δ = E ( s n e w ) E ( s c u r r e n t )
8:       if  Δ < 0  then
9:          s c u r r e n t = s n e w
10:      else if e Δ T k < r a n d o m ( 0 , 1 )  then
11:          s c u r r e n t = s n e w
12:       end if
13:      end while
14:      T k = α T k
15:   end while
16:end Simulated Annealing
The Threshold Accepting (TA) algorithm was proposed by Dueck and Scheuer [44] and is similar to Simulated Annealing. The fundamental difference is the acceptance criterion of new solutions. In TA, a poor solution can be accepted if the decrease does not exceed a certain tolerance or threshold, which decreases during the execution of the algorithm. This criterion avoids calculating probabilities or making random decisions. The parameters of this algorithm are the number of iterations n i t e r , number of steps n s t e p s , and a threshold sequence, as shown in Algorithm 3. Both SA and TA algorithms have been applied to successfully solve different problems [45,46].
Algorithm 3. Classic Threshold Accepting
1:Initialize n i t e r and n s t e p s
2:Compute Threshold Sequence T r ,   r = 1 , 2 , n i t e r
3:Generate random initial solution   X c X
4:for  r = 1 to n i t e r  do
5:   for  i = 1 to n s t e p s  do
6:     Generate X n   N ( X c )
7:     Δ = f ( X n ) f ( X c )
8:     if  Δ < T r    then
9:       X c = X n
10:     end if
11:   end for
12:end for
The process of parameter tuning for the SA and TA algorithms used in this paper is based on the analytical tuning method presented in [47]. This method states that the initial and final temperatures are functions of the maximum and minimum cost or energy values E m a x and E m i n . These values are used in the Boltzmann distribution criterion, which establishes that, in a temperature T, a poor solution is accepted if r a n d o m ( 0 ,   1 ) e Δ E T . The values Δ E m a x and Δ E m i n are used in the Boltzmann distribution for determining the initial and final temperatures. To obtain these values, a set of previous executions must be carried out [46]. The parameters used in the tuning process are shown in Table 1.
The probability of accepting a new solution is close to one at high temperatures, thus the deterioration of the energy is at a maximum. T i is associated with Δ E m a x and P ( Δ E m a x ) , and can be calculated with Equation (1), while P ( Δ E m a x ) is given by Equation (2). The minimum deterioration P ( Δ E m i n   ) , calculated with Equation (3), is used to establish T f , as shown in Equation (4).
The cooling scheme establishes the method behind decreases in temperature using a factor α . For rapid decrements, an α value equal to 0.7 is commonly used, and for slow decrements, the figure is 0.99 [46]. Given a current temperature T k , the next temperature value T k + 1 is calculated with Equation (5).
The parameter L k , refers to the number of iterations of the Metropolis cycle at each temperature. In high temperatures, few iterations are required, since the equilibrium is reached quickly; for this reason, L m i n is usually close to one. Nevertheless, at low temperatures, a more exhaustive search is required; therefore, a larger L k is used. For a given value of L k , then L k + 1 can be calculated with Equation (6). Since Equations (5) and (6) are applied successively from T i to T f , L m a x is calculated as L m a x = β n L m i n , while T f = α n T i , where n and β are calculated with Equations (7) and (8), respectively [48].
On the other hand, the probability of selecting the solution s j from N random samples in V S i is given by Equation (9); for this expression, N is calculated with Equation (10), where C defines the exploration level calculated with Equation (11). To guarantee a good exploration level, the value of C must be between 1 C 4.6 . Finally, once C is defined, L m a x can be established with Equation (12).

2.2. Related Works

2.2.1. Markowitz Model

A typical feature of Markowitz’s theory is that it provides a quantitative solution to portfolio asset allocation, as it considers the possible trade-off between expected return and risk exposure between established securities or assets. Thus, the investment portfolio design problem is a multi-objective optimization issue with two main objectives [1]: maximize the expected return, and minimize the variance of the portfolio models with Equations (13) and (14), respectively. This model uses a mean-risk relationship, which is known as the mean-variance approach.
M a x   E ( R ) = i = 1 n μ i x i
M i n   σ 2 ( R ) = i = 1 n j = 1 n x i   x j σ i j
Subject to :
i = 1 n x i = 1
x i   0 ( i = 1 , , n )
where E ( R ) is the expected return of the portfolio; μ i is the expected return of asset i ; x i is the fraction or weight of asset i in the portfolio, this weight must be positive (Equation (16)), in addition, the sum of all weights must be equal to one as shown in Equation (15); n is the number of assets in the portfolio; σ 2 ( R ) is the variance of the portfolio; σ i j is the covariance between asset i and j .

2.2.2. Yu Model

A genetic algorithm (GA) was proposed [10] for a two-stage multi-attribute portfolio analysis framework to solve the portfolio selection problem. First, a GA is used for evaluating asset quality with multiple asset attributes, and some are selected. Then, another GA is used to optimize capital allocation among the selected assets in the second stage. Finally, the fitness function F ( R ) is used to make a rational trade-off between minimizing risk and maximizing expected return, as shown in Equation (17).
min F ( R ) = i = 1 n j = 1 n x i   x j σ i j + ( i = 1 n μ i x i γ ) 2
where xi, xj are the portion of the stocks i, j integrating the portfolio, and σ i j ; is the covariance of them. Moreover,   μ i is the mean of the stock value and i = 1 n μ i x i is the expected return of the portfolio. Finally, γ represents the MARR.
In another section, we present the results obtained with this model.

2.2.3. Gilli Model

This model uses a single-objective minimization approach based on the classical Markowitz model. The Gilli model seeks to create optimal portfolios in terms of variance and expected return [21]. The mathematical model is shown in Equations (18) and (19).
min F ( R ) = σ 2 ( R ) + p ( γ E ( R ) )
p = { σ 2 ( R ) m a x     σ 2 ( R ) m i n γ R ¯ 0 w h e n     γ > E ( R ) Otherwise
where, the variables σ 2 ( R ) and E ( R ) denote the variance and the expected return of the portfolio, respectively, while p is a penalty function. The values for σ 2 ( R )   m a x , σ 2 ( R )   m i n are the maximum and minimum variance, and R ¯ is an average of the expected return value of numerous randomly generated portfolios. While γ is the required return and has been pre-defined. These parameters are used for defining the scaling constant p . The problem in this model is to define this scaling constant for achieving the best portfolios. Therefore, this model uses the scaling constant for achieving optimal portfolios.

2.2.4. Masese Model

This model is similar to the classical formulation of Markowitz for investment portfolios, and is an optimization problem defined by Equation (20). This model aims to minimize the variance of the portfolio [22]; they use the classical Threshold Accepting algorithm [44].
M i n     σ 2 ( R ) = i = 1 n j = 1 n x i   x j σ i j
Subject   to
x i i n f   x i   x i s u p
n i n f n s u p
where x i i n f and x i s u p , shown in Equation (21), are the minimum and maximum weights for the stock in the portfolio, and n i n f and n s u p in Equation (22), are the constraints setting the minimum and a maximum number of stocks in the portfolio. The authors of this paper reported that their model outperforms the Markowitz Model for portfolio selection.

3. Proposed Algorithms

The three algorithms proposed in this work, GENPO [49], SAIPO, and TAIPO, are described in this section. These algorithms use optimization heuristics for obtaining the stocks and then integrating the portfolio that is modeled as an optimization problem. GENPO uses a Genetic Algorithm, SAIPO uses a Simulated Annealing Algorithm, and TAIPO uses a Threshold Accepting Algorithm.

3.1. Mathematical Model for the Evaluation Function

The Sharpe Ratio (SR) is a financial metric proposed by W. Sharpe [34]. This financial ratio indicates how suitable an investment is concerning its risk. This ratio can be used to determine which investment obtains the greatest return with the same risk. In other words, it determines the additional return achieved by investing in riskier financial assets. SR is calculated with Equation (23).
S R = E ( R ) γ σ ( R )
where E ( R ) is the portfolio’s expected return, γ is the MARR (Minimum Acceptable Rate of Return), and σ ( R ) represents the portfolio’s risk. The MARR parameter means that any stock (or investment) should not be part of the portfolio if it does not surpass it.
Sharpe Ratio (SR) is based on the Markowitz model, and it is assumed that there are adequate statistics for determining: (a) the expected value of the shares and (b) the standard deviation (the risk measure) of the asset value over a given period. On the other hand, the problem of selecting the best stocks from a specific market can be formulated as those that maximize the expected return and, at the same time, minimize the risk value of the portfolio; a practical alternative centers on finding stocks which maximize the Sharpe ratio. This strategy allows the discovery of portfolios with assets from different financial areas selected when the SR is maximized.
The proposed model represented by Equation (24) seeks to maximize the Sharpe Ratio, subject to the expected value of the portfolio being greater or equal to the MARR ratio.
max S R = E ( R ) γ i = 1 n σ i 2 x i 2 + 2 i = 1 n j i n σ i σ j x i x j ρ i j
Subject to
μ i γ
where E ( R ) = μ i x i is the expected return of the portfolio, μ i is the expected return of asset i , and x i is the weight of the asset i in the portfolio. This model includes a constraint shown in Equation (25), that allows only assets with an expected return equal to or greater than the MARR to be included in the portfolio. The MARR parameter is represented here by γ. As mentioned before [49], maximizing the value of the Sharpe Ratio allows solving the problem of two objectives in one. However, it is an NP-hard problem; thus, finding the optimal solution is not an easy task. We used Equation (26) to estimate the risk of the portfolio, while the average correlation of the portfolio was obtained with a simple process [37]. This correlation is provided in Equation (27), and we used it to check that the correlation of the entire portfolio had a low value. In [50], the correlation between assets and bonds was analyzed. Similarly, a previous study [37] used a strategy to evaluate portfolios and risks from different portfolios.
σ ( R ) = i = 1 n σ i 2 x i 2 + 2 i = 1 n j i n σ i σ j x i x j ρ i j  
| ρ ¯ p | = σ 2 ( R ) i = 1 n σ i 2 x i 2 2 i = 1 n j i n σ i σ j x i x j
The interpretation of Equation (27) is as follows: if | ρ ¯ p | 1 the portfolio has little diversification; on the other hand, if | ρ ¯ p | 0 the portfolio is highly diversified.
The portfolio solution found with the model implemented in this paper, contained the weighted values of the assets x i ; the expected value portfolio’s E ( R ) and its risk σ ( R ) , in addition to the Sharpe Ratio and average correlation of the portfolio | ρ ¯ p | . This model and the implemented algorithms aim to find a balance between the expected value and the portfolio’s risk. Moreover, the implemented algorithms seek to find an equilibrium between the Sharpe metric and the managing portfolio risk.

3.2. Genetic Portfolio Optimization Algorithm (GENPO)

Algorithm 4 shows the structure of the GENPO algorithm. This is a Genetic Algorithm where the initial population is conformed randomly by a set of weights in the range (0,1); additionally, the summation of these weights should be one. The fitness function was previously shown in Equation (24), and is applied for each population generated by the algorithm. Then, the subsequent generations are generated, choosing one or two solutions, depending on the genetic operator used: crossover or mutation, respectively.
Algorithm 4. GENPO
1:Begin /* GENPO */
2: Set first gen i = 0
3: Generate initial population (portfolio) P ( i )
4: Compute Sharpe Ratio (SR) evaluation initial for each individual SR(i)
5:While Converge = False or i < MaxGen do
6:Begin /* Produce new generation */
7:  Begin /* Reproductive cycle */
8:   Select two individuals (portfolios), X1 y X2 of P(i),
9:   Crossing point random selection.
10:   Cross X1 y X2 getting two offspring Xh1, Xh2.
11:   Insertion Xh1 y Xh2 in P(i)
12:   Mutation random τ elements of P(i);
13:   Compute fitness function (i) of τ elements,
14:   Order individuals best evaluated in P(i).
15:   Limit the population to its original size.
16:  End
17:  Save best individual of the population P(i)
18:  If SR(i + 1) < SR(i) + tolerance then //* if SR doesn’t grow enough *//
19:   gamma = gamma + 1     //* gamma counter grow *//
20:  If gamma >= conv then //*conv=generations number without improv SR *//
21   Convergence=TRUE
22:End
23:End while
24:  i = i + 1
25:If i > MaxGen then
26:Converge: = TRUE
27:End
From lines 1 to 5, a population is generated using a random number in the range (0,1).
The fitness Sharpe Ratio (SR) is the fitness function based on Sharpe Ratio described in Equation (24). Moreover, it establishes the population size and the generations.
Lines 6 to 16 integrate the selection step. Two individuals from the population are evaluated by the fitness function and two individuals from the binary tournament, evaluating from the higher expected value.
In the Crossover step, the x i values (the portion of assets) are randomly selected to generate offspring from the selected individuals in the previous step. These offspring could be part of the population depending on their SR. They are sorted from highest to lowest. The last two individuals are discarded from the population to retain the population size. From line 17 to the end, lays up the best individual from each generation to store their variables and performance.
The best individual from generation i is compared with the previous individuals of generation i − 1. The process is repeated each time a new population is generated. This process is performed to determine if the number of generations achieves the maximum permitted number without enhancement, which is used as a stop criterion.
The result of the algorithm is a portfolio with the best assets and the investment proportion applied in each one. This combination of assets has the best profit–risk ratio and the lowest correlation, leading to the highest portfolio diversification.

3.3. Simulated Annealing for Investment Portfolio Optimization (SAIPO)

The SAIPO algorithm uses the negative value of the Sharpe Ratio, shown in Equation (24), as the objective function.
SAIPO (Algorithm 5) receives as initial parameters (line 1) an initial temperature ( T i ), final temperature ( T f ), a cooling rate α , an internal cycle length L k , and an internal cycle increment coefficient β . In line 2, a random initial solution is generated, represented by X c , defined as a portfolio with random weights. Then, in line 3, the negative value of the Sharpe Ratio is calculated. In line 4, the current temperature T k takes the value of the initial temperature T i . In line 5, the main cycle begins, which is executed until the current temperature is greater than or equal to the final temperature. In line 6, the Metropolis cycle begins. In line 7, a new solution is generated by applying a perturbation to the current solution. This new solution is compared with the existing solution, then calculating the difference between both solutions in line 8. When this difference is negative (line 9), the new solution is accepted in line 10; if this new solution is better than the best previously found, it is accepted as the best global solution in line 12. Alternatively, if the difference is greater or equal to zero, the new solution is accepted by applying the Boltzmann acceptance criterion in line 14. In line 19, the number of iterations of the Metropolis cycle ( L k ) increases, multiplying its previous value by β . In line 20, the current temperature T k is decreased by multiplying its value by the α value. Finally, in line 22, the Sharpe Ratio is calculated by multiplying its negative value by −1. Lastly, in line 23, the output of the algorithm is generated.
Algorithm 5. SAIPO
1:Parameters ( T i ,   T f ,   α ,   L k ,   β )  
2:    Generate random initial solution X c = X b e s t
3:    s c = f ( X n ) = S R n e g = s b e s t
4:    k = 0 ;   T i = T k
5:   while T k T f do
6:     while  k < L k  do
7:        X n = P e r t u r b a t i o n   ( X c ) ; s n = f ( X n )
8:        Δ = s n s c  
9:        if Δ < 0  then
10:          s c = s n ; X c = X n
11:         if  s c < s b e s t  then
12:             s b e s t =   s c ; X b e s t = X c
13:          end if
14:        else if random (0,1) < e Δ / T k    then
15:          s c = s n ; X c = X n
16:        end if
17:        k = k + 1
18:      end while
19:      L k + 1 = β L k
20:      T k + 1 = α T k
21:    end while
22:    S R = s b e s t
23:    return  S R ,   X b e s t
24:end SAIPO
Based on the neighborhood structure method presented in [23], in this work, a perturbation is applied to generate a neighbor solution X n close to the current solution X c . This procedure is detailed in Algorithm 6.
Algorithm 6. Perturbation Procedure
1:Parameters ( q ,   X c )
2:   Select two assets i and j randomly
3:   If  w i q  then
4:      w i = w i q
5:   else if    w i < q  then
6:      q = w i
7:      w i = 0
8:    end if
9:    w j = w j + q
10:    X n ( w i ,   w j )
In line 2, two assets i and j with weights w i and w j are randomly selected. Then, a quantity q is subtracted from asset i in line 4, and the same quantity is added to asset j in line 9. Therefore, the weight of asset i in the portfolio, when the neighbor solution is generated, will be w i q , and the weight of asset j will be w j + q . This quantity q is obtained by experimentation.

3.4. Threshold Accepting for Investment Portfolio Optimization (TAIPO)

Algorithm 7 shows the TAIPO algorithm that shares the same structure as SAIPO. These two algorithms have a temperature cycle and a Metropolis cycle. TAIPO has an additional parameter in line 1: a decreasing tolerance rate δ . As in SAIPO, in the TAIPO algorithm, a perturbation is applied to the current solution to generate a new solution in line 7. However, in this algorithm, if the new solution is worse, the current solution is replaced if the difference does not exceed a certain tolerance (Tol) or threshold (line 9), which decreases by multiplying its previous value by δ in line 17. In the beginning, Tol has a value equal to T k (line 4), which implies that at high temperatures, the new solution will be generally accepted as the current solution. That is, during the processing of 90% of temperatures, Tol has the same value of T k ; in this case, δ is equal to 1. For the remaining temperatures, δ takes the value of 0.96, obtained by experimentation, making the process more restrictive in the last iterations [46].
Algorithm 7. TAIPO
1:Parameters ( T i ,   T f ,   α ,   L k ,   β ,   δ )  
2:   Generate random initial solution X c = X b e s t
3:    s c = f ( X n ) = S R n e g = s b e s t
4:    k = 0 ;   T o l k = T i = T k
5:   while  T k T f   do
6:     while  k < L k do
7:        X n = P e r t u r b a t i o n   ( X c ) ;   s n = f ( X n )
8:        Δ = s n s c
9:        if  Δ < T o l k  then
10:           S c = S n ; X c = X n
11:          if  s c < s b e s t  then
12:             s b e s t =   s c ; X b e s t = X c
13:           end if
14:        end if
15:        k = k + 1
16:      end while
17:      T o l k + 1 = δ T o l k
18:      L k + 1 = β L k
19:      T k + 1 = α T k
20:   end while
21:   SR = − s b e s t
22:   return SR, X b e s t
23:end TAIPO
In this work, we used the classic TA algorithm and compared its performance with the algorithms proposed. As described in Algorithm 3, TA used a threshold sequence. The procedure shown in Algorithm 8, which is based on the method proposed in [23], was used to generate this sequence.
Algorithm 8. Generation of Threshold Sequence
1:Initialize n i t e r
2:for i = 1 to n i t e r  do
3:    G e n e r a t e   r a n d o m   s o l u t i o n   X c
4:    X n = P e r t u r b a t i o n   ( X c ) // Generate neighbor solution
5:    C o m p u t e   Δ i = | f ( X n ) f ( X c ) |
6:end for
7:Sort Δ 1     Δ 2     Δ 3     Δ i and use as Threshold Sequence
In line 1, the size of the sequence is declared, which will be equal to the number of iterations of the TA classic algorithm. In line 3, a random solution is generated, then in line 4, a neighbor solution is generated, applying the perturbation described in Algorithm 6. In line 5, the difference between the new solution and the current solution is calculated. This process is repeated until the given number of iterations is generated. Finally, these differences are ordered from highest to lowest in line 7.

3.5. Proposed Algorithms Hybridized with Related Models

The Sharpe Ratio (Equation (24)) is regularly used as the objective function of GENPO, SAIPO, and TAIPO. To compare the performance of the algorithms proposed in this work with the related works described previously, we developed three hybrid algorithms using the last algorithm but replaced the objective function with that used by the reference models of Gilli, Yu, and Masese. These three hybrid algorithms are named: GENPO-X, SAIPO-X, and TAIPO-X, where X is the name of a reference model.

Hybrid Pseudocodes

The SAIPO Hybrid Algorithm shown in Algorithm 9 has a similar structure to the single SAIPO of Algorithm 5. In the beginning, the initial parameters are specified in line 1. Then, the objective function is defined in line 2. There are three alternatives or different models. Used in line 3 is the model presented in [10], the Yu model, shown in Equation (17). On the other hand, to use the Gilli model [21] calculated with Equation (18), it is necessary to compute the penalty p , established with Equation (19). This process is shown in lines 4–8. Finally, the function of the Masese model [22], calculated with Equation (20), is presented in line 10.
After selecting the model, a random feasible solution is generated in line 11. Then, the temperature cycle begins in line 13, and the Metropolis cycle begins in line 14. The Sharpe ratio is calculated at the end of the algorithm (lines 29–30). The rest of the process and parameters are similar to SAIPO.
Algorithm 9. SAIPO Hybrid Algorithm
1:Parameters ( T i ,   T f ,   α ,   L k ,   β )  
2:   Define objective function  f ( X )
3:   if  f ( X ) = Y u   m o d e l   then f ( X ) = σ 2 ( R ) ( ( E ( R ) γ 2 )  end if //Objective function for Yu model
4:   else if   f ( X ) = G i l l i   m o d e l   then
5:       G e n e r a t e   1000   r a n d o m   p o r t f o l i o s   a n d   c o m p u t e   σ 2 ( R ) m a x   ;   σ 2 ( R ) m i n   ;   R ¯
6:      if  γ > E ( R )   then p = σ 2 ( R ) m a x σ 2 ( R ) m i n γ R ¯  end if
7:      else  p = 0
8:       f ( X ) = σ 2 ( R ) + p ( γ E ( R ) )          //Objective function for Gilli model
9:   end if
10:   else if  f ( X ) = M a s e s e   m o d e l   then f ( X ) = σ 2 ( R )  end if //Objective function for Masese model
11:   Generate a random feasible solution X c
12:    s c = s b e s t = f ( X c ) ; k = 0 ;   X c = X b e s t ;   T k = T i   .
13:   while  T k T f   do
14:      while  k < L k  do
15:          X n = P e r t u r b a t i o n   ( X c ) ; s n = f ( X n )
16:          Δ = s n s c   ; r = random (0,1)
17:         if  Δ < 0 . then
18:             s c = s n ; X c = X n
19:            if  s c > s b e s t  then s b e s t =   s c ; X b e s t = X c  end if
20:         else if r < e ^ ( Δ / T k )    then
21:             s c = s n ; X c = X n
22:          end if
23:          k = k + 1
24:      end while
25:       L k + 1 = β L k ;
26:       T k + 1 = α T k
27:   end while
28:    S R u p = E ( R ) γ ; S R d o w n = σ ( R )
29:    S R = S R u p / S R d o w n
30:   return   s b e s t , X b e s t , SR
31:end SAIPO Hybrid Algorithm
Algorithm 10, TAIPO Hybrid Algorithm, is similar to the SAIPO Hybrid Algorithm, changing the new solutions acceptance criterion, as shown in line 16.
Algorithm 10. TAIPO Hybrid Algorithm
1:Parameters ( T i ,   T f ,   α ,   L k ,   β ,   δ )  
2:   Define objective function  f ( X )
3:   if  f ( X ) = Y u   m o d e l   then f ( X ) = σ 2 ( R ) ( ( E ( R ) γ 2 )  end if //Objective function for Yu model
4:   else if f ( X ) = G i l l i   m o d e l   then
5:       G e n e r a t e   1000   r a n d o m   p o r t f o l i o s   a n d   c o m p u t e   σ 2 ( R ) m a x   ;   σ 2 ( R ) m i n   ;   R ¯
6:      if  γ > E ( R )   then p = σ 2 ( R ) m a x σ 2 ( R ) m i n γ R ¯  end if
7:      else  p = 0
8:    f ( X ) = σ 2 ( R ) + p ( γ E ( R ) ) //Objective function for Gilli model
9:   end if
10:   else if  f ( X ) = M a s e s e   m o d e l   then f ( X ) = σ 2 ( R )  end if //Objective function for Masese model
11:   Generate a random feasible solution X c
12:    s c = s b e s t = f ( X c ) ; k = 0 ;   T o l k = T k ;   X c = X b e s t ;   T k = T i  
13:   while  T k T f   do
14:      while  k < L k  do
15:          X n = P e r t u r b a t i o n   ( X c ) ;   s n = f ( X n ) ; Δ = s n s c
16:         if  Δ < T o l k  then s c = s n ; X c = X n
17:            if  s c < s b e s t  then s b e s t =   s c ; X b e s t = X c end if
18:         end if
19:          k = k + 1
20:      end while
21:       T o l k + 1 = δ T o l k
22:       L k + 1 = β L k
23:       T k + 1 = α T k
24:   end while
25:    S R u p = E ( R ) γ ; S R d o w n = σ ( R )
26:    S R = S R u p / S R d o w n
27:   return s b e s t , X b e s t , SR
28:end TAIPO Hybrid Algorithm
Algorithm 11 illustrates the procedure of the GENPO Hybrid Algorithm. As with TAIPO and SAIPO hybrid algorithms, the fitness function is defined in line 4. In line 6, the Yu model is used as presented in [10], computed with Equation (17). On the other hand, the process behind the Gilli model [21] shown in Equations (18) and (19) is described in lines 9–14. Finally, the function of the Masese model [22], shown in Equation (20), is presented in lines 15–17. The remainder of the process is the same as in the GENPO algorithm.
Algorithm 11. GENPO Hybrid Algorithm
1:Begin /* GenPO */
2: Set first gen i = 0
3: Generate initial population (portfolio) P ( i )
4:Define objective function  f ( X )
5:if  f ( X ) = Y u   m o d e l   then
6:   f ( X ) = σ 2 ( R ) ( ( E ( R ) γ 2 )
7:end if //Objective function for Yu model
8:else if f ( X ) = G i l l i   m o d e l   then
9: G e n e r a t e   1000   r a n d o m   p o r t f o l i o s   a n d   c o m p u t e   σ 2 ( R ) m a x   ;   σ 2 ( R ) m i n   ;   R ¯
10:  if  γ > E ( R )   then
11:    p = σ 2 ( R ) m a x σ 2 ( R ) m i n γ R ¯  end if
12:  else  p = 0
13:     f ( X ) = σ 2 ( R ) + p ( γ E ( R ) ) //Objective function for Gilli model
14:end if //Objective function for Gilli model.
15:else if  f ( X ) = M a s e s e   m o d e l   then
16:   f ( X ) = σ 2 ( R )
17:end if //Objective function for Masese model
18:While Converge = False or i<MaxGen do
19:Begin /* Produce new generation */
20:  Begin /* Reproductive cycle */
21    Select two individuals (portfolios), X1 y X2 of P(i),
22:    Crossing point random selection.
23:    Cross X1 y X2 getting two offspring Xh1, Xh2.
24:    Insertion Xh1 y Xh2 in P(i)
25:    Mutation random τ elements of P(i);
26:    Compute fitness function (i) of τ elements,
27:    Order individuals best evaluated in P(i).
28:    Limit the population to its original size.
29:   End
30:   Save best individual of the population P(i)
31:   If  f ( X ) (i + 1) < f ( X ) (i) + tolerance then //* if SR doesn´t grow enough *//
32:      gamma = gamma + 1     //* gamma counter grow *//
33:   If gamma >= conv then //* conv = generations number without improv SR *//
34:     Convergence = TRUE
35:  End
36:End while
37: i = i + 1
38:If i>MaxGen then
39:Converge: = TRUE
40:End

4. Results

The experiments performed with the algorithms presented in this paper, and the comparison with the hybrid algorithms described previously are shown in this section. To perform analytical tuning for SAIPO and TAIPO algorithms, some previous executions were required. Moreover, we showed the parameters used for those executions in Table 2.

4.1. Experiments

To test all algorithms, we used a dataset with 47 stocks taken from the Mexican Stock Exchange. The period evaluated was from 1 January 2017 to 30 June 2018.
In this paper, the performance of the proposed algorithms was compared with the Hybrid Algorithms described in Section 3.5. The MARR or risk-free rate used was 8%. The main metric that we used was the Sharpe Ratio, which allowed measurement of the relationship between expected return and risk. The performance of the algorithms was also measured with other metrics: expected return, risk, average portfolio correlation, and runtime. GENPO algorithm used an initial population of 50 individuals through 100 generations, and used 2 parents with a random selection cross point to generate 2 offspring, then applied an 8% mutation for the entire population. Finally, a stop criterion was implemented in the algorithm after 20 repetitions without improvement. Based on the evaluation, the individuals were ordered from best to worst and the least qualified individuals were eliminated from the population, leaving the population at its original size.
We compared the performance of the algorithms in two circumstances: first by applying the MARR constraint shown in Equation (25), which allowed only assets with an expected return equal to or greater than the MARR to be included in the portfolio; and then without this constraint. The average values of 30 runs are shown in Table 3 and Table 4.
Note in Table 3, we obtained the best result of the Sharpe Ratio using the algorithms TAIPO, SAIPO, and TA, while the second-best result was achieved by GENPO. When the asset constraint was not applied, the TA-Yu algorithm selected a portfolio with negative SR. This negative value is a consequence of the expected lower return than the MARR (eight percent), which is the acceptable minimum value for accepting a portfolio.
In the risk metric, we obtained the best results with the hybrid algorithms SAIPO-Gilli, TAIPO-Gilli, TA-Gilli, and GENPO-Gilli. In terms of expected return, the portfolios obtained with TAIPO, SAIPO, TA, and GENPO, had higher values than the other algorithms. As shown in Table 3 and Table 4, TAIPO, SAIPO, and TA algorithms achieved equivalent results in Sharpe Ratio with and without a constraint. However, the SR placed higher than the rest of the algorithms when the MARR constraint was applied.
In Table 4, we observe that the average correlation is higher when the MARR constraint is implemented than when it does not (as in Table 3). However, this difference is lower in TAIPO, SAIPO, and TA. We obtain the best average correlation value with the GENPO algorithm.
When the MARR constraint satisfies the assets, they can conform to the portfolio, and the algorithms may select them. In addition, portfolios with the lowest number of stocks are collected with TAIPO, SAIPO, and TA, which can be advantageous for these algorithms. We can observe that when the MARR is implemented, the runtime is reduced among all algorithms. Although the TA algorithm attains similar results to TAIPO and SAIPO in the Sharpe Ratio, the runtime is higher. Thus, the new TAIPO algorithm proposed in this paper represents a better alternative than the classical Threshold Accepting algorithm. However, SAIPO and TAIPO algorithms require a lower runtime than Genetic algorithms.
Table 5 shows the relationship between the result reached in the Sharpe Ratio and the runtime (seconds), that is S h a r p e   R a t i o R u n t i m e , of each algorithm; a higher value represents a better result. When the constraint was applied, the best results were obtained with TAIPO-Gilli and SAIPO-Gilli.
When the constraint was not implemented, we obtained the largest S h a r p e   R a t i o R u n t i m e , with the algorithm TA-Gilli. This metric can be used when seeking faster solutions, although faster solutions do not necessarily obtain the best quality results.

4.2. Statistical Test

To compare the results, a Friedman test [51] was applied, considering 30 observations, where each algorithm represented a treatment. Table 6 and Table 7 show the results applied to the TA, TAIPO, and SAIPO algorithms and their hybrid versions. With a significance value of 5% and a p-value equal to zero, we can conclude that there are significant differences in at least one algorithm. In addition, those that reached the best results were the TAIPO, SAIPO, and TA algorithms, with the higher sum of ranks.
In both cases, whether a constraint is applied or not, the TAIPO, SAIPO, and TA algorithms secured the best results in the Sharpe Ratio.
For the algorithms GENPO–Sharpe and its hybrid variants, considering a significance value of 5%, and with a p-value equal to zero, there were significant differences between them. Table 8 shows results for instances without constraint.
In the same way, a Friedman test was applied for the instance with constraint, obtaining a p-value equal to zero, showing a statistically significant difference. Results are displayed in Table 9.
Table 10 shows the comparison of the best algorithms when the constraint was not applied. With a p-value of zero, the null hypothesis can be rejected, thus if there are differences between the groups, the TAIPO, SAIPO, and TA algorithms show better performance.
Table 11 shows the results of the Friedman test undertaken to compare the performance of the best algorithms in each group when the MARR constraint was applied.
With a p-value of 0.964 and a significance value of 0.05, we can conclude that there are no significant differences.

5. Conclusions

This paper presents three algorithms for portfolio optimization: GENPO based on Genetic Algorithms, SAIPO based on Simulated Annealing, and TAIPO, which improves upon the classical Threshold Accepting algorithm (TA). We compared them with state-of-the-art algorithms, namely: Gilli, Yu, and Masese models. This comparison was undertaken by replacing the Sharpe ratio with the objective functions used in these models. The proposed algorithms maximize the Sharpe Ratio (SR) and apply the Minimum Acceptable Rate of Return (MARR) as an essential constraint. Therefore, we present three families of algorithms for portfolio optimization in this paper. For instance, the GA family constituents are GENPO, GENPO-Yu, GENPO-Gilli, and GENPO-Masese.
The proposed algorithms were designed to select the best combination of assets from any stock exchange such as S&P 500 and any other stock market. However, they were only tested with datasets from the Mexican stock exchange (BMV). The optimal result of these algorithms was defined as the proportion of each asset that maximized the objective function.
The experimental results revealed that the proposed algorithms, GENPO, SAIPO, and TAIPO, obtained the highest quality portfolio within each family. Upon application of the MARR constraint, the portfolio with the highest quality was obtained. Moreover, for the same algorithm, when this constraint was included, the execution time was significantly shorter. Regarding the GA family, the proposed GENPO algorithm showed the highest quality in both cases, with and without application of the MARR constraint. Moreover, GENPO did not require excessive tuning time to obtain high-quality portfolios. Similarly, the algorithms SAIPO, TAIPO, and TA showed superior performance with or without the MARR constraint. In addition, they had the lowest average correlation than that of their respective family.
Finally, in the statistical test, where the performance of the proposed algorithms was compared, no significant differences were found when the MARR constraint was applied. However, when the MARR constraint was not applied, SAIPO, TAIPO, and TA obtained a significant difference in quality compared with the GENPO algorithm. The difference was that the TAIPO and SAIPO algorithms converge faster than GENPO and TA algorithms. Therefore, TAIPO and SAIPO represent excellent alternatives for the portfolio integration problem.
The SAIPO and TAIPO algorithms contained more parameters than GENPO; their tuning process was longer and involved a series of previous executions; for this reason, the tuning of these algorithms was more complex than that of GENPO. However, once the appropriate parameters were obtained, the execution time of SAIPO and TAIPO was shorter than the time used by GENPO. However, with TAIPO, unlike SAIPO, for the acceptance criterion of new solutions, the calculation of probabilities was not required, which rendered the execution time of TAIPO slightly lower than SAIPO.
For future research, we propose an application of these algorithms to larger stock markets, including other objective functions and metrics. Finally, we propose the application and extension of these algorithms with other heuristics for design portfolios among several markets. Moreover, the applicability of these algorithms regarding derivatives and other stocks remains a problem that should be studied.

Author Contributions

Conceptualization, J.F.S. and G.C.V.; methodology, M.G.d.A. and J.L.P.A.; software, M.G.d.A. and J.L.P.A.; validation, G.C.V., J.G.B. and J.F.S.; formal analysis, J.F.S. and J.G.B.; investigation, M.G.d.A., J.L.P.A. and J.F.S.; writing—original draft preparation, M.G.d.A. and J.L.P.A.; writing—review and editing, J.G.B., J.F.S. and G.C.V.; supervision, J.F.S. and J.G.B.; project administration, J.F.S. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

In this section, Data supporting are located in this paper.

Acknowledgments

The authors thank Conacyt for the scholarship for graduate studies that let us become researchers and/or full professors.

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Markowitz, H. Portfolio Selection. J. Financ. 1952, 7, 77–91. [Google Scholar]
  2. Markowitz, H.M. Foundations of Portfolio Theory. J. Financ. 1991, 46, 469–477. [Google Scholar] [CrossRef]
  3. Mao, J.C.T. Models of Capital Budgeting, E-V Vs E-S. J. Financ. Quant. Anal. 1970, 4, 657. [Google Scholar] [CrossRef]
  4. Fishburn, P.C. Mean-Risk Analysis with Risk Associated with Below-Target Returns. Source Am. Econ. Rev. 1977, 67, 116–126. [Google Scholar]
  5. Fang, Y.; Lai, K.; Wang, S. Fuzzy Portfolio Optimization Theory and Methods; Springer: Berlin/Heidelberg, Germany, 2008. [Google Scholar]
  6. Kalayci, C.B.; Ertenlice, O.; Akbay, M.A. A comprehensive review of deterministic models and applications for mean-variance portfolio optimization. Expert Syst. Appl. 2019, 125, 345–368. [Google Scholar] [CrossRef]
  7. Doering, J.; Kizys, R.; Juan, A.A.; Fitó, À.; Polat, O. Metaheuristics for rich portfolio optimisation and risk management: Current state and future trends. Oper. Res. Perspect. 2019, 6, 100121. [Google Scholar] [CrossRef]
  8. Zanjirdar, M. Overview of Portfolio Optimization Models. Adv. Math. Financ. Appl. 2020, 5, 419–435. [Google Scholar]
  9. Dokeroglu, T.; Sevinc, E.; Kucukyilmaz, T.; Cosar, A. A survey on new generation metaheuristic algorithms. Comput. Ind. Eng. 2019, 137, 106040. [Google Scholar] [CrossRef]
  10. Yu, L.; Wang, S.; Lai, K.K. Multi-Attribute Portfolio Selection with Genetic Optimization Algorithms. INFOR 2009, 47, 23–30. [Google Scholar] [CrossRef]
  11. Sefiane, S.; Benbouziane, M. Portfolio Selection Using Genetic Algorithm. J. Appl. Financ. Bank. 2012, 2, 143–154. [Google Scholar]
  12. Hadi, A.S.; Naggar, A.A.E.; Bary, M.N.A. New model and method for portfolios selection. Appl. Math. Sci. 2016, 10, 263–288. [Google Scholar] [CrossRef]
  13. Chen, B.; Zhong, J.; Chen, Y. A hybrid approach for portfolio selection with higher-order moments: Empirical evidence from Shanghai Stock Exchange. Expert Syst. Appl. 2020, 145, 113104. [Google Scholar] [CrossRef]
  14. Pekár, J.; Čičková, Z.; Brezina, I. Portfolio performance measurement using differential evolution. Central Eur. J. Oper. Res. 2016, 24, 421–433. [Google Scholar] [CrossRef]
  15. García, S.; Quintana, D.; Galván, I.M.; Isasi, P. Multi-objective algorithms with resampling for portfolio optimization. Comput. Inform. 2013, 32, 777–796. [Google Scholar]
  16. Zaheer, H.; Pant, M. Solving portfolio optimization problem through differential evolution. In Proceedings of the 2016 International Conference on Electrical, Electronics, and Optimization Techniques (ICEEOT), Chennai, India, 3–5 March 2016; pp. 3982–3987. [Google Scholar]
  17. Liu, W.-H. Optimal computing budget allocation to the differential evolution algorithm for large-scale portfolio optimization. J. Simul. 2017, 11, 380–390. [Google Scholar] [CrossRef]
  18. Ni, Q.; Yin, X.; Tian, K.; Zhai, Y. Particle swarm optimization with dynamic random population topology strategies for a generalized portfolio selection problem. Nat. Comput. 2016, 16, 31–44. [Google Scholar] [CrossRef]
  19. Heidari, H.; Neshatizadeh, L. Stock Portfolio-Optimization Model by Mean-Semi-Variance Approach Using of Firefly Algorithm and Imperialist Competitive Algorithm. Int. J. Bus. Dev. Stud. 2018, 10, 115–143. [Google Scholar]
  20. Kalayci, C.B.; Polat, O.; Akbay, M.A. An efficient hybrid metaheuristic algorithm for cardinality constrained portfolio optimization. Swarm Evol. Comput. 2020, 54, 100662. [Google Scholar] [CrossRef]
  21. Gilli, M.; Këlezi, E. A Heuristic Approach to Portfolio Optimization; FAME Research Paper Series RP20; International Center for Financial Asset Management and Engineering, 2000; p. 14. Available online: https://ideas.repec.org/p/fam/rpseri/rp20.html (accessed on 3 January 2022).
  22. Masese, J.M.; Othieno, F.; Njenga, C. Portfolio Optimization under Threshold Accepting: Further Evidence from a Frontier Market. J. Math. Finance 2017, 7, 941–957. [Google Scholar] [CrossRef] [Green Version]
  23. Gilli, M.; Schumann, E. Heuristics for Portfolio Selection. Int. Ser. Oper. Res. Manag. Sci. 2017, 245, 225–253. [Google Scholar] [CrossRef]
  24. Chang, T.-J.; Meade, N.; Beasley, J.; Sharaiha, Y. Heuristics for cardinality constrained portfolio optimisation. Comput. Oper. Res. 2000, 27, 1271–1302. [Google Scholar] [CrossRef]
  25. Fogarasi, N.; Levendovszky, J. Sparse, mean reverting portfolio selection using simulated annealing. Algorithmic Financ. 2013, 2, 197–211. [Google Scholar] [CrossRef] [Green Version]
  26. Salehpoor, I.B.; Molla-Alizadeh-Zavardehi, S. A constrained portfolio selection model at considering risk-adjusted measure by using hybrid meta-heuristic algorithms. Appl. Soft Comput. 2019, 75, 233–253. [Google Scholar] [CrossRef]
  27. Kapiamba, J.N.; Ulungu, B.; Mubenga, P.K. Simulated Annealing vs Genetic Algorithm to Portfolio Selection. IJSIMR 2015, 3, 18–30. [Google Scholar]
  28. Wang, X.; He, L.; Ji, H. Modified generalized simulated annealing algorithm used in data driven portfolio management. In Proceedings of the 2016 IEEE Information Technology, Networking, Electronic and Automation Control Conference, Chongqing, China, 20–22 May 2016; pp. 1014–1017. [Google Scholar]
  29. John, C. High Speed Hill Climbing Algorithm for Portfolio Optimization. Tanzan. J. Sci. 2021, 47, 1236–1242. [Google Scholar] [CrossRef]
  30. Sen, T.; Saha, S.; Ekbal, A.; Laha, A.K. Bi-objective portfolio optimization using Archive Multi-objective Simulated Annealing. In Proceedings of the 2014 International Conference on High Performance Computing and Applications (ICHPCA), Bhubaneswar, India, 22–24 December 2014; pp. 1–6. [Google Scholar] [CrossRef]
  31. Chen, W.; Wang, Y.; Mehlawat, M.K. A hybrid FA–SA algorithm for fuzzy portfolio selection with transaction costs. Ann. Oper. Res. 2018, 269, 129–147. [Google Scholar] [CrossRef]
  32. Kumar, C.; Doja, M.N.; Baig, M.A. A Novel Framework for Portfolio Optimization Based on Modified Simulated Annealing Algorithm Using ANN, RBFN, and ABC Algorithms. In Towards Extensible and Adaptable Methods in Computing; Springer: Singapore, 2018; pp. 157–178. [Google Scholar]
  33. Cohen, J.; Khan, A.; Alexander, C. Portfolio Optimization of 60 Stocks Using Classical and Quantum Algorithms. arXiv 2020, 1–19. [Google Scholar]
  34. Sharpe, W.F. Mutual Fund Performance. J. Bus. 1966, 39, 119–138. [Google Scholar] [CrossRef]
  35. Choueifaty, Y.; Coignard, Y. Toward Maximum Diversification. J. Portf. Manag. 2008, 35, 40–51. [Google Scholar] [CrossRef] [Green Version]
  36. Aneja, Y.P.; Chandra, R.; Gunay, E. A Portfolio Approach to Estimating the Average Correlation Coefficient for the Constant Correlation Model. J. Financ. 1989, 44, 1435–1438. [Google Scholar] [CrossRef]
  37. Salazar, J.R.; Tella, R. Supplement Portfolio Construction Based on Implied Correlation. EconoQuantum 2014, 12, 125–144. [Google Scholar] [CrossRef]
  38. Holland, J.H. Adaptation in Natural and Artificial Systems, 1st ed.; University of Michigan Press: Ann Arbor, MI, USA, 1975. [Google Scholar]
  39. Kadar, A.; Faruque, F.; Mohammad, S.; Iqdal, H. Solving the Vehicle Routing Problem using Genetic Algorithm. Int. J. Adv. Comput. Sci. Appl. 2011, 2, 126–131. [Google Scholar] [CrossRef] [Green Version]
  40. Gen, M.; Choi, J.; Ida, K. Improved genetic algorithm for generalized transportation problem. Artif. Life Robot. 2000, 4, 96–102. [Google Scholar] [CrossRef]
  41. Werner, F. A survey of genetic algorithms for shop scheduling problems. Math. Res. Summ. 2017, 2, 15. [Google Scholar]
  42. Kirkpatrick, S.; Gelatt, C.D.; Vecchi, M.P. Optimization by simulated annealing. Science 1983, 220, 671–680. [Google Scholar] [CrossRef] [PubMed]
  43. Metropolis, N.; Rosenbluth, A.W.; Rosenbluth, M.N.; Teller, A.H.; Teller, E. Equation of state calculations by fast computing machines. Equ. State Calc. Fast Comput. Mach. 1953, 21, 1087–1092. [Google Scholar] [CrossRef]
  44. Dueck, G.; Scheuer, T. Threshold accepting: A general purpose optimization algorithm appearing superior to simulated annealing. J. Comput. Phys. 1990, 90, 161–175. [Google Scholar] [CrossRef]
  45. Sánchez-Hernández, J.P.; Frausto-Solís, J.; González-Barbosa, J.J.; Soto-Monterrubio, D.A.; Maldonado-Nava, F.G.; Castilla-Valdez, G. A Peptides Prediction Methodology for Tertiary Structure Based on Simulated Annealing. Math. Comput. Appl. 2021, 26, 39. [Google Scholar] [CrossRef]
  46. Frausto-Solis, J.; Hernández-Ramírez, L.; Castilla-Valdez, G.; González-Barbosa, J.J.; Sánchez-Hernández, J.P. Chaotic Multi-Objective Simulated Annealing and Threshold Accepting for Job Shop Scheduling Problem. Math. Comput. Appl. 2021, 26, 8. [Google Scholar] [CrossRef]
  47. Frausto-Solis, J.; Román, E.F.; Romero, D.; Soberon, X.; Liñán-García, E. Analytically Tuned Simulated Annealing Applied to the Protein Folding Problem. Comput. Vis. 2007, 4488, 370–377. [Google Scholar] [CrossRef] [Green Version]
  48. Frausto-Solis, J.; Sanvicente-Sánchez, H.; Imperial-Valenzuela, F. ANDYMARK: An Analytical Method to Establish Dynamically the Length of the Markov Chain in Simulated Annealing for the Satisfiability Problem. Comput. Vis. 2006, 4247, 269–276. [Google Scholar] [CrossRef]
  49. Purata, L.; Frausto, S.; Gonzalez, J.; Castilla, G. Genpo-Sharpe: Stock selection for investing portfolio using a genetic algorithm with sharpe ratio applied to mexican stock exchange. In Proceedings of the 8th International Workshop on Numerical and Evolutionary Optimization, Ciudad de Mexico, Mexico, 8–10 September 2020; p. 100. [Google Scholar]
  50. Dopfel, F.E. Asset Allocation in a Lower Stock-Bond Correlation Environment. J. Portf. Manag. 2003, 30, 25–38. [Google Scholar] [CrossRef]
  51. Myles Hollander, E.C.; Douglas, A. Wolfe, Nonparametric Statistical Methods, 3rd ed.; John Wiley & Sons, Inc.: Hoboken, NJ, USA, 2013. [Google Scholar]
Table 1. Parameters used for SA and TA Analytical Tuning.
Table 1. Parameters used for SA and TA Analytical Tuning.
ParameterDescriptionEquation
s i ,   s j Current and candidate solution-
E ( s i ) ,   E ( s j ) Energy   associated   with   s i   and   s j -
Δ E m a x ,   Δ E m i n Maximum and minimum deterioration-
T i Initial temperature T i = Δ E m a x   ln ( P ( Δ E m a x   ) ) (1)
P ( Δ E m a x ) ,   P ( Δ E m i n ) Probability of accepting a solution with maximum and minimum deterioration P ( Δ E m a x   ) = e Δ E max   T i     (2)
P ( Δ E m i n   ) = e Δ E min   T f     (3)
T f Final temperature T f = Δ E m i n ln ( P ( Δ E m i n ) ) (4)
α Temperature decrease factor-
T k Current temperature T k + 1 = α T k (5)
L k Length of the Markov chain in Metropolis cycle L k + 1 = β L k (6)
L m i n Value   of   L k   at   T i -
n Number   of   steps   from   T i   to   T f n = ln ( T f ) ln ( T i ) ln ( α ) (7)
β Increment   coefficient   of   L k β = e ln ( L max ) ln ( L min ) n   (8)
V s i Neighborhood   of   the   solution   s i -
P ( s j ) Probability   of   selecting   s j P ( s j ) = 1 e N | V s i | (9)
N Number   of   random   samples   in   V S i N = | V s i | ln ( 1 P ( s j ) ) = C | V s i | (10)
C Exploration level C = ln ( P ( s j ) ) (11)
L m a x Value   of   L k   at   T f L m a x = C | V s i | (12)
Table 2. Tuning parameters for TAIPO and SAIPO algorithms.
Table 2. Tuning parameters for TAIPO and SAIPO algorithms.
Number of
Executions
Initial   Temperature   T i   Final   Temperature T f L k Alpha
Value
301000.000011000.95
Table 3. Algorithm performance without MARR constraint.
Table 3. Algorithm performance without MARR constraint.
AlgorithmSharpe RatioRiskExpected ReturnAverageStocksRuntime (seconds)
Correlation
TAIPO8.10.09730.86830.00437292.93
SAIPO8.10.09730.86820.00417301.63
TA8.10.09760.8710.00447745.03
TAIPO-Yu0.00150.05560.08010.03042610.16
SAIPO-Yu0.00550.05560.08030.02942610.1
TA-Yu−0.01030.05870.07880.0346275.46
TAIPO-Gilli0.76850.05540.12260.02962711.01
SAIPO-Gilli0.76050.05540.12210.02972711.23
TA-Gilli0.76360.05540.12230.0297275.78
TAIPO Masese0.17650.06560.09190.0134109.84
SAIPO Masese0.47950.06640.11240.01171010.52
TA Masese0.63230.06620.12290.01271011.8
GENPO6.950.0870.72440.018721462.14
GENPO-Yu0.38740.05750.08030.015744430.62
GENPO-Gilli0.80770.05630.12550.016443561.57
GENPO-Masese0.60340.05640.11410.020720487.96
Table 4. Algorithm performance with MARR constraint.
Table 4. Algorithm performance with MARR constraint.
AlgorithmSharpe RatioRiskExpected ReturnAverage
Correlation
StocksRuntime (seconds)
TAIPO8.10.09800.87160.0048717.43
SAIPO8.10.09750.86990.0048718.02
TA8.10.09740.86870.00487136.21
TAIPO-Yu0.59150.08860.13240.0785112.05
SAIPO-Yu0.59150.08860.13240.0784112.04
TA-Yu0.59570.08840.13260.0785112.81
TAIPO-Gilli5.16040.06730.42730.0479172.48
SAIPO-Gilli5.17470.06730.42820.0478172.53
TA-Gilli5.1480.06730.42640.048173.15
TAIPO-Masese3.31670.07140.3170.0435101.8
SAIPO-Masese3.27710.07190.31540.0432102.0
TA-Masese3.32020.07180.31830.0427103.79
GENPO7.960.09510.84200.0011968.64
GENPO-Yu0.90610.08700.15690.03261680.40
GENPO-Gilli0.86630.06730.42150.05141987.41
GENPO-Masese4.91940.06760.41260.03841388.25
Table 5. Sharpe Ratio vs. Runtime.
Table 5. Sharpe Ratio vs. Runtime.
MARR ConstraintWithout MARR Constraint
AlgorithmSharpe/RuntimeSharpe/Runtime
TAIPO0.46470.0277
SAIPO0.44950.0269
TA0.05950.0109
TAIPO-Yu0.28850.0001
SAIPO-Yu0.29000.0005
TA-Yu0.2120−0.0019
TAIPO-Gilli2.08080.0698
SAIPO-Gilli2.04530.0677
TA-Gilli1.63430.1321
TAIPO-Masese1.84260.0179
SAIPO-Masese1.63860.0456
TA-Masese0.87600.0536
GENPO0.11600.0150
GENPO-Yu0.01130.0009
GENPO-Gilli0.00990.0014
GENPO-Masese0.05570.0012
Table 6. Friedman Test TA, TAIPO and SAIPO Algorithms without MARR constraint.
Table 6. Friedman Test TA, TAIPO and SAIPO Algorithms without MARR constraint.
AlgorithmMedianSum of Ranks
TA8.1051332
SAIPO8.1051330
TAIPO8.1040328
TAIPO-Gilli0.7650207
SAIPO-Gilli0.7699199
TA-Gilli0.7557197
TA-Masese0.5874163
SAIPO-Masese0.4451148
TAIPO-Masese−0.3164130
TA-Yu−0.0088111
SAIPO-Yu0.0067105
TAIPO-Yu0.002590
Table 7. Friedman Test TA, TAIPO and SAIPO Algorithms with MARR constraint.
Table 7. Friedman Test TA, TAIPO and SAIPO Algorithms with MARR constraint.
AlgorithmMedianSum of Ranks
SAIPO8.1000332
TA8.1000330
TAIPO8.0990328
SAIPO-Gilli5.1709254
TAIPO-Gilli5.1566240
TA-Gilli5.1480226
TA-Masese3.2775155
SAIPO-Masese3.2226149
TAIPO-Masese3.2577146
TA-Yu0.595684
SAIPO-Yu0.592353
TAIPO-Yu0.588943
Table 8. Friedman Test Genetics Algorithms without MARR constraint.
Table 8. Friedman Test Genetics Algorithms without MARR constraint.
AlgorithmMedianSum of Ranks
GENPO7.032120
GENPO-Gilli0.76981.5
GENPO-Masese0.61768.5
GENPO-Yu0.03330
Table 9. Friedman Test Genetics Algorithms with MARR constraint.
Table 9. Friedman Test Genetics Algorithms with MARR constraint.
AlgorithmMedianSum of Ranks
GENPO8.086120
GENPO-Masese4.92190
GENPO-Yu0.92451
GENPO-Gilli0.86639
Table 10. Friedman Test for best algorithms without MARR constraint.
Table 10. Friedman Test for best algorithms without MARR constraint.
AlgorithmMedianSum of Ranks
TA8.104992
SAIPO8.103290
TAIPO8.103788
GENPO6.943430
Table 11. Friedman Test for best algorithms with MARR constraint.
Table 11. Friedman Test for best algorithms with MARR constraint.
AlgorithmMedianSum of Ranks
GENPO8.105577
SAIPO8.100976
TA8.100675
TAIPO8.100272
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Share and Cite

MDPI and ACS Style

Frausto Solis, J.; Purata Aldaz, J.L.; González del Angel, M.; González Barbosa, J.; Castilla Valdez, G. SAIPO-TAIPO and Genetic Algorithms for Investment Portfolios. Axioms 2022, 11, 42. https://doi.org/10.3390/axioms11020042

AMA Style

Frausto Solis J, Purata Aldaz JL, González del Angel M, González Barbosa J, Castilla Valdez G. SAIPO-TAIPO and Genetic Algorithms for Investment Portfolios. Axioms. 2022; 11(2):42. https://doi.org/10.3390/axioms11020042

Chicago/Turabian Style

Frausto Solis, Juan, José L. Purata Aldaz, Manuel González del Angel, Javier González Barbosa, and Guadalupe Castilla Valdez. 2022. "SAIPO-TAIPO and Genetic Algorithms for Investment Portfolios" Axioms 11, no. 2: 42. https://doi.org/10.3390/axioms11020042

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop