Extremal Swaps Algorithm for Selecting the Optimal - ACMPT-2017

UDC 336:51(075.8)
Extremal Swaps Algorithm for Selecting
the Optimal Portfolio with Commission
M. S. Al-Nator∗ , S. V. Al-Nator∗
∗
Department of Data Analysis, Decision Making, and Financial Technology,
Financial University under the Government of the Russian Federation,
Leningradsky Prospekt 49, Moscow, 125993, Russia
Abstract. We consider the problem of finding the optimal portfolio with twosided constraints for weights and with commission. The complete algorithmic
solution of the problem is given for the Markowitz model (for portfolios without
short positions). A heuristic algorithm for solving this problem for the Black’s
model (for portfolios with short positions) is proposed.
Keywords: portfolio, portfolio return, portfolio return with commission, optimal portfolios, long position, short position.
1.
Introduction
Under uncertainty the financial analyst usually considers the most
likely scenarios of the possible completion of the transaction. In that
case, the analysis of individual scenarios is carried out under certainty.
The condition of certainty means that the investor knows both the current
and future prices (based on price forecasts) of assets and income. The
investigation of portfolio transactions under certainty is definitely useful
and widely used by accountants and auditors in the analysis of closed
transactions.
In what follows we distinguish between two portfolio types (models).
The first model we call the Black’s model. For this model the short positions are allowed. The second model we call the Markowitz model. It
is characterized by prohibition on short positions. It is significant that
unlike the ideal case without commission, the task of choosing the optimal
portfolio for Black’s model is unsmooth.
We consider the problem of finding the optimal portfolio with twosided constraints for weights and with commission under certainty. For the
Markowitz model a complete efficient algorithmic solution of the problem
is proposed. A heuristic efficient algorithm for solving this problem for the
Black’s model is also proposed.
Portfolio analysis with commission under uncertainty was investigated
in detail in [3]– [7].
2.
Assumptions and notation
In what follows, we consider one-period portfolio transactions with a
fixed and finite investment horizon. In addition, we consider only the
investment portfolios i.e. portfolios for which the proceeds from the short
sales do not cover the costs of opening the long positions of the portfolio.
For simplicity, assume that the dividends will not be paid separately. Note
that under certainty the rational investor chooses portfolio with the highest
return.
Suppose that we have n assets A1 , . . . , An . Let rk denotes the price
return of Ak .
The portfolio will be denoted by the vector of asset weights
x = (x1 , . . . , xn ) :
n
X
xk = 1 (the budget constraint).
k=1
If there are no commission costs, it is well known (see [8], [1] or [2])
that the portfolio return r(x) is the weighted average of the individual
asset returns
n
X
xk rk .
r(x) =
k=1
The investor can not quite arbitrarily choose these weights for two
reasons. First, the portfolio weights must satisfy the budget constraint.
Secondly, in many markets there are strict limitations on the size of short
positions. For example, institutional investors such as insurance companies, pension funds and some credit institutions are obliged to adhere to
legislation requirements for assets weights of different classes (such as government securities, shares of companies, real estate etc.)
Hence, in general form the task of selecting the optimal portfolio under
certainty can be formulated as follows:
Let X = {(x1 , x2 , . . . , xn ) ∈ Rn |x1 + x2 + . . . + xn = 1} be the set
of all portfolios. For given returns r1 , r2 , . . . , rn select the portfolio x∗ =
(x∗1 , x∗2 , . . . , x∗n ) with maximum return r(x∗ ) = max{r(x)|x ∈ D ⊆ X ⊂
Rn }. Here D is the set all admissible portfolios.
Specifying the class of admissible portfolios defines a particular optimization problem. Usually this class is defined by a system of equations
and inequalities.
3.
Main results
First we consider the problem of selecting the optimal portfolio with
two-sided constraints and no commission. This problem is not trivial, but
not difficult to solve in practical terms (see Remark 4 below). This problem
is formulated as follows.
Problem 1. For given returns r1 , r2 , . . . , rn and a = (a1 , . . . , an ),
b = (b1 , . . . , bn )
maximize r(x) = r1 x1 + r2 x2 + . . . + rn xn
subject to
x1 + x2 + . . . + xn = 1,
(1)
a1 ≤ x1 ≤ b1 , a2 ≤ x2 ≤ b2 , . . . , an ≤ xn ≤ bn .
(2)
The following theorem [1] contains the necessary and sufficient condition for the solution existence of problem 1. Let A = a1 + a2 + . . . + an
and B = b1 + b2 + . . . + bn .
Theorem 1. The problem 1 has a solution if and only if A ≤ 1 ≤ B.
Moreover, when A 6= B an admissible portfolio can be found by the formula
1−A
(b − a).
x=a+
B−A
Note that if A = 1 (respectively, B = 1), then a (respectively, b) is an
admissible portfolio.
If the portfolio transaction is opened with a commission α and closed
with a commission β, then according to [3] (see also [4], [5]), the portfolio
return has the form
!
n
n
X
X
1
rα,β (x) =
xk rk −
(α + β + βrk )|xk | .
n
P
k=1
1+α
|xk | k=1
k=1
Remark 1. In [3] (see also [4]) the complete solution of the wellknown problem of finding explicit formulas for the expected return and
risk of portfolios with general commission was presented. It was assumed
that the commission depends on the asset and the asset position, and on
whether the given position is opened or closed.
Now consider the case when the investor can open only long positions
(the Markowitz model), in other words, the investor forms portfolios with
non-negative weights. In that case, the optimization problem 1 is formulated as follows
Problem 2. For given returns r1 , r2 , . . . , rn and ai ≥ 0, bi ≤ 1, i =
1, 2, . . . , n
maximize rα,β (x) = aα,β r(x) − bα,β
1−β
subject to (1) and (2), where aα,β = 1+α
, bα,β = α+β
1+α .
Recall that the linear function (note that the portfolio return is a linear
function of the portfolio weights) has the largest value on the boundary
of the function domain. Since there are one equality constraint and 2n
inequality constraints, then, at least, n − 1 components of the optimal
portfolio must satisfy the boundary conditions. The solution of Problem 2
(under the conditions of Theorem 1) may be found efficiently by a general
algorithm (the so called Extremal Swaps Algorithm).
Indeed, suppose that for an admissible portfolio x there exists a pair
of components xi and xj , that do not satisfy the boundary equalities, let
for example xi < bi and aj < xj . Assume also that rj < ri . Then the
swap (or exchange) of the assets Ai and Aj is possible. This swap allows
to increase the portfolio return. The main idea of the swap is to sell an
amount (not necessary integer) of the asset Aj (i.e., we decrease the weight
xj by a certain amount h > 0) and to buy Ai on the amount of revenue
from the sale of Aj (i.e., we increase the weight xi by the same amount
h > 0). It is easy to see that the swap preserves the budget constraint.
Note that the swap will preserve the boundary conditions, if h satisfies
the inequalities aj ≤ xj − h and xi + h ≤ bi or, equivalently h ≤ xj − aj
and h ≤ bi − xi . The swap increases the portfolio return by the value
∆rij = haα,β (ri − rj ) > 0. At the same time the extremal swap with
h = min{xj − aj , bi − xi } gives the greatest growth of the portfolio return.
Remark 2. If all assets have the same return: r1 = r2 = · · · = rn = r0
then for the Markowitz model all portfolios have this return: rα,β (x) =
aα,β r0 − bα,β . In that case, the investor is indifferent to the choice of
a particular portfolio, provided that the received return is positive and
satisfactory for the investor.
Remark 3. Let ri = max {rk } and bi = 1. Then the Problem 2
k=1,...,n
admits a trivial solution. Namely, the investor invests all the money in
the asset Ai with the highest return, provided that the received return is
positive and satisfactory for the investor.
Let us consider the case when the investor can open short positions
(the Black’s model). Then the optimization problem 1 is formulated as
follows
Problem 3. For given returns r1 , r2 , . . . , rn and a = (a1 , . . . , an ),
b = (b1 , . . . , bn )
!
n
n
X
X
1
xk rk −
(α + β + βrk )|xk |
maximize rα,β (x) =
n
P
k=1
1+α
|xk | k=1
k=1
subject to (1) and (2).
Under the conditions of Theorem 1 the problem 3 always has a solution, since one seeks the maximum of a continuous function on a compact
set. Note that the return of the optimal portfolio should be positive and
satisfactory for the investor.
To solve this problem, we propose the following heuristic algorithm.
Renumber the assets so that their returns are located in nonincreasing
order: r1 ≥ r2 ≥ . . . ≥ rn . Apparently, in a typical situation the optimal
portfolio x∗ = (x∗1 , x∗2 , . . . , x∗n ) has the following property: there is a k such
that x∗1 , x∗2 , . . . , x∗k ≥ 0 and x∗k+1 , . . . , x∗n ≤ 0. This allows to reduce the
solution of the Problem 3 to the solution of n smooth problems. Namely,
for each k = 1, 2, . . . , n we solve the Problem 3 under the conditions that
x1 , x2 , . . . , xk ≥ 0 and xk+1 , xk+2 , . . . , xn ≤ 0 and then we choose the
solution with the highest return from the resulting n solutions.
Remark 4. If α = β = 0 then the Extremal Swaps Algorithm is
applicable to Black’s model. Moreover, for the Markowitz model, the
solution of Problem 2 coincides with the solution of a similar problem
without commission.
References
1. Al-Nator M. S., Kasimov Yu. F., Kolesnikov A. N. Fundamentals of
financial calculations, part 2 (in Russian). — Financial University Publishing House, Moscow, 2013.
2. Kasimov Yu. F., Al-Nator M. S., Kolesnikov A. N. Fundamentals of
financial calculations: Basic financial transaction calculation schemes
(in Russian). — KnoRus, Moscow, 2017.
3. Al-Nator M. S. Portfolio analysis with general commission // Materials
of XXXIII International Seminar on Stability Problems for Stochastic
Models, OP&PM, 2016, Vol 23, Issue 2. — P. 140–141.
4. Al-Nator M. S. Portfolio analysis with general commission // J Math
Sci (to appear).
5. Al-Nator M. S., Al-Nator S. V., Kasimov Yu. F. Portfolio analysis with
transaction costs under uncertainty // J Math Sci, 2016, Vol 214, No.
1. — P. 12–21. doi:10.1007/s10958-016-2754-9.
6. Al-Nator M. S. On the choice of an optimal portfolio with commission
for the markowitz model // Materials of All-Russian conference with international participation Information and telecommunication technologies and mathematical simulation of hi-tech systems (in Russian), 2016,
Moscow, RUDN University. — P. 214–216.
7. Al-Nator M. S., Al-Nator S. V. Analysis of two-dimensional portfolios
with commission under uncertainty // Materials of All-Russian conference with international participation Information and telecommunication technologies and mathematical simulation of hi-tech systems (in
Russian), 2016, Moscow, RUDN University. — P. 217–219.
8. Luenberger D. G. Investment science. — Oxford University Press, New
York 2013.