Visualizing and Optimizing Portfolio with Nonlinear Transaction Costs and Specific Constraints

In this paper, we consider the portfolio selection problem, with nonlinear transaction costs, basic constraints and probabilistic constraints. Such a problem cannot be handled by the usual quadratic or convex optimization methods. We develop a heuristic method which yields to computation of efficient (suboptimal) solution of the problem. We describe our heuristic method for finding optimal portfolio based on solving many small optimization problems over large generation number, thus we obtain a good suboptimal solution. Experimental results are demonstrated and visualized with various widely used indexes: stocks in US market: U.S. three – months treasury bills, U.S. long – term government bonds, S&P 500, Wilshire 5000, NASDAQ, Lehman Brothers corporate bond index, EAFE foreign stock index, and Gold recorded from (Jan 2000 – Jan 2008) with enhanced performance. Finally, the results suggest that nonlinear transactions costs improve considerably the value of optimal portfolio over investment period, especially for portfolio with smaller among all assets.


Introduction
Linear and nonlinear transaction costs play a particularly important role in portfolio management and represent also source of debate among financial professionals both academic and practitioner. In real financial market, assets can be bought or sold according to some specific criterion which is determined by the investor. There is a cost associated to buying or selling assets which is called transaction cost. The transaction cost can be used to model a number of costs, such as brokerage fees, bid ask spreads, taxes, or even fund loads. In this paper we shall assume the transaction costs to be non-separable and, therefore, we can represent all cost with a unique function C. When the transaction cost of a particular asset is very large, it is not advantageous to change to holding of that asset, which will then remain to its initial value, otherwise if the transaction cost is very small, it is worth making the trade and pay such a reasonable cost which could increase exponentially with large number of assets and volume of trade. Although the transaction cost has been taken into consideration by many researchers, none of them has used the exponential form of transaction cost in their work. The main objective of this paper is to address the optimal portfolio problem subject to transaction cost and understand the effect of transaction cost upon portfolio performance. The portfolio optimization with fixed transaction cost have been investigated by many researchers among which, ( Loeb T.F et al., 1993) who used a specific structure of the covariance matrices to describe the solution for a one factor model. Further (Elton E.J. et al. (2003) and (Jimbo et al. 2003) used genetic mixed / integer programming method to deal with fixed cost and other integer constraints, (Golberg D.E, 1999) and (Duan Y.C.A. 2007) used genetic mixed and integer programming method to construct heuristics method for handling fixed cost portfolio optimization. In the past, several researchers have reported findings concerning total cost, which includes a market maker's spread, price concession and commission the total cost of trading decreases with increase in market capitalization (Chang et al., 2000). This implies that for a given size of the market capitalization, the larger the size of trading, the more is the cost. Thus, the largest cost is associated with a large size of trading in small market capitalization and the smallest cost is associated with smallest trading. A solution for a portfolio optimization problem with linear transaction cost is given in (Mulvey et al., 1993). Their model assumes a diagonal covariance matrix, the budget constraint and upper bound on all assets holdings. Recent studies of the cost in in portfolio optimization include (Genott G. and Jung A. (1994) and (Jimbo et al., 2011). Those authors incorporate the transaction cost into the multi-period asset allocation problem. They solve the problem by approximating the nonlinear shape of the cost by a linear function. As mentioned in (Jimbo et al., 2011), ignoring transaction cost will lead to ineffective portfolio implementation. This is related to the complexity of the problem of searching the optimal portfolio subject to transaction cost. In this context the traditional quadratic programming approach for the solution cannot be applied anymore since the transaction cost could be nonconvex, nonlinear and/or separable function of holding of new and existing portfolio. Modelling multipored planning problem by various nonstandard methods, (Papp G. et al. 2006) use a linear approximation of a weakly nonlinear transaction cost function to investigate the effect of proportional transaction cost and then solve the problem by the dynamic programming techniques. In this work, we go beyond nice linear approximation and focus or more complex situation when the linear approximation is not applicable as it could be the case in many practical portfolio optimization problems. On the other hand, constraints play significant role in portfolio optimization. We consider here same as in (Jimbo et al., 2011) the basic or universal constraints and non-universal constraints. Under basic constraints, the weight allocated to each asset lies between 0 and 1 and they sum up to 1 which indicated a full investment. In practice, it is often the case that an investor chooses to invest a definite proportion of weights bounded by a range in specific stock and/or chooses to invest a proportion of weights in stocks related to specific sectors such as bank, energy and technology, with sum total weights in each specific sector bounded by a limit (Murtagg and Sauder 1978), (Elton et al., 2003) and (Dietmar F. 2005). To solve the optimal portfolio under transaction cost problem with such a huge class of constraints, several approaches in theory and practice have been proposed. (Jimbo et al., 2013a) proposed grouping available assets into classes based on sectors, size and geography for making a selection of K assets from each of these classes. Although this approach corresponds to traditional practice followed by portfolio managers, it yields inferior solutions due largely to its ignoring the estimated correlations between assets (Jimbo et al., 2013b). Another approach has been to make use of single agent local search algorithm such as simulated annealing and threshold accepting (Perold A.F. 1994). However, this approach suffers from the peril of getting stuck in local optima to get over which the problem had to be solved for several runs. Multi-agent methods such as Particle swarm and hybrid search approaches have also reported near-optimal or mixed results. Also, the k/means cluster analysis technique was proposed to tackle the cardinality constraint, but such investigation excluded bounding and class constraints (Golberg D.E, 1999) and (Mulvey et al., J.M. 1997). In this work, we go beyond nice linear approximation and focus on more complex situation when the linear approximation is not applicable as it could be the case in many practical portfolio optimization problems. We discuss the solution of optimal portfolio problem under exponential cost and associate complex constrained optimization problem that includes all previous constraints and Value -at -Risk (as part of the constraint on portfolio). By assuming that the transaction cost is represented with a unique function C, we use a Genetic Algorithm to solve the optimal portfolio problem. This technique has proven to be endowed with the ability to perform direct searches in potentially huge search spaces looking for optimal solutions or acceptably good solutions quickly. The remainder of the paper presents the portfolio problem subject to transaction cost in the next section, develops the portfolio optimization system to solve the proposed problem in the third section, and provides results with the portfolio optimization without transaction cost in the fourth section, followed by a conclusion in the last section.

Naive Markowitz's Portfolio Optimization Problem
Let N be the number of assets in the universe, µ the expected return of the asset i , and ij σ the covariance between the return of asset i and j in the historical data. We acknowledge that the stock portfolios have observable price in the market, the looking-period -forward is the assumed to be adequately proxied by historical data (see Jimbo et al., 2011). However, a discussion on adjusted GA approach acting as inherent noise filters in eliminating the noise embedded in the covariance matrices of stock portfolio will be carried out in section four of this work. Let be the proportion of capital to be invested in asset and be the number of assets in which the investor decides to invest his capital.
Using the above notation, the expected stock portfolio return is given by We define a risk aversion parameter to present what is known as the weighted formulation of the portfolio optimization problem. A closed observation of λ reveals that when it is closed to zero, the weight shift toward stocks yielding high returns and when closed to one, the weights shift toward combinations of stocks yielding low volatility in the efficient set.

Portfolio Optimization with Stochastic Constraints
Portfolio optimization with stochastic constraints was developed in (Jimbo et.al. 2011), and further extended results were presented in (Jimbo and Craven, 2013). The optimizing portfolio of finitely many assets is an important problem in computational finance. It is generally agreed that portfolio performance should be measured into two distinct dimensions; the mean describing the expected return rate and the risk which measures the uncertainty of the return rate. In the mean risk universe approach, we select from the universe of all possible portfolios those that are efficient for a given value of mean that minimise the risk. Or equivalently for a given value of risk, they maximise the return. This approach allows one to formulate the above problem in a parametric optimization context which facilitates the trade-off analysis between mean and risk.
A. Fitness C. Subject to: vi-Cardinality constraints

Portfolio Optimization Problem under Exponential Transaction Costs
The optimizing portfolio of finitely many assets is an important problem in computational finance. It is generally agreed that portfolio performance should be measured into two distinct dimensions; the mean describing the expected return rate and the risk which measures the uncertainty of the return rate. In the mean risk universe approach, we select from the universe of all possible portfolios those that are efficient for a given value of mean they minimise the risk. Or equivalently for a given value of risk, they maximise the return. This approach allows one to formulate the above problem in a parametric optimization context which facilitates the trade-off analysis between mean and risk. In this work, we extend the standard notation in (Jimbo et al., 2011); we include the matrix weights representation and some new prospective to the model.

Modelling and Problem Formulation
We set the fitness function Minimization Problem Where a) is the weight constraint; b) is the stochastic constraint and c) the cardinality constraint. Such problem cannot be solved analytically. We propose an efficient computational approach called Genetic Algorithm (GA), which is part of evolutionary algorithm representing a powerful tool for obtaining optimal solution for complex optimization problems.

Genetic Algorithm Based Approach
The Genetic Algorithm (GA) is a metaheuristic designed to find, generate, or select a heuristic (partial search algorithm) that may provide a sufficiently good solution to an optimization problem, especially with incomplete or imperfect information or limited computation capacity. Metaheuristics sample a set of solutions, which is too large to be completely sampled (  reproduction of the offspring by genetic operators-crossover and mutations. Markowitz's original work was based on the rule that the investor does not consider expected increases in return as a desirable and the variance undesirable. Of course, this works well under specific assumptions and constraints on the optimization problem. The quadratic programming approach is used in an elegant way to find the solution. But when these assumption are relaxed, the need to look for new methods to attack the problem becomes imminent. In this work, we propose a genetic algorithm (GA) method for portfolio optimization with transaction cost. The proposed GA starts with a population of randomly generated solutions called chromosomes to explore the solution space of a problem. Then, the GA searches improvement of solutions through the number of iterations called generations. The performance of each solution is evaluated by a fitness function, which always contains the objective function. In each generation, relatively good solutions have the higher chance to be selected for reproduction of the offspring by genetic operators-crossover and mutations (Jimbo et al., 2013a, 2013b). Here, constraints will be incorporated in the code by simple restriction on the parameters that are used in the model.

Algorithm
The algorithm for solving GA is presented in detail in this section.
Input: Instance X and random initial weight matrix 0 w with n k − zeros row at random positions and each row sums to 1.

B -Genetic Algorithm Operations
• Operations: There are on weight matrices w=(wi) from the population. There is also a feasibility operator.

Experiments and Results
To illustrate the features of the GA portfolio approach developed in this paper (GA-optimizer), we consider the historical data of return of eight assets in eight years. The assets are widely used indexes: U.S. three -months treasury bills, U.S. long -term government bonds, S&P 500, Wilshire 5000, NASDAQ, Lehman Brothers corporate bond index, EAFE foreign stock index, and Gold. In mathematical interpretation, this data is an 8 by 8 matrix, where columns represent assets and rows are value of the   A d v a n c e s i n I m a g e a n d V i d e o P r o c e s s i n g ; V o l u m e 8 , N o . 1 , F e b r u a r y 2 0 2 0   S o c i e t y f o r S c i e n c e a n d E d u c a t i o n , U n i t e d K i n g d o m   11 asset in a given year. By multiplying each asset by the corresponding weight and summing each row, we obtain the portfolio value at the given year. Finally, comparing the highest portfolio value will guide us to the best construction possible. In the next section, we will present our results in exhibit 1 to 5 using the above data.

Results and Comparisons on Efficient Frontiers
We now compare the obtained efficient frontiers. The results are shown in exhibit 2 with comment of the findings.

Figure 1: Cost of best mean and worst weight matrices and Mean portfolio value over generation time
The combinations along the upper edge represent the mean, best and worst weights matrices over generation time. It can be seen that as the mean portfolio value increases, the means transaction cost also increases. This indicates a perfect correlation between both variables. Also the increase in mean portfolio value slows down faster (around 500 generation time) than the mean transaction cost (after 500 generation time), such a split may effectively control the portfolio optimal boundaries. Jimbo Henri Claver, Jawad Azimi, Bianca Chenwi and Ngongo Isidore; Visualizing and Optimizing Portfolio with Nonlinear Transaction Costs and Specific Constraints, Advances in Image and Video Processing, Volume 8 No 1, February (2020); pp: 5-16 The number of portfolios in the efficient frontier increases sharply over generation time and stabilized after 2000 generation periods. We observe a perfect correlation between the mean optimal portfolio value and the mean transaction cost over time. This observation reinforces the conviction that efficient constraints and transaction cost are important tool used to control the portfolio performance over time. The 3-D plot visualization of weights at all time of the minimal cost portfolio over 50, 1000, 2000 and 2500 generation periods. It can be seen that a slow increase in the weight matrices over generation time or optimal portfolio values, but such increase is stops after 2000 generation periods.

Data
Data are recorded on the tables below

Discussion
We have performed the GA -optimizer on eight real world assets, using eight possible realisations of their join return rates. Historical data from weekly return in eight years from 2002 to 2010 were used as likely realisations. Although our method performs very well and converges to optimal solution in 100 generations depending on the case, we have still not yet investigated the kind of improvement we may have when drastically increase the number of assets and number of generations and also how the optimal solution will react to both simultaneous increase and decrease of return and risk. Another question is whether we could have any direct relationship between assets correlation and algorithm performance in a time dependent setup and/or how we can improve the accuracy of the multi-period portfolio problem.
It will be interesting to work on these extensions of the present results in the future investigations.

Conclusion
The objective of this paper was to address the portfolio optimization problem subject to exponential transaction costs and examine the effects of the transaction costs on the derived optimal portfolio, along with visualisation of the obtained solutions. By incorporating the exponential transaction cost function directly into the fitness function, we set up a more realistic framework for the optimal solution. The proposed problem has nonlinear transaction cost and stochastic constraints, thus the genetic  algorithm can be applied to solve the problem. The usual strategy to deal with the transaction cost problems has been to use additional constraints and linear conditions. However ignoring transaction cost will often lead to inefficient optimal portfolio. Finally, we found that the Genetic Algorithm has the following interesting features important for quantitative finance: • GA reassures a higher chance of reaching a global optimum by starting with multiple random search points. • GA uses efficiently crossover to exchange attribute among potential solutions.
• GA is fast converging reproducing the process of suboptimal solutions.
Since searching such solution was achieved after few generation runs with reasonable computational time, we decided to compare the result with exponential transaction with our previous result without transaction cost. We uncovered that there is some statistically significant difference in the portfolio performance when the transaction cost is implemented. In this respect, transaction cost may play a role of regularization for portfolio rebalancing over time. Future direction of the research includes the investigation of new strategies for improving the performance of the GA optimizer by either combining the features of different algorithms or modelling constraints of investor's preference as well as market norms or to introduce new forms of transaction cost functions and more flexible algorithms.