Abstract
Purpose
The purpose of this paper is to implement a genetic algorithmic geared toward building an optimized investment portfolio exploring data set from stocks of firms listed on the Nigerian exchange market. To provide a research-driven guide toward portfolio business assessment and implementation for optimal risk-return.
Design/methodology/approach
The approach was to formulate the portfolio selection problem as a mathematical programming problem to optimize returns of portfolio; calculated by a Sharpe ratio. A genetic algorithm (GA) is then applied to solve the formulated model. The GA lead to an optimized portfolio, suggesting an effective asset allocation to achieve the optimized returns.
Findings
The approach enables an investor to take a calculated risk in selecting and investing in an investment portfolio best minimizes the risks and maximizes returns. The investor can make a sound investment decision based on expected returns suggested from the optimal portfolio.
Research limitations/implications
The data used for the GA model building and implementation GA was limited to stock market prices. Thus, portfolio investment that which to combines another capital market instrument was used.
Practical implications
Investment managers can implement this GA method to solve the usual bottleneck in selecting or determining which stock to advise potential investors to invest in, and also advise on which capital sharing ratio to reduce risk and attain optimal portfolio-mix targeted at achieving an optimal return on investment.
Originality/value
The value proposition of this paper is due to its exhaustiveness in considering the very important measures in the selection of an optimal portfolio such as risk, liquidity ratio, returns, diversification and asset allocation.
Keywords
Citation
Adebiyi, S.O., Ogunbiyi, O.O. and Amole, B.B. (2022), "Artificial intelligence model for building investment portfolio optimization mix using historical stock prices data", Rajagiri Management Journal, Vol. 16 No. 1, pp. 36-62. https://doi.org/10.1108/RAMJ-07-2020-0036
Publisher
:Emerald Publishing Limited
Copyright © 2020, Sulaimon Olanrewaju Adebiyi, Oludayo Olatosimi Ogunbiyi and Bilqis Bolanle Amole.
License
Published in Rajagiri Management Journal. Published by Emerald Publishing Limited. This article is published under the Creative Commons Attribution (CC BY 4.0) licence. Anyone may reproduce, distribute, translate and create derivative works of this article (for both commercial and non-commercial purposes), subject to full attribution to the original publication and authors. The full terms of this licence may be seen at http://creativecommons.org/licences/by/4.0/legalcode
1. Introduction
Portfolio optimization remains one among the essential info for investors before they create an investment selection attributable to its direct relationship with the performance of a corporation. The term portfolio refers to the mixture of assets having come and risk characteristics of their own, that conjure a portfolio (Donald and Ronald, 2013). The performance of a corporation refers to the result of the activities of people and units of a firm. This will be measured in numerous ways in which betting on the aim that the data is needed. Among the foremost basic tenets of the trendy money theory are that managers ought to act in a manner per maximizing the worth of owners’ equity (Naqvi et al., 2016). For the banking system, business banks are by massive thought to be one of the most effective savings semen investment themes (Al-Tarawneh and Khataybeh, 2015).
Portfolio improvement has returned a protracted manner, and far from its evolution copied back within the USA. The USA mortgage market was primarily imploded between Gregorian calendar month and August 2007. The money crisis of 2007 modified the manner most functions at the money establishments operate and portfolio management is not any exception. The historical role of portfolio management remains. However, new restrictive necessities, particularly regarding capital adequacy and liquidity, increasing value and margin pressure, and altered market conditions have pushed portfolio management into a broader role and also they ought to align closely with alternative areas, such as finance, treasury, risk information and methodology and business-origination functions (Bank for International Settlements, 2015).
Strategic allocation is that the strategy of dividing your investment portfolio across varied stocks. Asset allocation is the selection on the way to invest in these broad plus categories to satisfy one's semi-permanent goal. The distributions can vary over time because of changes within the investment opportunities, the investment horizon and the semi-permanent economics risk factors like inflation and interest rates.
It has become necessary for the desirable managers of monetary services corporations to be at the forefront of development so as to boost the performance of their assets beneath management on top of that of their competition, whereas providing socially accountable merchandise and thence redistributing a number of the profits to specific target teams. Diversification is another crucial portfolio management strategy in money. This approach is additionally essential for investors. As investors will diversify their investment portfolio to extend the performance and to cut back the portfolio risk.
Portfolio management is among the numerous challenges facing investors and these individuals have without aim endowed heavily in unrelated areas that embody securities, properties, mortgages and loans. Creating a portfolio selection is one of the numerous policy problems in any investment trust. Investment associate in a very portfolio provides a sexy choice to investment trust because it permits for maximization of returns and minimization of risks in comparison to investment in white securities therefore the requirement to form an intelligent portfolio selection.
The outcome of this study can offer smart data that may change investors to accumulate and maintain a property competitive advantage and increase their market share through new market enlargement. This would possibly inform investors in Nigeria to take advantage of the economy of scale resulting in improved performance. It will additionally guide investment managers in creating investment selections for his or her companies. They request to extend the penetration quantitative relation within the market. Firm performance is thus stricken by the selections created by these managers. This study would possibly, be of help to them because it would possibly facilitate them to execute their role with efficiency and have the proper investment portfolio for his or her firm.
This study also will be helpful to regulative authority’s particularly financial institutions in Nigeria likes the Nigerian Security and Exchange Commission within their role of guaranteeing that there is an honest play within the market by all relevant market players in the trade. As most investment organizations pay annual bonuses to the shareholders who support the performance recorded within the preceding fiscal year, with attempts to vary the payments supported an individual’s contribution. The earnings shortfalls recorded by shareholders within the last fiscal year resulted from a mixture of things among them deteriorating portfolio optimization challenges. The study recommendations would possibly strengthen the performance stock prices in the market.
The analysis provided a background for future analysis of investment portfolio optimization in Nigeria. It will serve as a reference for future researchers on investment portfolio optimization. This study illustrates investment portfolio optimization for investors within the exclusive corporations listed on the Nigerian stock market; as a model for future investment portfolio optimization for investors.
2. Literature review
2.1 Genetic algorithmic rule
The genetic algorithms (GA) taking “survival of the fittest” approach as a basis were initially developed by Hollan and his students in the 1960s and 1970s (Holland, 1975; Küçüksille, 2009) with the basic idea evolving a group (also called generation) of possible candidate solutions (also called chromosomes) to any problem at hand, using several operators (such as crossover, mutation and/or inversion) which are inspired by natural selection and evolution theory proposed by Charles Darwin (Wang, 2001). It explains the processes of the naturally operating systems, to develop software package using such natural systems (Emel and Taşkın, 2005, p. 6) and useful in quite a wide range of areas of human endeavor that can be characterizes as system by yielding very fast and reliable results (Can and Gersil, 2017). GA is a family of evolutionary computing meant for solving combinatorial optimization problems which is understood as an area of computer intelligence (Urbšienė and Dubinskas, 2017). GA mimic the biological process in nature (Bolat et al., 2004, p. 264). It is an approach created to attain vital discoveries each in natural and artificial systems (Holland, 1975). According to Urbšienė and Dubinskas (2017), there are advantages of GA application in optimizing the investments portfolio. These includes:
These algorithms work with a set of parameters, rather than with each parameter separately.
A parallel search can be carried out for the optimal solution through a number of points, not through a single point.
A direct presentation of the problem domain could be used without any additional parameters.
Probabilistic rules may be used instead of deterministic search algorithms” (Augusto et al., 2006; Plikynas and Daniušis, 2010).
Thus, the operational principle of the GA as reported by Daş et al. (2006); Can and Gersil (2017) and applied in this study are as follows:
“Generating a random initial resolution area. Here, the answer area is within 0–1.
Generating an objective perform for the matter that is desired to be solved and subjecting the weather within the resolution area to the therefore generated objective perform, dominant whether the individual is match or not. The fitness perform, on the opposite hand, is to make your mind up on whether the worth is acceptable for the determined solutions.
The people in resolution area unit applied choice method succeeding being subject to the target perform and the fitness performs. There exist completely different approaches to choose method, for example, elitism and game equipment.
Crossover is performed for making new people out of the chosen people. One or many of crossover strategies such as single purpose, multiple purposes is applied.
Mutation is applied to the people once crossover method. Same method is applied for ever-changing the search direction. It should be applied at a particular magnitude relation.
New people area unit generated, in any case, these strategies, replacement the recent people with the new ones within the resolution area.
As a result, the fittest individual(s) is/are elite within the calculation of the population, and therefore resolution the matter”.
Over the years several models of portfolio optimization have evolved, several studies are done on portfolio management, as an example is the study by Chang (2014), investigation whether/not and the way companies within the retail trade sector might profit by spreading their boundaries inside and across regional boundaries. They found that, the intra-regional diversification contains a parallel S-curve relationship and interregional diversification has an S-curve reference to firm performance. They established that unrelated product diversification has an adverse analgesic result on the connection between inter-regional diversification and firm performance. In the work of Yijun (2014), on the result of credit risk administration practices influences on the profitableness performance of European industrial banks in Europe. The study inferred that there's an affiliation among come back on assets (ROA) of investment firm.
Furthermore, Cacho and Simmons (1999) enforced a genetic algorithmic rule to make a farm portfolio model. The farm portfolio model is such with two risky enterprises and a riskless quality which can be control in the short or long-run by the farmer. The model resolved numerically employing a GA rule. The result shows that the idea of competitive adaptation ends up in a violation of normative potency. Those that survive are not the foremost economical in an exceedingly normative sense. A similar work using GA was done by Hou et al. (1994), who enforced a GA rule for digital computer planning. The study used an economical methodology supported GA to unravel the digital computer planning downside. Thus, the illustration of the search node was supported the order of the tasks being dead in every individual processor. The genetic operator planned was supported the precedence relations between the tasks within the task graph. In addition, a simulation results scrutiny the planned GA rule, the list planning algorithmic rule, and the best schedule mistreatment random task graphs, and a mechanism inverse dynamics machine task graph.
According to Shadrokh and Kianfar (2007), an enforced genetic algorithmic rule for finding a category of project planning issues is also known as resource investment downside. The timing of project is allowable with outlined penalty thereby making parts of algorithmic rule like body structure, unfitness operate, crossover, mutation, immigration and native search operations to be explanatory. The performance of this GA rule was compared with the performance of different revealed algorithms for resource investment downside. Moreover, 690 issues square measure resolved, and their best solutions square measure used for the performance tests of the genetic algorithmic rule which was quite satisfactory.
Lin et al. (2004) enforced GA rule to securities market data processing and it absolutely was inferred that GA loses little or no exactitude, however, save heaps of time period. So, it is used in a true analysis system, and the results just like the best one. It may also be used as a basic tool for different application, such as ranking mercantilism rules.
The term portfolio deals with the issues around how best could investors or potential investors allocate theirs wealth among stocks or any assets in anticipation for returns. According to Chang et al. (2009), the portfolio optimization problems have been one of the important research fields and concerns to practitioners in the modern risk management. As investors generally always prefers to have the higher return on their portfolio with lower risk as small as possible. Conversely, a larger return in most investment always comes with almost commensurate if not a higher risk. Yılmaz and Kucuksille (2014), therefore, submitted that optimization is an effort of generating solutions to a problem under bounded circumstances with a desire to use existing resources in the best possible way.
In this paper, therefore, we used GA to search out the higher parameter price combination in an existed mercantilism rule. From the result, GA algorithmic rule performed higher than the manual methods. Extensive research studies on investment portfolio optimization revealed several efforts made both in Nigeria and globally by researchers to identify key influencers that could impact a portfolio mix. The major problem highlighted in building a competitive portfolio mix are selection of investment/eligible stock that guarantee high returns amidst mitigating lower risk and how asset should be allocated based on the optimized selection. This study takes the approach of using artificial intelligence model in building an investment portfolio optimization mix using historical data of stock prices, which is believed to reflect almost all dynamics that could affect a business, as far as researchers are aware, it is the first study in Nigeria that construct optimum portfolios from NSE top 30 indexes using GA framework.
3. Data and methodology
All stocks from 167 companies listed on the Nigerian Stock Exchange Market between (July 1, 2014–July 1, 2019) formed the population of this study. The study relies on stratified secondary data that groups stocks based on Market capitalization and liquidity ratio. In addition, a total of top 30 companies on the 2019 NSE 30 Index made up the sample size for this study. Closing price of stocks of these 30 companies from July 1, 2014 to July 1, 2019 were collected and analyzed.
Historical figures for each stock between July 1, 2014–July 1, 2019 was collected from an online secondary source (investing.com) a leading platform where investors visit regularly for insight on investment options. Time series trends and data visualization/descriptive statistics of data are performed using power business intelligence (BI) analytics software.
A constrained Sharpe ratio function was implemented to calculate return on investment while a GA enforced using R-programming analytics platform to predict the optimum allocation of asset that yields the most stable curve from all possible return on investment curves. The algorithm predictive capability was tested for a five-year period (June 1st, 2014 – July 1st, 2019). Stock directional movement prediction performance was also assessed. Thus, portfolio optimization using GA will rely on post-hoc information.
3.1 Portfolio composition
The investor has selected N financial assets he/she wants to invest in. They can be stocks, funds, bonds, treasury bills and so on; moreover, this research focuses on stocks alone. Each one of them has many historical returns that are the price relative difference from one period to another. Periods can be days, weeks, months, etc. The return of the i-th asset between period t and period t−1 is defined as:
To build an investment portfolio, involving many stocks mixed together, allocating a fraction x of our capital to each one of them. Each fraction is called weight.
The portfolio return at time t is then:
The goal of our portfolio optimization is to find the values of the weights that maximize some performance metric of our portfolio according to the weight’s constraints, which are:
This then makes the problem a constrained optimization problem.
3.2 Objective function
Using the Sharpe ratio, defined as:
where E(p) is the expected returns and E(r) is the risk-free returns and Var(p) is the variance.
For this research, we will not be considering the risk-free return.
So, the portfolio shape ratio formula to be used is:
3.3 Constraints
Our weight must be positive. The sum must be equal to 1 to cover our entire capital
3.4 Penalty function
Our inequality constraints give us the following penalty functions:
It is useful to square the penalty function to make it completely different from each other.
Our equality constraints then become:
We are transforming a constrained problem into an unconstrained one, so we are forcing the global minimum search. Multiplying the penalty function by a number, it is usually 10, but we will be multiplying by 100 to enhance the optimization mix. So, the final function we must minimize to have our optimal return as follows:
Thus, the GA has been used to optimize the Sharpe function (Sharpe, 2000) (Table 1).
4. Results of analysis
Over a five-year period stocks from six companies (Okomu, Presco, Mobil, Nestle, IBTC, Guaranty and DANGSUG are likely to be profitable (Table 2, Figure 1).
Building a portfolio mix of the NSE top 30, after (3030 Iterations) the asset allocation distribution from the optimized Sharpe ratio function using GA was generated, and the optimization technique advised that for an investment portfolio consisting of NSE top 30, 8% of the investment capital should be allocated to Unilever, 6.3% to international breweries, 6.2% to PZ, 5.2% to Nigerian breweries, 4.7% to UBA […] […] […] […] and 0.4% to Dangote sugar.
4.1 Optimal investment returns
4.1.1 Optimal returns against individual returns.
From the analysis above, drawing a comparison between the optimal returns, that is, anticipated result using the optimum allocation and individual returns, we could observe that the optimal returns performed more than 60% of the individual returns and the optimal returns curve is the most stable curve compared to the individual returns curve. From the optimal returns curve the investor is likely to have the 29% profit margin at peak performance and −46% losses at worst.
4.2 Finding the right mix (reducing the portfolio size)
It could an arduous task for an investor to invest in 30 stocks at once and monitor profit overtime, hence this research further tried to optimize the investment portfolio by further using a portfolio mix of not more than 5 stocks, although these will expose the investor to an higher risk as compared to the earlier NSE 30 mix. The selection was done according to the best five performing individual stocks and the top five stocks according to the optimal investment allocation result from the GA (Table 3).
4.3 Findings from reduced portfolio mix
4.3.1 Sample A.
The optimized Sharpe ratio Function using GA performs better than two other individual stocks (NB and PZ) and shares similar return with another stock (Unilever) while international breweries and UBA perform better than the optimal. An investor allocating capital to this portfolio is advised to allocate 28.8%, 26.1%, 24.3%, 11% and 9.3% to international breweries, Unilever, UBA, PZ and Nigerian Breweries, respectively. Investing in these portfolio mixes using the optimum allocation will likely yield 70% profit at peak performance and −44% losses at worst.
4.3.2 Sample B
4.3.2.1 Optimum returns vs individual return.
4.3.2.1.1 Optimum allocation of asset
The optimized Sharpe ratio using GA, performs better than three other individual stocks (Nestle, Mobil and Stanbic IBTC) while Okomuoil and Presco perform better than the optimal. An investor allocating capital to this portfolio is advised to allocate 23.8%, 20.8%, 19.7%, 18.9% and 16.9% to Stanbic IBTC, Okomuoil, Presco, Nestle and Mobil, respectively. Investing in these portfolio mixes using the optimum allocation will likely yield 99% profit at peak performance and −16% losses at worse (Figure 7).
From the analysis conducted, the model suffice in optimizing Sharpe ratio function for different investment portfolio mix considered (NSE top 30, Sample A and Sample B) and analysis result shows three optimal result while Sample B is likely going to yield the highest profit should an investor consider building a portfolio.
From the analysis, it is evident that investing in stocks across different sectors will enhance the performance of our investment portfolio. From the optimal portfolio mix, an investor is advised to look at the financial, agriculture and oil and gas sectors when considering diversification (investing in stocks from different sectors). This is in line with Chakrabarti et al. (2007), who argues that diversification contributes to improving performance in investment.
From the analysis, it is evident that optimal allocation of asset will enhance performance of our investment portfolio. As it is evident in Figures 1–6, while some stocks perform better than the optimized function, some also performed poorer. However, optimum allocation of asset within the portfolio mix will ensure a greater percentage of our asset is allotted to best-performing stocks and a lower percentage to stocks with lower performance as a way of minimizing risk, and ensuring a balance.
There is an inherent risk associated with every investment option, from the analysis result, it is evident that optimizing the investment portfolio can help lower the risk of losing out on an investment. Optimization ensures that the loss is minimized, should it occur, and profit is maximized for an investment portfolio mix. This is in line with Tai (2014), who argues his study that numerical methods need to be hired to control the non-conformity from the ordinary mode of operation, when dealing with issues of risk management.
This study was undertaken to implement a GA with an aim of optimizing an investment portfolio mix and effectively manage risk associated with such investment. Data for this research was collected from a reliable secondary source. Information collected was prepared for analysis. Data mining technique was employed in developing and implementing the GA. Microsoft excel was used in data cleaning and data processing, Microsoft Power BI was used for all data visualization and R programming was used in deriving the Sharpe function and also the optimization of the function and optimum asset allocation using the GA (which can be accessed as an AI library on R platform).
The 30 companies (NSE 30) that made up the sample size were drawn from 6 sectors (agriculture, oil and gas, financial services, construction/real estate, industrial goods, consumer goods). The research draws inferences based on five-year historical data of each company stock prices in the Nigerian Stock Exchange.
5. Conclusion
This research sufficed in illustrating how GA can be implemented to arrive at an informed decision as an investor and have the right-mix in an investment portfolio. This agrees with (Ha, 2013), who postulate that GA performs better than assent method in portfolio optimization. The result from the research indicates that GA model implementation can be deployed to help investment managers and stockbrokers assess the potential return on investment and advice on potential investment portfolio mix.
Investment managers can implement this method to solve the usual bottleneck in selecting or determining which stock to advise potential investors to invest in, and also advice on which capital sharing ratio to reduce risk and attain optimal portfolio mix targeted at achieving an optimal return on investment:
It is recommended that investment manager should adopt this algorithm in choosing an appropriate portfolio investment for potential investors, adopting this method will help reduce greatly the stress of having to comb through a lot of journals, newsletter and expert opinion on a lot of stocks or investment options available.
Expert knowledge on companies/stocks/investment options is viable and this research does not disprove that, but the research will aid in the technical analyses, and help reduce the number of viable options to a considerable size, which domain expert knowledge can then be sort for. However, except for extreme conditions and sudden incidence, making decisions on investing on stocks using historical data of prices combined with appropriate statistical tool aimed at drawing insight from the data will suffice in arriving at an informed decision. Because in prices are others inherent dynamics that could influence the price, which domain expert will just be providing clarification on.
This research work has lent a voice to the adoption of artificial intelligence in making informed decision about investment options. In a bid to harness the potentials artificial intelligence has to offer. Due to limitation in the data available for this research, the option of an investment portfolio that comprises of stocks, bond, fixed deposits, treasury bills, etc., was not explored. Further research could explore that option. This research can be improved using a deterministic optimization algorithm likes analytic hierarchy process after the GA, to reach a certain exactness.
More so, further research could try to draw up a comparison on optimal returns for long-term and short-term investment decisions, using historical data for a longer period (say 10 to 20 years).
While this study can be considered a good representation of the Nigerian Stock Exchange, NSE 30 index used in drawing sample size is a dynamic list that changes with time, so investment managers must review frequently to avoid passing wrong information which could cause a big damage to the investors.
Figures
![Portfolio optimization, https://bit.ly/NSETop30PortfolioMix](/insight/static/img/emerald-loading-wide-xl.gif)
Figure 1.
Portfolio optimization, https://bit.ly/NSETop30PortfolioMix
![Optimal investment returns, https://bit.ly/NSETop30PortfolioMix](/insight/static/img/emerald-loading-wide-xl.gif)
Figure 2.
Optimal investment returns, https://bit.ly/NSETop30PortfolioMix
![Optimal returns against individual returns, https://bit.ly/NSETop30PortfolioMix](/insight/static/img/emerald-loading-wide-xl.gif)
Figure 3.
Optimal returns against individual returns, https://bit.ly/NSETop30PortfolioMix
![Optimum allocation, https://bit.ly/NSETop30PortfolioMix](/insight/static/img/emerald-loading-wide-xl.gif)
Figure 5.
Optimum allocation, https://bit.ly/NSETop30PortfolioMix
Price change in stocks selected based on industry, over a five-year period
Stocks | Price at July 1st 2014 | Price at July 1st 2019 | Price Gain/Loss | |
---|---|---|---|---|
Agriculture | ||||
1 | OKOMU | 33.90 | 64.00 | 30.1 |
2 | PRESCO | 36.10 | 52.00 | 15.9 |
Consumer goods | ||||
3 | DANGSUG | 9.50 | 11.35 | 1.85 |
4 | FLOURMI | 70.91 | 14.00 | −56.91 |
5 | GUINESS | 198.00 | 47.80 | −150.2 |
6 | INTERBREW | 28.00 | 18.30 | −9.7 |
7 | NESTLE | 1150.00 | 1390.00 | 240 |
8 | NB | 172.11 | 60.00 | −112.11 |
9 | UNILEVER | 54.00 | 30.70 | −23.3 |
10 | PZ | 37.40 | 6.75 | −30.65 |
Financial services | ||||
11 | ETI | 15.46 | 10.00 | −5.46 |
12 | FBNH | 15.95 | 6.60 | −9.35 |
13 | GUARANT | 28.76 | 30.60 | 1.84 |
14 | IBTC | 26.45 | 40.25 | 13.8 |
15 | STERLNB | 2.33 | 2.33 | 0 |
16 | UBN | 10.0 | 6.85 | −3.15 |
17 | UBA | 8.05 | 6.25 | −1.8 |
18 | ZENITH | 25.50 | 19.60 | −5.9 |
Industrial goods | ||||
19 | DANGCEM | 240.00 | 181.00 | −59 |
20 | **LAFARGE | 101.83 | 12.30 | −89.53 |
Construction | ||||
21 | JBERGER | 72.63 | 21.90 | −50.73 |
Oil and gas | ||||
22 | MOBIL | 137.00 | 175.00 | 38 |
23 | CONOIL | 62.13 | 21.65 | −40.48 |
24 | FO | 166.67 | 27.00 | −139.67 |
25 | OANDO | 28.50 | 4.00 | −24.5 |
26 | TOTAL | 175.00 | 150.00 | −25 |
27 | SEPLAT | 700.00 | 530.00 | −170 |
Conglomerate | ||||
28 | UACN | 65.10 | 5.20 | −59.9 |
29 | TRANSCO | 6.55 | 1.02 | −5.53 |
**Lafarge and Wapco had a merger
Asset allocation distribution
S/N | Stocks | Solution |
---|---|---|
1 | ZENITH | 0.03 |
2 | WAPCO | 0.03 |
3 | UNILEVER | 0.08 |
4 | UBN | 0.03 |
5 | UBA | 0.05 |
6 | UACN | 0.02 |
7 | TRANSCO | 0.01 |
8 | TOTAL | 0.03 |
9 | STERLNB | 0.02 |
10 | SEPLAT | 0.02 |
11 | PZ | 0.06 |
12 | PRESCO | 0.02 |
13 | OKOMUOIL | 0.02 |
14 | OANDO | 0.04 |
15 | NESTLE | 0.02 |
16 | NB | 0.05 |
17 | MOBIL | 0.01 |
18 | LAFARGE | 0.04 |
19 | JBERGER | 0.04 |
20 | INTBREW | 0.06 |
21 | IBTC | 0.02 |
22 | GUINNESS | 0.03 |
23 | GUARANT | 0.04 |
24 | FO | 0.04 |
25 | FLOURMI | 0.04 |
26 | FBNH | 0.03 |
27 | ETI | 0.04 |
28 | DANGSUG | 0.00 |
29 | DANGCEM | 0.04 |
30 | CONOIL | 0.02 |
Comparison of stocks with the highest asset allocation from the optimized portfolio
Stock with the highest asset allocation from the optimized portfolio (Sample A) |
Stocks with the highest individual asset returns (Sample B) |
---|---|
Unilever | Stanbic IBTC |
International brewery | Okomu oil |
PZ | Presco |
NB | Mobil |
UBA | Nestle |
Appendix
Citations
Power Bi Visualization of Results (Microsoft Power Bi, 2014) Microsoft. (2014). Microsoft Power Bi [Windows].
Genetic algorithm R code implementation
f=NULL
files = c(“merged.csv”)
for (i in 1:lenght(files)) {
csv=read.csv(files[i])
}
csv=read.csv(files)
f=csv
# calculate returns
for (i in 2:ncol(f)) {
# Price time series of the i-th asset
prices = f[,i]
# Price l
gged by 1
prices_prev = c(NA,prices[1:(length(prices) − 1)])
# Returns time seriesreturns = (prices-prices_prev)/prices_prev
# Replace the i-th column with returnsf[,i] = returns}
# Remove the first row with NAs and the Date columnasset_returns = f[2:nrow(f),2:ncol(f)]# Defining portfolio return functionportfolio_returns = function(x) {
port.returns = 0
# Multiplication of the i-th asset by the i-th weight in
"x" for (i in 1:length(x)) {
port.returns = port.returns + asset_returns[,i] * x[i]
} return (port.returns)}#Objective function with penaltysharpe = function(x) {
port.returns = portfolio_returns(x) return (mean(port.returns)/sqrt(var(port.returns)))}#Constraint Functionconstraint = function(x) { boundary_constr = (sum(x) − 1)
**2 # “sum x = 1” constraint
for (i in 1:length(x)) {
boundary_constr = boundary_constr +
max(c(0,x[i] − 1))**2 + # “x <= 1” constraint
max(c(0,−x[i]))**2 # “x >= 0” constraint
} return (boundary_constr)}
#objective function to be optimizedobj = function(x) {
# We want the maximum Sharpe ratio, so we multiply it by
# −1 to fit an optimization problem
return (−Sharpe(x) + 100 * constraint(x))}
#Optimization via Genetic Algorithmlibrary(“GA”)ga_res = ga(
# Tell the genetic algorithm that the # weights are real variables
#x00A0; type = “real-valued”,
# “ga” function performs maximization, so we must
# multiply the objective function by −1 function(x){−obj(x)},
# x_i >= 0
lower = rep(0,ncol(asset_returns)), # x_i <= 1
upper = rep(1,ncol(asset_returns)),
# Maximum number of iterations maxiter = 50000,
# If the maximum fitness remains the same for 50
# consecutive transactions, stop the algorithm run = 50,
# Exploit multi-core properties of your CPU
parallel = TRUE,
# We want to see the partial results of the process # while it performs
monitor = TRUE,
# Seed useful for replicating the results
seed = 1)
# Store the resulting weights in a vectorsol = as.vector(summary(ga_res)$solution)
cbind(names(asset_returns),sol)
Algorithm – Figure A17
R Core Team (2013). R: A language and environment for statistical computing. R Foundation for Statistical Computing, Vienna, Austria. URL www.R-project.org/
Luca Scrucca (2013). GA: A Package for Genetic Algorithms in R. Journal of Statistical Software, 53(4), 1-37. URL www.jstatsoft.org/v53/i04/
Microsoft Corporation, 2018. Microsoft Excel, available at: https://office.microsoft.com/excel
References
Al-Tarawneh, A. and Khataybeh, M. (2015), “Portfolio behaviour of commercial banks: the expected utility approach: Evidence from Jordan”, International Journal of Economics and Financial Issues, Vol. 5 No. 2, pp. 312-323.
Augusto, O.B., Rabeau, S., Depince, P. and Bennis, F. (2006), “Multiple-objective genetic algorithms: away to improve the convergence rate”, Engineering Applications of Artificial Intelligence, Vol. 19 No. 5, pp. 501-510.
Bank for International Settlements (2015), “Global asset allocation shifts”, Retrieved on 13/7/2019 from: www.bis.org/publ/work497.pdf
Bolat, B., Erol, K.O. and İmrak, C.E. (2004), “Genetic algorithms and functions of operators in engineering applications”, Sigma Journal of Engineering and Natural Sciences, Vol. 4, pp. 264-271.
Cacho, O. and Simmons, P. (1999), “A genetic algorithm approach to farm investment”, Australian Journal of Agricultural and Resource Economics, Vol. 43 No. 3, pp. 305-322.
Can, S. and Gersil, M. (2017), “A literature review on the use of genetic algorithms in data mining”, International Journal of Computer Engineering and Technology (IJCET), Vol. 8 No. 6, pp. 67-76.
Chakrabarti, A., Singh, K. and Mahmood, I. (2007), “Diversification and performance: evidence from East Asian firms”, Strategic Management Journal, Vol. 28 No. 2, pp. 101 -120.
Chang, H. (2014), “Regional and product diversification and the performance of retail multinationals”, Discussion Paper, Henley Business School, University of Reading.
Chang, T.J., Yang, S.C. and Chang, K.J. (2009), “Portfolio optimization problems in different risk measures using genetic algorithm”, Expert Systems with Applications, Vol. 36 No. 7, pp. 10529-10537.
Daş, R., Türkoğlu, İ. and Poyraz, M. (2006), “Internet access with genetic algorithm method extracting information from records”, Sakarya University Journal of the Institute of Science, Vol. 2 No. 2006, pp. 67-72.
Donald, G. and Ronald, H. (2013), “Performance measurement: the balanced scorecard approach”, Journal of Cost Management, Vol. 6 No. 2, pp. 47-52.
Emel, G. and Taşkın, Ç. (2005), “The use of genetic algorithm in two-stage solution of vehicle routing problems”, Gazi University Journal of Economics and Administrative Sciences, Vol. 7 No. 1, pp. 1-17.
Ha, S. (2013), “Optimal insurance risk allocation with steepest ascent and genetic algorithms”, The Journal of Risk Finance, Vol. 14 No. 2, pp. 129-139.
Holland, J.H. (1975), Adaptation in Natural and Artificial Systems, MIT Press, Cambridge MA.
Hou, E.S.H., Ansari, N. and Ren, H. (1994), “A genetic algorithm for multiprocessor scheduling”, IEEE Transactions on Parallel and Distributed Systems, Vol. 5 No. 2, pp. 113-120.
Küçüksille, E. (2009), “Evaluation of portfolio performance using data mining process evaluation and an application in the stock market”, Doctorate Thesis, Isparta, Süleyman Demirel University, Institute of Social Sciences, Department of Business Administration.
Lin, L., Cao, L., Wang, J. and Zhang, C. (2004), “The applications of genetic algorithms in stock market data mining optimisation”, Management Information Systems, Vol. 10 No. July 2014, pp. 273-280.
Naqvi, T., Khan, I. and Rzavi, K. (2016), “Pension funds: More diversification”, Public Policy and Analyze de Politiques, Vol. 10 No. 1, pp. 47-53.
Plikynas, D. and Daniušis, P. (2010), Computer Intelligence and Multi-Agent System Social in the Field of Science. Monograph, Vilnius, Academy of Business and Management.
Shadrokh, S. and Kianfar, F. (2007), “A genetic algorithm for resource investment project scheduling problem”, Tardiness Permitted with Penalty, Vol. 181 No. 1, pp. 86-101.
Sharpe, W.F. (2000), Portfolio Theory and Capital Markets, McGraw-Hill, New York, NY.
Tai, M. (2014), “Aligning a research and development portfolio with corporate strategy”, Research Technology Management, Vol. 51 No. 5, pp. 39-46.
Urbšienė, P. and Dubinskas, L. (2017), “Investment portfolio optimization by applying a genetic algorithm-based approach”, Ekonomika, Vol. 96 No. 2, pp. 66-78.
Wang, K. (2001), Computational Intelligence in Agile Manufacturing Engineering. Agile Manufacturing the 21st Century Competitive Strategy, Oxford: Elsevier Science Ltd., pp. 297-315.
Yılmaz, S. and Kucuksille, E.U. (2014), “A new modification approach on bat algorithm for solving optimization problems”, Applied Soft Computing Journal, Vol. September No. 2014, pp. 1-36.