Decision

Portfolio optimization problem follows the calculation of investment income per share, based on return and risk criteria. Since stock risk is achieved by calculating its return, which is itself computed based on stock price, it is essential to forecast the stock price, efficiently. In this paper, in order to predict the stock price, grey fuzzy technique with high efficiency is employed. The proposed study of this paper calculates the return and risk of each asset and portfolio optimization model is developed based on cardinality constraint and investment income per share. To solve the resulted model, Invasive Weed Optimization (IWO) algorithm is applied. In an example this algorithm is compared with other metaheuristic algorithms such as Imperialist Competitive Algorithm (ICA), Genetic Algorithm (GA) and Particle Swarm Optimization (PSO). The results show that the applied algorithm performs significantly better than other algorithms.


Introduction
One of the significant signs of development in today s world is associated with high economic growth, which requires effective and adequate investment.Capital market is considered as a primary source of attracting and directing the capital, properly.Therefore, it is essential to carry out efficient analyses of the stocks existing in the capital market.During the past few years, there have been various studies, which have confirmed the superiority of stock market versus other investment opportunities.Therefore, many people have focused on the portfolio optimization model more than ever.All portfolio optimization models consider a criterion for their yield which is mostly calculated based on historical prices.One of the undeniable features of capital market is wild fluctuations of stock price and non-compatibility with the previous models under the effect of external factors and the occurrence of unexpected events.Thus, applying theories, which consider the uncertainty principle; seems more appropriate for empirical applications.On the other hand, basic model of portfolio optimization is still evolving and becoming more realistic.Making changes in the model and extending the aspects of the issue for real world problems intensifies the need for new and different algorithms to solve this model.This paper reconsiders the uncertainty principle and stock price prediction before portfolio optimization to make the basic model more realistic.It applies a new algorithm in solving the model and compares the achieved results with other existing algorithms.
In this study, grey theory is used to forecast the stock price.Deng is believed to be the first who utilized grey theory in 1982 to consider uncertainty principle in agricultural and engineering and some commercial-financial investigations.In financial studies, grey prediction model was applied for the first time in Value at Risk (VaR) model in order to remove the fluctuation and to increase the accuracy in forecasting the stock price.This approach was used more and more in subsequent investigations.Chang (1997), Chang and Wu (1998) and Chang et al. (2000) showed in their investigations that the accuracy of grey prediction is greater than Moving-average (MA) model.Chang and Chan (2002) indicated that capability of this model is better than Random Walk and GARCH model.Wang (2002) initiated to prediction of the stock price by integrating fuzzification technique with grey system theory and demonstrated the efficiency of this method.Akay and Atak (2007) applied an approach called Grey Prediction with Rolling Mechanism (GPRM) to forecast total and industrial electricity in Turkey and their results seemed to perform better than other analytical models.In the present study, this method is used fuzzily to forecast the stock price.
An issue that is particularly emphasized on the stock analysis and involves most of the studies is the matter of diversification and portfolio formation.In this field, representing mean-variance model, Markowitz (1959) showed that any investor could determine the investment allocation in terms of risk based on the level of risk taken.In this model, mean is considered as portfolio s efficiency criterion and the standard deviation is counted as its risk indicator.To solve it, Markowitz used critical line algorithm.Though Markowitz s model is theoretically solvable by non-linear solution methods, it is practically problematic.For instance, the investment managers impose limitations in practice for selecting the stocks, which would further complicate the issue.As a result, we need to complement the Markowitz model and to develop methods for solving new models.In this field, an investigation was conducted by Chang et al. (2000) which were seeking to solve Markowitz model considering the cardinality constraint.They showed that the existence of such constraints in this model causes discontinuity and change of the efficient frontier slope.They solved the suggested the proposed cardinality model and compared the results by three Genetic, Tabu Search and Simulating Annealing algorithms.Accordingly, numerous and extensive researches have been already carried out adding empirical limitations to Markowitz s model such as Golmakani and Fazel (2011), Woodside-Oriakhi et al. (2011) and Anagnostopoulos and Mamanis (2011).
On the other hand, stock selection issue for the real world involves a selection from a large number of available stocks in which the problems would take on great dimensions and current methods cannot solve such problems anymore.Fernandez and Gomez (2007) investigated in their study the necessity of using heuristic algorithms to solve this problem.Some other scholars including Loraschi et al. (1995) and Rolland (1996) made use of metaheuristic algorithms like Genetic and Tabu Search to solve portfolio optimization model.In other studies performed by Eslami Bidgoli et al. (2009), Ant Colony algorithm was used, Navidi et al. (2010) utilized Genetic (GA) algorithm and Raei et al. (2010) applied Particle Swarm Optimization (PSO) algorithm to solve portfolio optimization problem.In the present investigation, Invasive Weed Optimization algorithm has been used to solve the model.IWO is an algorithm for probable numerical optimization derived from weeds growth.This method was designed for the first time by Mehrabian and Lucas (2006).Based on the experiments performed in the main paper, IWO algorithm has better results and high-dimensional spaces than all other algorithms and optimization methods.Then, many studies were conducted in different fields in this respect among which we may suggest to the investigations carried out (e.g.Mallahzadeh et al., 2009;Nikoofard et al., 2012;Pourjafari & Mojallali, 2012).
The proposed study of this paper predicts the stock price using grey fuzzy method.Then, the stock return is calculated using such prices and would enter into portfolio optimization model.In order to provide better modeling, some limitations have been added from the real world including maximum stock quantity and stock-portfolio ratio to Markowit s optimization model.To solve this problem, IWO algorithm, which has never been applied in financial field, is used and its results are compared to those of other metaheuristic algorithms.

Stock price prediction using grey fuzzy method
The grey fuzzy prediction model includes just necessary parts of grey prediction model where the data are fuzzified.The stages of this prediction are as follows: First, the prices are fuzzified through the following equation, where x is the stock price per commercial day and y is the highest stock price in the window under study (Wang, 2012).Then, using GPRM method, the prices will be predicted in each window.The prediction method in this model is based on grey prediction model called GM (1, 1).In GM (1, 1), assume that x(0) time series is indicative of stock price in each prediction window.
, n 4 where x ( 0) is a sequence with positive data and n is the number of available data.Accumulated Generating Operation (AGO) is one of the most important elements in this model and plays essential role in reducing the fluctuations and coincidences in the data.Thus, AGO is firstly applied on the data (Deng, 1989).
, n 4 Now, we consider z as the mean that is produced by X (1) : k = 2,3, , n Estimated sequence of least squares for the equations GM (1,1) is defined as , and the parameters are calculated as below: Then, in k time will be equal to: . Finally, to reach prediction, we use Inverse Accumulated Generating Operation (IAGO) as follows: . In grey-fuzzy prediction, all data are used in the prediction process; however, to increase the accuracy of this prediction, it would be better to make use of recent data.Therefore, the same procedure is applied in grey-fuzzy prediction model; the only difference is that , k < n is use to predict and after acquiring the result, the prediction is added to the end of series and is utilized to predict (Akay & Atak, 2007).

Portfolio Optimization Problem
Markowitz suggested the portfolio optimization problem for the first time in the form of a mathematic programming model in which the investor invests in assets with higher return and lower risk.One of the most remarkable points in this model is to focus on the investment risk not only based on the standard deviation of one stock, but on the basis of investment series risk.The mean-variance model formulated by Markowitz is suggested as Eq. ( 1) as follows, (1 where N is the number of available assets, ij is co-variance of the stocks i and j, x i is the weight of stock i in the portfolio, µ i is the average return of the stock i and shows a certain level of return. Adding the cardinality constraint, this model is defined as Eq. ( 2) as follows, (2) where k is a certain number of assets in the portfolio to be specified; l i is the minimum ratio of total investment in the asset i, and µ i is the maximum ratio of investment in the asset i.Decision-making variable of this model is x i and it is between zero and one and it determines the ratio of total investment on the stock i.If i is equal to 1, the stock is placed in the portfolio and in case it is zero, it is not placed in the portfolio.
It has been shown in some investigations that in the portfolio optimization model, cardinality constraints will have better results in the case that they are less/equal (=>) compared to the equality resulted by space enlargement of the response to the problem (Vielma et al., 2008;Berstimas & Shioda, 2009).In the present investigation, this constraint has been considered as less/equal.

Invasive Weed Optimization Method
Invasive Weed Optimization is a probable numerical algorithm derived from weeds growth.The return and efficiency of this algorithm was argued by Mehrabian and Lucas (2006) in the form of an article, the details of which are as following:

Initialization of a Population
A population of initial weeds (initial responses) is spread over d-dimensional space of the problem with randomized positions; this searching space with its high and low boundaries is shown by X ini .

Reproduction
Any member of the plants population may produce Seeds based on the minimum and maximum adequacy in its colony.The quantity of seeds produced by any plant may increase linearly from the minimum possible seeds quantity (S min ) to maximum possible seeds quantity (S max ).In other words, a plant will produce seeds based on its own adequacy as well as the lowest and highest adequacy of the colony, in order to make sure of its linear increment.Since it is possible that infeasible solutions have more data during their development process than those feasible ones, reproduction technique as mentioned above will give a chance of life and reproduction to infeasible solutions, like what is happened in the nature.Thus, an algorithm will reach an optimal point, if it can pass an infeasible area.

Environmental Dispersion
The seeds produced in d-dimensional search space are dispersed by normal distribution with zero mean and different variances.It means that the seeds are dispersed randomly in a way to be near to their parent; here the standard deviation of is reduced in each stage for the random function of predetermined initial quantity ( initial ) to the final quantity ( final ).In this study, the following equation is used to simulate such event.
where iter max is maximum number of iterations, iter is the standard deviation in current stage and N is non-linear index.We are sure that in this conversion, the distance of seeds from their parent is decreased in a non-linear way in each stage.

Competitive Elimination
In the case that no plant has no reproduction, it will be lost, otherwise it will be dispersed.Therefore, a competition is required to restrict maximum number of plants in the colony.After some iteration, the quantity of plants in the colony will reach its maximum through rapid reproduction.As expected, the plants with higher adequacy, will reproduce more than inferior ones.By reaching to the maximum number of plants in the colony (p max ), the mechanism of eliminating the plants with low adequacy will be activated.Elimination mechanism in this study works as follows: when the maximum number of seeds in the colony is reached, each seed is allowed to produce seeds according to the mechanism suggested in reproduction section.Then, these produced seeds are allowed to be dispersed over search space based on what was mentioned in the environmental dispersion section.Once all the seeds found their position in the search space, they will adapt to their parents; then, the seeds with the lowest adequacy will be eliminated to reach the maximum acceptable population in the colony.In this method, the plants and their offspring will be considered together and those with the highest adequacy will remain (Mehrabian & Lucas, 2006).In this algorithm, the number of initial population (N 0 ), the maximum iterations (iter max ), maximum plant quantity in the colony (p max ) and non-linear index (n) are among significant and effective parameters in the algorithm convergence.

Customization of IWO Algorithm for Portfolio Optimization Model
The stages to implement IWO algorithm in portfolio optimization problem are as follows: 1) Some weeds are randomly produced; each weed is indicative of a portfolio with the weights including p 1 , p 2 , .P N per share that is shown as below: Weed = [p 1 ,p 2 , P N ] 2) Calculation of cost functions for each initial weed which is the same target function in the suggested model. (3) 3) Considering the cost calculated for each weed in the previous stage, these weeds produce some weeds based on their adequacy; such quantity in this investigation is calculated by the following formula: where S max is the maximum quantity and S min is the minimum quantity of the seeds that each weed can produce; considering the empirical results, = 0.1 this value has the best performance.Bestcost (it) and Worstcost (it) are indicative of the lowest and highest costs of weeds in t th iteration and costs is the cost of each weed.
4) Randomly produced seeds with average position of mother plant and different variances are computed by the following formula and disperse in the environment; over the time, these variances will be decreased.However, constraints of each seed as standing in the interval [0,1] in this stage should be controlled.
5) The amount of costs of each seed that has become a plant is calculated by the target function.
6) The costs of mother plants and the seeds are set in order and high-cost weeds are eliminated from the problem, in the case that quantity of plants is greater than P max ; high-risk portfolios are eliminated from the series in this stage.7) This procedure is continued to reach to the stop condition at the problem that is the same end of algorithm iterations.
It is noteworthy that in case of non-compliance with the research limitations, it is tried to make the response feasible and optimal by using penalty values that are added to target function of the problem.

Results of numerical example
The statistical population of this study includes 100 active companies registered in NASDAQ Stock Exchange and the price of this stock is daily for the period of January 4 th -June 3 rd , 2011 when there were 156 available data.We consider 50 prices among these data as training data.In other words, for prediction in each stage, 50 previous prices are used and in the next stage, these prices are moved a step forward.In this way, the prediction of 106 prices is done using grey fuzzy method and will be entered to the model.Then, IWO algorithm parameter is regulated by Response Surface Methodology (RSM) and Expert Design 7 software that is compatible with portfolio optimization problem, as with 152 iterations and the limitations as per the table 1 in which the results have been shown.Then, the stocks are divided into three parts including small in five 10-share groups, medium in five 25-share groups and large in five 50-share groups with placement of 100 shares of population.The model in each group is implemented for 10 times by IWO, GA, PSO and ICA algorithms and the following assumptions are predominant in solving the model: 1) Maximum 4 stocks in each 10-share group, maximum 6 stocks in 25-share group and maximum 10 stocks in 50-share group have to be selected.2) Portfolio-share ratio is between 0.1 and 0.95.
3) Minimum return expected by the investor in different groups is 5%.
The outputs large-sized better situat    The results shown in Fig. 1 shows that RPD rate calculated by IWO algorithm in different groups of stocks is less than that in other algorithms.In this study, Kruskal-Wallis nonparametric analysis of variance is used for assuming the lack of significant difference between average RPD resulted by IWO and three other algorithms; the results of pair comparison between these algorithms have been shown in the tables 7 to9.Null hypothesis consists of: Average RPD of IWO is equal to GA, PSO and ICA algorithms.The result of the Tables 7-9 indicates that P-value is less than critical value of =5%, null hypothesis of all three tests based on equality of average RPD is rejected and the significant statistical difference between Average RPD of IWO algorithm and other algorithms is confirmed at confidence level of 95%.

Conclusion
We have presented a method for portfolio management using a cardinality constraints and assuming uncertainty with input parameters.The proposed model of this paper first predicts stock prices using grey fuzzy method and then, two cardinality and share-portfolio ratio constraints were added to the portfolio optimization model to make traditional asset allocation mode realistic and to solve the portfolio optimization model, IWO algorithm was used.All mentioned stages were applied in an empirical example and the suggested algorithm was compared with three GA, PSO and ICA algorithms.Considering the tests conducted, the efficiency of this algorithm was determined.It is suggested to make the model applied for a real-world case study in other empirical investigation to examine the performance of the proposed model, more efficiently.

FigFig. 1 .
Fig. 1.Procedure to calculate the quantity of seeds produced by each weed

Table 1
Limitations Given to Expert Design Software

Table 2
Results of IWO Algorithm Regulation for Portfolio Optimization Problem

Table 3
The lowest p

Table 5
The lowest p

Table 6
Comparison of average PRD of metaheuristic algorithms

Table 7
Results of Kruskal-Wallis Test for Comparison between GA & IWO

Table 8
Results of Kruskal-Wallis Test for Comparison between PSO & IWO

Table 9
Results of Kruskal-Wallis Test for Comparison between PSO & IWO