You are on page 1of 12

International Journal of

Financial Studies

Article
Solving Constrained Mean-Variance Portfolio Optimization
Problems Using Spiral Optimization Algorithm
Werry Febrianti 1,2, *, Kuntjoro Adji Sidarto 1 and Novriana Sumarti 1, *

1 Department of Mathematics, Faculty of Mathematics and Natural Sciences, Institut Teknologi Bandung,
Ganesa Street No. 10, Bandung 40132, Indonesia
2 Mathematics, Department of Sciences, Institut Teknologi Sumatera, Terusan Ryacudu Street, Way Huwi,
South Lampung 35365, Indonesia
* Correspondence: werry.febrianti@gmail.com (W.F.); novriana@itb.ac.id (N.S.)

Abstract: Portfolio optimization is an activity for balancing return and risk. In this paper, we used
mean-variance (M-V) portfolio models with buy-in threshold and cardinality constraints. This model
can be formulated as a mixed integer nonlinear programming (MINLP) problem. To solve this
constrained mean-variance portfolio optimization problem, we propose the use of a modified spiral
optimization algorithm (SOA). Then, we use Bartholomew-Biggs and Kane’s data to validate our
proposed algorithm. The results show that our proposed algorithm can be an efficient tool for solving
this portfolio optimization problem.

Keywords: constrained portfolio optimization; mixed integer nonlinear programming; spiral opti-
mization algorithm

1. Introduction
A portfolio is a combination of various investment assets that are maintained to achieve
investment goals. The assets investment combination will determine the high risk and large
Citation: Febrianti, Werry, Kuntjoro
profits of the portfolio. Portfolios can contain a variety of investment assets such as stocks,
Adji Sidarto, and Novriana Sumarti. bonds, properties, and cash. In general, investors always want to achieve the maximum
2023. Solving Constrained Mean- rate of return on their investment. In fact, a fairly high return is often accompanied by a
Variance Portfolio Optimization high level of risk. Therefore, we need a way to minimize this high risk. Thus, the portfolio
Problems Using Spiral Optimization has an important role. By using a portfolio, investors try to maximize the expected return
Algorithm. International Journal of at a certain level of risk or minimize risk at a certain target rate of return (expected return).
Financial Studies 11: 1. https:// A portfolio that can achieve this goal is called an efficient portfolio.
doi.org/10.3390/ijfs11010001 Regarding the level of expected return and risk, investors have their own preferences.
Academic Editor: Sabri Boubaker
Investors will choose a portfolio that is in accordance with their preferences for returns and
the risks they will bear. To meet the investors’ preferences, an optimal portfolio is formed.
Received: 9 November 2022 This optimal portfolio is chosen by investors from the many choices available in an efficient
Revised: 5 December 2022 portfolio collection. In general, the optimal portfolio is a portfolio that maximizes investor
Accepted: 11 December 2022 preferences with regard to investment returns and risks.
Published: 20 December 2022
There are many theories regarding the formation of an efficient portfolio. One of them
is by Markowitz (1959). The portfolio theory proposed by Markowitz is known as the mean-
variance optimization model. Markowitz defined the return of an asset portfolio in the
Copyright: © 2022 by the authors.
form of the expected value and the risk in the form of the variance of the portfolio’s return.
Licensee MDPI, Basel, Switzerland. He stated that mean-variance analysis has an important role in portfolio selection theory.
This article is an open access article Markowitz described how to combine assets into an efficient and diversified portfolio.
distributed under the terms and In this portfolio, risk can be reduced by adding the number of types of assets to the port-
conditions of the Creative Commons folio; the level of expected return can increase if there are differences in price movements
Attribution (CC BY) license (https:// of the combined assets. A comprehensive literature review of recent and novel papers
creativecommons.org/licenses/by/ about mean-variance portfolio optimization in which several variants of this model and
4.0/). additional constraints have been studied has been conducted by Kalayci et al. (2019). The

Int. J. Financial Stud. 2023, 11, 1. https://doi.org/10.3390/ijfs11010001 https://www.mdpi.com/journal/ijfs


Int. J. Financial Stud. 2023, 11, 1 2 of 12

review classifies the approaches according to exact and approximate attempts and ana-
lyzes the purposed algorithm based on various data and performance indicators in depth.
Le Thi and Moeini (2006) have investigated a continuous approach for a generalization of
the Markowitz mean-variance model which included buy-in threshold constraints. The
existence of buy-in threshold constraints made the corresponding portfolio selection non-
convex and not easy to solve. Therefore, they expressed the buy-in threshold constraints as
mixed zero-one linear constraints, then used an exact penalty result. They reformulated this
problem in terms of a Difference of Convex functions (DC) program. The computational
aspects of alternative portfolio selection models in the presence of discrete asset choice
constraints were studied by Jobst et al. (2001). They considered the mean-variance (M-V)
model of Markowitz and the risk-return efficient frontier. They examined the effects of
applying buy-in threshold, cardinality constraints, and transaction round lot restrictions to
the portfolio selection problem. The effects of adding these constraints cause the efficient
frontier to become discontinuous. They proposed alternative approaches for computing this
frontier and provided insights into its discontinuous structure. Cesarone et al. (2013) pre-
sented a study of the Limited Asset Markowitz (LAM) model based on a reformulation as a
Standard Quadratic Program with a cardinality constraint. They used this reformulation to
avoid the explicit use of additional binary variables. Gao and Li (2013) explored the special
structures and rich geometric properties behind the mathematical formulation instead of
tailoring this difficult problem into the general solution framework of a mixed-integer
programming formulation. They applied Langrangian relaxation to the primal problem, re-
sulting in a cardinality-constrained portfolio selection problem that possessed a symmetric
property and developed geometric approaches. Dehghan Hardoroudi et al. (2017) used
a transformation method to change the cardinality-constrained mean-variance (CCMV)
portfolio optimization problem into a mixed integer linear programming (MILP) problem.
They used a MILP solver to solve this CCMV portfolio optimization problem so that they
did not need to develop a customized code to solve the problem. Kalayci et al. (2020)
proposed an efficient hybrid metaheuristic algorithm that combined components from an
ant colony, artificial bee colony optimization, and genetic algorithms to solve a cardinality-
constrained multi-objective portfolio optimization problem. Akbay et al. (2020) developed
an efficient solution approach called a parallel variable neighborhood search algorithm
combined with quadratic programming to solve cardinality-constrained multi-objective
portfolio optimization. Then, quadratic programming quickly calculated the proportion of
assets, and a variable neighborhood search algorithm was used to decide the combination
of assets to be held in the portfolio.
In 2009, Bartholomew-Biggs and Kane (2009) demonstrated the possibility of solving
problems with buy-in threshold and round lot constraints using a global minimization
approach that involved continuous rather than discrete variables. They also used a penalty
function approach such that they could use the DIRECT method as one of the algorithms
for unconstrained global minimization.
In this paper, we convert the problem of constrained mean-variance portfolio opti-
mization with buy-in threshold and cardinality constraints into a mixed integer nonlinear
programming (MINLP) problem. To solve this MINLP portfolio problem, we propose the
use of a modified spiral optimization algorithm (SOA MINLP).
A spiral optimization algorithm (SOA) was proposed by Tamura and Yasuda (2011)
as a metaheuristic algorithm that is inspired by spiral phenomena in nature. SOA was
used to solve a mixed integer nonlinear programming problem by Kania and Sidarto (2016)
and SOA with clustering was used to find solutions to systems of nonlinear equations by
Sidarto and Kania (2015). SOA was also used to solve a combined economic and emission
dispatch (Benasla et al. 2014).
In this paper, we use real data from Bartholomew-Biggs and Kane (2009) to verify our
constrained mean-variance model with buy-in threshold and cardinality constraints.
The organization of this paper is as follows. In Section 2, we describe the portfolio
optimization and MINLP problems. Then, in Section 3, we describe the spiral optimization
Int. J. Financial Stud. 2023, 11, 1 3 of 12

algorithm (SOA). In Section 4, we describe the modified SOA for solving the portfolio
optimization problem (SOA MINLP). In Section 5, a numerical example is given to illus-
trate the implementation of the SOA MINLP to find the minimum risk of the portfolio
optimization problem with buy-in threshold and cardinality constraints. A conclusion is
given in Section 6.

2. Portfolio Optimization Problem as a Mixed Integer Nonlinear


Programming Problem
2.1. Portfolio Optimization Problem
We briefly describe portfolio theory before using the MINLP concept regarding the
portfolio optimization problem. Portfolio theory is concerned with investors’ estimates
of risk and return expectations, which are statistically measured to create investment
portfolios. Markowitz (1959) described how to combine assets into an efficient and diver-
sified portfolio. In practice, investors in securities often diversify their investments by
combining various securities/stocks; otherwise stated, they form a portfolio of several
shares/securities.
Portfolio theory starts with the assumption that future returns on securities can be
estimated. Then, we can determine risk by using the variance of the distribution of returns.
Let yi represent the proportion (0 ≤ yi ≤ 1) of capital to be invested in asset i and yT =
¯T
(y1 , y2 , · · · , yn ). Then, for a set of n assets, we have the mean returns r = (r1 , r2 , · · · r n )
and Q as a n × n Variance-Covariance (positive semidefinite) matrix. Initially, we require
the invested fractions to satisfy ∑in=1 yi = 1 or equivalently eT y = 1 where eT = (1, 1, . . . , 1).
Then, the problem of minimizing the total variance (risk= V (y)) associated with the portfo-
lio is solved by ensuring that the portfolio has an expected return R p , expressed as below:

minV (y) = yT Qy (1)

¯T
subject to : r y = R p
∑in=1 yi = 1
In this paper, we do not allow short selling. Therefore, the formulation has changed to
be as below:
minV (y) = yT Qy (2)
¯T
subject to : r y = R p 0
∑in=1 yi = 1
yi ≥ 0, i = 1, 2, · · · , n
A buy-in threshold is defined as the minimum level below which an asset cannot be
purchased. This requirement eliminates unrealistically small trades that can otherwise be
included in an optimized portfolio (Jobst et al. 2001). The portfolio optimization problem
with a buy-in threshold constraint is stated below:
minV (y) = yT Qy (3)

¯T
subject to : r y = R p
eT y = 1
li zi ≤ yi ≤ ui zi , i = 1, 2, · · · , n
0 < li < u i ≤ 1
zi ∈ {0, 1}
where li and ui are finite lower and upper bounds associated with each asset i = 1, 2, · · · , n.
Int. J. Financial Stud. 2023, 11, 1 4 of 12

Cardinality constraints restrict the number of securities that are allowed in the portfolio
(Jobst et al. 2001). In practice, the cardinality constraint is related to the buy-in threshold
constraint. This means that we can achieve optimization using the formula below:

minV (y) = yT Qy (4)

¯T
subject to : r y = R p

eT y = 1

∑in=1 zi = K

li zi ≤ yi ≤ ui zi , i = 1, 2, · · · , n

0 < li < u i ≤ 1

zi ∈ {0, 1}
where li and ui are finite lower and upper bounds associated with each asset i = 1, 2, · · · , n.
In this cardinality constraint problem, K stocks are selected from n existing stocks.

2.2. Mixed Integer Nonlinear Programming


Based on data by Kania and Sidarto (2016), we can express the MINLP problem as
follows:
minn f (x) (5)
x∈R

subject to gi (x) = 0, i = 1, 2, · · · , M

and h j (x) ≤ 0,

j = 1, 2, · · · , N
T
x = x 1 , x 2 , · · · x q , x q +1 , · · · , x n
where x1 , x2 , · · · xq are integers for a given q.
The above problem can be transformed into an unconstrained problem using a penalty
function. Therefore, the penalty function that we want to minimize is given by the following
equation:
M N
F x, αi , β j = f (x) + ∑ αi gi 2 (x) + ∑ β j max h j ( x ), 0
 2
(6)
i =1 j =1

Here, αi and β j are large positive numbers as penalty constants. For simplicity, we use
the same constants, αi and β j for i = 1, 2, · · · , M and j = 1, 2, · · · , N.
Based on the discussion above, we can transform the portfolio optimization problem
with a buy-in threshold constraint into an MINLP problem by using a penalty function.
Therefore, the penalty function that we want to minimize is given by the following equation:
!2
2 ¯T
r y
F= yT Qy + ρ eT y − 1 +µ Rp −1 + ∑in=1 αi [max(0, (−yi + li zi ))]2 +
(7)
2
∑in=1 β i [max(0, (yi − ui zi ))]

where ρ, µ, αi , and β i are penalty constants.


For the cardinality constraint problem, as in Equation (4), we can transform the portfo-
lio optimization problem into an MINLP problem by using a penalty function. Therefore,
Int. J. Financial Stud. 2023, 11, 1 5 of 12

the portfolio optimization problem with a cardinality constraint can be transformed into an
unconstrained problem as follows:
!2
2 ¯T 2
r y zi
F= yT Qy + ρ eT y − 1 +µ Rp −1 + λ ∑in=1 K −1 +
(8)
2 2
∑in=1 αi [max(0, (−yi + li zi ))] + ∑in=1 β i [max(0, (yi − ui zi ))]

where ρ, µ, λ, αi , and β i are penalty constants.

3. Spiral Optimization Algorithm


We review  the spiral model
 in 2-dimensional and n-dimensional initially. Consider
cos θ − sin θ
that R(2) = and x can be any vector in R2 . The multiplication of x by
sin θ cos θ
R(2) gives a counterclockwise rotation of x. The matrix R(2) represents the rotation in
the 2D plane  angle (0 < θ < 2π ). The multiplication of x by the diagonal matrix
by an 
r 0
diag2 (r, r ) = with 0 < r < 1 shortens the length of x in R2 by the factor of r.
0 r
Therefore, the multiplication of the vector x in R2 by matrix S2 (r, θ ) = diag2 (r, r ) R(2) gives
the geometric effect of the anticlockwise rotation of x through the angle θ, then shortens the
vector R(2) x by a factor of r. Hence, the equation below:

x(k + 1) = S2 (r, θ )x(k) where x(k) = ( x1 (k), x2 (k )) T , k = 0, 1, 2, . . . (9)

This describes the transformation of initial point x0 in R2 repeatedly by the operator


x → S2 (r, θ )x . The graph of the sequence x0 , x1 , x2 , · · · in the 2D-plane produces a
trajectory of a spiral form; thus, in the case of 0 < r < 1, the point x0 spirals inward and
toward the origin as the geometric effect of S2 (r, θ ). Based on translating the initial point
toward an arbitrary point x∗ , Equation (9) is given as below:

x(k + 1) − x∗ = S2 (r, θ )(x(k ) − x∗ ) (10)

where x(k) = ( x1 (k), x2 (k)) T , k = 0, 1, 2, . . ., which gives the below equation:

x(k + 1) = S2 (r, θ )x(k) − (S2 (r, θ ) − I2 )x∗ (11)

where x(k) = ( x1 (k), x2 (k)) T , k = 0, 1, 2, . . .


The iterated point uk = u(k) = x(k) − x∗ , k = 0, 1, 2, . . . in Equation (10) spirals inward
toward the origin so that the iterates of point x0 spiral inward toward point x∗ on the plane.
The extension of the 2-D spiral model into an n-dimensional spiral model can be
achieved with the help of a rotation matrix in n-dimensional space. In this case, rotation in
the n-dimension is performed in a similar way as in 2-dimensional rotation. Consider that
Ri,j (n) can be an n × n matrix with entries rii = r jj = cos θ, r ji = sin θ, rij = − sin θ, and
that rst = δst for all other entries of Ri,j (n) (where if s = t and δst = 0 if s 6= t). Here, Ri,j (n)
resembles the identity matrix except for the ii, ij, jj, and ji positions. The multiplication
of a vector by rotation matrix only alters the and jth components of the vector. It has
no effect on other components. Thus, Ri,j (n) acts as a plane rotation. In total, we have
 
n
= 2!(nn!−2)! = 21 n(n − 1) number of plane rotation matrices. Consider that R(n) can be
2
an n × n matrix defined as follows:
!
n −1 i
R(n) = ∏ ∏ R(n) n−i, n+1− j
i =1 j =1
Int. J. Financial Stud. 2023, 11, 1 6 of 12

R(n) is a composition of plane rotation matrix Ri,j (n) . Using this composition rotation
matrix, the n-dimensional spiral model is formulated as below:

x(k + 1) = Sn (r, θ )x(k) (12)

where x(k) = ( x1 (k), x2 (k), · · · , xn (k)) T and Sn (r, θ ) = diagn (r, r, · · · , r ) R(n)
Having translated the initial point toward an arbitrary point x∗ , the n-dimensional
spiral model with its center at x∗ is defined as follows:

x(k + 1) = Sn (r, θ )x(k) − (Sn (r, θ ) − In )x∗ (13)

where x(k) = ( x1 (k), x2 (k), · · · , xn (k)) T , and Sn (r, θ ) = diagn (r, r, · · · , r ) R(n)
Now, consider the optimization problem

maxn F (x)
x∈R

with
x = ( x1 , x2, · · · xn ) T ∈ Rn
Hence, based on Sidarto and Kania (2015), we show the algorithm of n-dimensional
spiral optimization algorithm in Algorithm 1.

Algorithm 1. Spiral Optimization Algorithm


1: Input:
m ≥ 2, the number of search points
θ (0 < θ < 2π ), r (0 < r < 1)
k max maximum number of iterations
2: Process:
Step 1. Generate randomly initial points xi eRn , i = 1, 2, · · · , m in the feasible region
Step 2. Set k = 0
Step 3. Find x∗ as x∗ = xig (0), i g = argmin F (xi (0)) , i = 1, 2, · · · , m
i
Step 4. Update xi (k) to be xi (k + 1) = Sn (r, θ )xi (k) − (Sn (r, θ ) − In )x∗ , i = 1, 2, · · · , m
Step 5. Update x∗ to be x∗ = xig (k + 1), i g = argmax F (xi (k + 1)), i = 1, 2, · · · , m
i
Step 6. If k = k max then stop. Otherwise, set k = k + 1 and return to step 4.
3: Output: x∗ as a minimum point of F (x)

4. Spiral Optimization Algorithm for the Portfolio Optimization Problem


We propose a method for solving the portfolio optimization problem using a modified
SOA. The main modification occurs in the calculation of the objective function. We round
to the nearest integer for variables that must be an integer in the computation, but keep
the variables as real when spiral iterations are conducted. Algorithm 2 below is based on a
study by Kania and Sidarto (2016).
In the following section, we develop an SOA for the portfolio optimization problem
with buy-in threshold and cardinality constraints, as stated in Algorithms 3 and 4.
Int. J. Financial Stud. 2023, 11, 1 7 of 12

Algorithm 2. Spiral Optimization Algorithm for Solving the MINLP Problem


1: Input:
m ≥ 2, the number of search points
θ (0 < θ < 2π ), r (0 < r < 1)
k max maximum number of iterations
2: Process:
Step 1. Generate randomly initial points xi eRn , i = 1, 2, · · · , m in the feasible region
Step 2. Set k = 0
Step 3. For i = 1, 2, · · · , m, find F (yi (0))
where   T
yi (0) = yi1 (0) yi2 (0) · · · yij (0) · · · yin (0)
with (  
round xij (0) , if xij must be integer
yij (0) =
xij (0) , otherwise
Step 4. Find x∗ as x∗ = xig (0) with i g = argmin F (yi (0)), i = 1, 2, · · · , m
i
Step 5. Update the value of xi (k) to be xi (k + 1) such that we get
xi (k + 1)= Sn (r, θ )x(k) − (Sn (r, θ ) − In )x∗ , i = 1, 2, · · · , m
Step 6. Update the value of x∗ to be xig (k + 1), i g = argmin F (yi (k + 1))
i
where
T
yi (k + 1) = yi1 (k + 1) yi2 (k + 1) · · · yij (k + 1) · · · yin (k + 1)
with 
round xij (k + 1) , if xij must be integer
yij (k + 1) =
xij (k + 1) , otherwise
Step 7. If k = k max then stop. Otherwise, set k = k + 1 and return to step 5.
T
Step 8. Set y∗ = y1 ∗ y2 ∗ · · · y j ∗ · · · yn ∗ where
(  
round x j ∗ , if x j ∗ must be integer
yj ∗ =
xj ∗ , otherwise
3: Output : y∗ as minimum point
Int. J. Financial Stud. 2023, 11, 1 8 of 12

Algorithm 3. SOA for Portfolio Optimization Problem with Buy-In Threshold Constraint
1: Preliminaries:
Spiral Input Parameter: m (≥2) the number of search points, θ (0 ≤ θ ≤ 2π), r (0 < r < 1), kmax
maximum number of iterations
Portfolio Input Parameter: Rp (target return), Q (covariance matrix), ρ, µ, αi , β i (penalty
parameters), li and ui (finite lower and upper bounds of assets proportion)
2: Initialization:
Generate initial zi = (z1 (0) z2 (0) · · · zm (0)) = round(rand()),
yi = (li + (ui − li )·rand())·zi
i = 1, 2, · · · , m, in the feasible search space randomly.
3: Assign k = 0
For i = 1,2,· · · , m, find F (yi (0), zi (0))
where   T
yi (0) = yi1 (0) yi2 (0) · · · yij (0) · · · yin (0)
 T
zi (0) = zi1 (0) zi2 (0) · · · zij (0) · · · zin (0)
and !2
2 ¯T
r y
F (y, z) = yT Qy + ρ eT y − 1 +ρ Rp −1

+ ∑in=1 αi [max(0, (−yi + li zi ))]2

+ ∑in=1 β i [max(0, (yi − ui zi ))]2

with li zi ≤ yi ≤ ui zi , i = 1, 2, · · · , m
4: Find y∗ and z∗ as y∗ = yig (0) and z∗ = zig (0)
with i g = argmin F (yi (0), zi (0)), i = 1, 2, · · · , m
i
5: Update the value of yi (k) to be yi (k + 1) and zi (k ) to be zi (k + 1) as follows:
yi (k + 1) = Sn (r, θ )y(k) − (Sn (r, θ ) − In )y∗ , i = 1, 2, · · · , m
zi (k + 1) = round(Sn (r, θ )z(k) − (Sn (r, θ ) − In )z∗ ), i = 1, 2, · · · , m
6: Update the values of y∗ and z∗
y∗ = yig (k + 1), and z∗ = zig (k + 1),
i g = argmin F (yi (k + 1), zi (k + 1) ), i = 1, 2, · · · , m
i
where T
yi (k + 1) = yi1 (k + 1) yi2 (k + 1) ··· yij (k + 1) ··· yin (k + 1)
T
zi (k + 1) = zi1 (k + 1) zi2 (k + 1) ··· zij (k + 1) ··· zin (k + 1)
with
li zi ≤ yi ≤ ui zi , i = 1, 2, · · · , m
7: If k = k max , end to the program. Otherwise, choose k = k + 1 and return to step 5.
 T  T
8: Choose y∗ = y1 ∗ y2 ∗ · · · y j ∗ · · · yn ∗ and z∗ = z1 ∗ z2 ∗ · · · z j ∗ · · · zn ∗
9: Output : y∗ and z∗
Int. J. Financial Stud. 2023, 11, 1 9 of 12

Algorithm 4. SOA for Portfolio Optimization Problem with Cardinality Constraint


1: Preliminaries:
Spiral Input Parameter: m (≥2) the number of search points, θ (0 ≤ θ ≤ 2π), r (0 < r < 1), kmax
maximum number of iterations
Portfolio Input Parameter: Rp (target return), Q (covariance matrix), ρ, µ, λ, αi , β i (penalty
parameters), li and ui (finite lower and upper bounds of assets proportion)
2: Initialization:
Generate initial zi = round(rand()), yi = (li + (ui − li )·rand())·zi
i = 1, 2, · · · , m, in the feasible search space randomly.
3: Assign k = 0
For i = 1,2,· · · , m, find F (yi (0), zi (0))
where   T
yi (0) = yi1 (0) yi2 (0) · · · yij (0) · · · yin (0)
 T
zi (0) = zi1 (0) zi2 (0) · · · zij (0) · · · zin (0)

and !2
2 ¯T n 2
r y
F (y, z) = yT Qy + ρ eT y − 1 +µ − 1 + λ ∑ zKi − 1 +
Rp
i =1
h i2 h i2
n n
+ ∑i=1 αi max(0, (−yi + li zi )) + ∑i=1 β i max(0, (yi − ui zi ))
with li zi ≤ yi ≤ ui zi , i = 1, 2, · · · , m
4: Find y∗ and z∗ as y∗ = yig (0) and z∗ = zig (0)
with i g = argmin F (yi (0), zi (0)), i = 1, 2, · · · , m
i
5: Update the value of yi (k) to be yi (k + 1) and zi (k) to be zi (k + 1) as follows:
yi (k + 1) = Sn (r, θ )y(k) − (Sn (r, θ ) − In )y∗ , i = 1, 2, · · · , m
zi (k + 1) = round(Sn (r, θ )z(k) − (Sn (r, θ ) − In )z∗ ), i = 1, 2, · · · , m
6: Update the values of y∗ and z∗
y∗ = yig (k + 1), and z∗ = zig (k + 1),
i g = argmin F (yi (k + 1), zi (k + 1) ), i = 1, 2, · · · , m
i
where T
yi (k + 1) = yi1 (k + 1) yi2 (k + 1) ··· yij (k + 1) ··· yin (k + 1)
T
zi (k + 1) = zi1 (k + 1) zi2 (k + 1) · · · zij (k + 1) · · · zin (k + 1)
with
li zi ≤ yi ≤ ui zi , i = 1, 2, · · · , m
7: If k = k max , then end the program. Otherwise, choose k = k + 1 and return to step 5.
 T  T
8: Choose y∗ = y1 ∗ y2 ∗ · · · y j ∗ · · · yn ∗ and z∗ = z1 ∗ z2 ∗ · · · z j ∗ · · · zn ∗
9: Output : y∗ and z∗

5. Numerical Examples
We used a spiral optimization algorithm to solve the mixed integer nonlinear program-
ming (SOA MINLP) problem to minimize the risk of the portfolio with given expected
returns. All computations were run using MATLAB R2020b in an HP PC equipped with
Windows 10 and processor Intel(R) Xeon(R) W-2123 CPU @ 3.60GHz with 32 GB ram.
We used data from Bartholomew-Biggs and Kane (2009), which consists of five assets.
The vector of the mean return was as follows:

r = (−0.056, 0.324, 0.343, 0.132, 0.108) T

Then, the variance-covariance matrix was as follows:

−0.0222 0.5230
 
2.4037 0.2612 0.6126
−0.0222 1.8912 0.0442 0.0020 0.4272 
 
Q=
 0.5230 0.0442 1.7704 0.2283 0.3103 

 0.2612 0.0020 0.2283 4.4812 −0.1134
0.6126 0.4272 0.3103 −0.1134 7.7490
Int. J. Financial Stud. 2023, 11, 1 10 of 12

The target return was R p = 0.25%, ymin = 0.05 and penalty parameters were ρ = 108 .
We used this data to solve portfolio optimization with buy-in threshold and cardinality
constraints.
The SOA MINLP parameters that we used were as follows:
π
m = 50,000, r = 0.99, θ = , k max = 1000
32
The result of SOA MINLP with the buy-in threshold using Bartholomew-Biggs and
Kane’s data is shown in Table 1. We also show a comparison result from Bartholomew-Biggs
and Kane to solve the portfolio optimization problem with a buy-in threshold constraint
using data from Bartholomew-Biggs and Kane (2009).

Table 1. Comparison result from SOA MINLP with the result of Bartholomew-Biggs and Kane
for solving the portfolio optimization problem with a buy-in threshold constraint using data from
Bartholomew-Biggs and Kane (2009).

SOA MINLP Result Using


Quasi-Newton in DIRECT in
Equation (7) with
Stock Number Bartholomew-Biggs Bartholomew-Biggs
ymin =0.05
yi zi yi yi
1 0.1367 1 0.152 0.122
2 0.3893 1 0.381 0.369
3 0.3331 1 0.348 0.339
4 0.0911 1 0.118 0.111
5 0.0506 1 0 0.058
Risk 0.6969 0.7005 0.6935

Our result is close to that of Bartholomew-Biggs and Kane (2009), which used the
hybrid DIRECT and quasi-Newton methods. The results of the invested fractions after
20 iterations are as follows:

y1 = 0.125, y2 = 0.364, y3 = 0.344, y4 = 0.116, y5 = 0.05

with a portfolio risk of 0.6906. We can conclude that our SOA MINLP can approximate the
value of this portfolio risk.
We ran the SOA MINLP for the buy-in threshold and cardinality constraints for
50 iterations in order to obtain the best results. The results of the portfolio optimization
with a buy-in threshold constraint are presented in Table 1. The results of the portfolio
optimization with a cardinality constraint are presented in Table 2.

Table 2. SOA MINLP for solving the portfolio optimization problem with cardinality constraint
K = 5 using data from Bartholomew-Biggs and Kane (2009).

Cardinality Constraint Result Using Equation (8) with


Stock Number ymin = 0.05
yi zi
1 0.1288 1
2 0.3858 1
3 0.3267 1
4 0.0882 1
5 0.0675 1
Risk 0.6978
Int. J. Financial Stud. 2023, 11, 1 11 of 12

Based on the results in Table 1, the minimum risk is equal to 0.6969, with the given
target return as 0.25. Then, the total proportion of investment is equal to 1 with the active
stock equal to 5. We also used the buy-in threshold constraint ymin = 0.05. The results of
the invested fractions were as follows:

y1 = 0.1367, y2 = 0.3893, y3 = 0.3331, y4 = 0.0911, y5 = 0.0506

Based on the results in Table 2, the minimum risk was equal to 0.6978, with the given
target return as 0.25. Then, the total proportion of investment was equal to 1 with the
active stock equal to 5 as we used a cardinality constraint of K = 5. We also used the buy-in
threshold constraint ymin = 0.05. The results of the invested fractions of this portfolio
problem with the cardinality constraint were as follows:

y1 = 0.1288, y2 = 0.3858, y3 = 0.3267, y4 = 0.0882, y5 = 0.0675

6. Conclusions
This paper discussed the portfolio optimization problem with buy-in threshold and
cardinality constraints and tested an extension of Markowitz’s mean-variance model. We
modified the spiral optimization algorithm (SOA) to solve the mixed integer nonlinear
programming (MINLP) problem. The modification of SOA is called SOA MINLP. This
algorithm is designed to solve a constrained portfolio optimization problem. By adding
constraints to the Markowitz mean-variance model, we could capture real-world restrictions
on actual investments. We compared the results of SOA MINLP with those obtained
using Quasi-Newton and DIRECT methods. The results show that SOA MINLP can be
a tool for finding portfolio optimization solutions. We changed the constrained portfolio
optimization problem into an unconstrained one. We also added nonlinear constraints to
the portfolio problem. Therefore, we could work straightforwardly with variables. We used
metaheuristics such as SOA as a solver for unconstrained portfolio optimization problems.
SOA is a metaheuristic method famous for its speed in finding solutions to optimiza-
tion problems. For large enough data, modern techniques (such as metaheuristics) will
certainly be more effective than classical methods as they constitute a mesh-free method
that does not use the gradient to solve the problem. We gave a numerical example to
illustrate our proposed model and the effectiveness of the SOA MINLP algorithm. We
used data from Bartholomew-Biggs and Kane (2009). Furthermore, we compared our SOA
MINLP with Quasi-Newton and DIRECT methods. The results indicate that the proposed
approach is an efficient way to solve unconstrained portfolio optimization problems using
the penalty function. We can also work with a discrete variable to simulate a real-world
condition. As SOA MINLP succeeds in approximating the risk value of a constrained
mean-variance portfolio problem with a given target return, SOA MINLP can be a good
tool for solving portfolio optimization problems with buy-in threshold and cardinality
constraints.

Author Contributions: Supervision, K.A.S. and N.S.; Writing—original draft, W.F. All authors have
read and agreed to the published version of the manuscript.
Funding: This research was funded by the Indonesian Minister of Research and Technology/National
Research and Innovation Agency, Indonesia, Grant Number 2/E1/KP.PTNBH/2021 and Domestic
Postgraduate Scholarship for New College or BPPDN Afirmasi PTNB in 2019 from The Ministry
of Education, Culture, Research, and Technology, Indonesia. The Article Processing Charge (APC)
was funded by the Indonesian Minister of Research and Technology/National Research and Innova-
tion Agency, Indonesia, Grant Number 007/E5/PG.02.00.PT/2022 and Institute for Research and
Community Services Institut Teknologi Sumatera (ITERA).
Acknowledgments: The authors are grateful to the anonymous reviewers for comments and sugges-
tions which have helped to strengthen this paper. The authors also grateful to Rector of ITERA for
facilitating the funding of this paper.
Int. J. Financial Stud. 2023, 11, 1 12 of 12

Conflicts of Interest: The authors declare no conflict of interest.

References
Akbay, Mehmet Anil, Can B. Kalayci, and Olcay Polat. 2020. A parallel variable neighborhood search algorithmwith quadratic
programming for cardinality constrained portfolio optimization. Knowledge-Based Systems 198: 105944. [CrossRef]
Bartholomew-Biggs, Mike C., and Stephen. J. Kane. 2009. A global optimization problem in portfolio selection. Computational
Management Science 6: 329–45. [CrossRef]
Benasla, Lahouaria, Abderrahim Belmadani, and Mostefa Rahli. 2014. Spiral optimization algorithm for solving combined economic
and emission dispatch. International Journal of Electrical Power & Energy Systems 62: 163–74.
Cesarone, Francesco, Andrea Scozzari, and Fabio Tardella. 2013. A new method for mean-variance portfolio optimization with
cardinality constraints. Annals of Operations Research 205: 213–34. [CrossRef]
Dehghan Hardoroudi, Nasim, Abolfazl Keshvari, Markku Kallio, and Pekka Korhonen. 2017. Solving cardinality constrained
mean-variance portfolio problems via milp. Annals of Operations Research 254: 47–59. [CrossRef]
Gao, J., and D. Li. 2013. Optimal cardinality constrained portfolio selection. Operations Research 61: 745–61. [CrossRef]
Jobst, Norbert J., Michael D. Horniman, Cormac A. Lucas, and Gautam Mitra. 2001. Computational aspects of alternative portfolio
selection models in the presence of discrete asset choice constraints. Quantitative Finance 1: 489. [CrossRef]
Kalayci, Can B., Okkes Ertenlice, and Mehmet Anil Akbay. 2019. A comprehensive review of deterministic models and applications for
mean-variance portfolio optimization. Expert Systems with Applications 125: 345–68. [CrossRef]
Kalayci, Can B., Olcay Polat, and Mehmet A. Akbay. 2020. An efficient hybrid metaheuristic algorithm for cardinality constrained
portfolio optimization. Swarm and Evolutionary Computation 54: 100662. [CrossRef]
Kania, Adhe, and Kuntjoro Adji Sidarto. 2016. Solving mixed integer nonlinear programming problems using spiral dynamics
optimization algorithm. AIP Conference Proceedings 1716: 020004.
Le Thi, Hoai An, and Mahdi Moeini. 2006. Portfolio selection under buy-in threshold constraints using DC programming and DCA.
Paper presented at the 2006 International Conference on Service Systems and Service Management, Troyes, France, October 25–27;
vol. 1, pp. 296–300.
Markowitz, Merton H. 1959. Portfolio Selection: Efficient Diversification of Investments. New Haven: Yale University Press.
Sidarto, Kuntjoro Adji, and Adhe Kania. 2015. Finding all solutions of systems of nonlinear equations using spiral dynamics inspired
optimization with clustering. Journal of Advanced Computational Intelligence and Intelligent Informatics 19: 697–707. [CrossRef]
Tamura, Kenichi, and Keiichiro Yasuda. 2011. Spiral dynamics inspired optimization. Journal of Advanced Computational Intelligence and
Intelligent Informatics 15: 1116–22. [CrossRef]

Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual
author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to
people or property resulting from any ideas, methods, instructions or products referred to in the content.

You might also like