AbstractThis research paper aims to enhance the practicability of Artificial Intelligence using NeuralNetwork (NN) in the actual market. This paper generalizes the standard Markowitz Theory’s EfficientFrontier to mimic and optimise the portfolio construction, and develops a neural network heuristic tobetter understand the mechanism of how Artificial Intelligence can construct optimal portfolio andprovide advantages to all levels of investors.

Keywords:ANN, Finance, Portfolio

1. Introduction

Artificial Intelligence works like the part of our brain with agents to communicate with each otherand work their performances to the optimal level or at least increases the chances of success. ArtificialNeural Network [1] seeks to optimize and simulate human brains that go beyond what the normalhuman can do. No doubt, the ultimate goal is to ease the human’s burden with greater effect. ArtificialNeural Network (ANN) is one of the fields from Artificial Intelligence which is actually a machine orprogram that can mimic the actions of humans [2]. ANN is basically intended to mimic the mechanismof the human brain [3]. As complex as our human neural system, which includes our brain cells, spinalcords, the nerves system and etc. The replica of human system has artificial neurons and is the reactor,processor and communicator of the information through connectionist that formulated into a verycomplex system.It is hoped that this study will provide higher level of understanding not just in Modern PortfolioTheory by Harry Markowitz [4], but more in-depth knowledge in the field of Artificial Neural Network.The objective is to examine the critical success factors of Artificial Neural Network in the field offinance, specifically in Portfolio Management, Construction and Optimization. In addition, this paperseeks to research the practicability of Artificial Intelligence and Neural Network in the Malaysiancapital market.The application is to improve and open up human’s perception in portfolio investment. This is toshow that portfolio investment can produce optimum results and at the same time, with ArtificialNeural Network, we can see how the power of computing can generate complex formulas andprogramming codes beyond the capability of the human’s mind.

2. Literature review

Artificial Neural Network as mentioned is one of the body of Artificial Intelligence that duplicatesthe hu man brains and seek to optimize what normal humans can do. In this section, we will touch onthe details of the structure within a neural network. This will provide an opportunity to the human tounderstand more about our own brain and the machine that is design to work for us. It is pertinent tocapture the future behavioural patterns as to identify the creditworthy cardholders who are profitablewith low risk [5] similar to our portfolio of stocks.One of the basics of Artificial Neural Network [6] will be divided into three main parts as illustratedin Figure 1 below which shows the normal structure of how Artificial Neural Network can replicate thebiological neural network.

In our model of Neural Network, the Input Layers will usually be the layer where inputs are feed onthe Hidden Layers. In other words, raw information is feed to the hidden layers to perform their task,and in fact, hidden layers can be far complicated that we can see now. The hidden layer is like ourbrain, when we speak or communicate with someone, a signal will be sent to your brain. The hiddenlayer will process before deciding the appropriate action to be taken. As in the hidden layer, this can berepresented by cell body that will capture the neurons and process according to what we think. Usuallythe output layers, as always, is something that we see as a result, but it is important to note that it is ascomplex and complicated as a human mind, as similar to Artificial Neural Network as well.

Figure 2. Image of Biological Neural Network

ANN and genetic algorithms that derived from the corresponding simulation of biology can be usedfor prediction [7]. In Figure 2, you can see the image from the operation and inputs, hidden and outputlayers are interconnected. And that is how ANN [1] can be grown exponentially with research inputswhich will turn into outputs for further action.

2.1. Artificial Neural Network in Portfolio Management

Portfolio is a set of multiple assets that are combined by investors with the target to diversify.Diversification will minimize the risk and maximizing returns of the investor when investing in aportfolio. The assumption of putting more stocks without having to study the significance of each stockand their relationship among each other will cause fatal results on the expected return. Many will moveon with carefully selected stocks with more implications on Markowitz’s work [8], which will notfollow the Gaussian Distribution and thus, ignoring the theory of efficient markets. As ANN works asan essential tool on optimization, one of the key benefits apart from their learning behaviour will be theprogramming or their hidden layer that can be programmed to optimise results. In addition, manystudies had also resulted that information can be tapped with various environment, much more than ahuman can remember in-line during the decision making. In fact, the simulation engine inside an ANNcan work numerous investing strategies, from the collection of how the greats had done, like WarrenBuffett, George Soros, Alan Greenspan and etc., and with that, optimizing their strategies, puttingtogether a competitive system that will result at a situation the survivor of them all [9]. But computing- 169 -a machine to have followed how investor’s behaviour react is something very subjective and take along time and effort, still, the effort to replicate their winning strategies is possible using NeuralNetwork.In addition to portfolio optimizing to get the best return, which in the statement cleared theassumption of MPT. The reason is because a clear point of optimizing in the language programmedwill be to set priority on earnings seconded by risk. This states another benefit of using NN as we canselect our own optimal level whether in profit sense or minimizing risk of our portfolio. The variabilityof neural network applications also sets another challenge that is to be able to self-correct fromprevious mistakes. As we all know that humans will tend to neglect the losing side of us, and will stillgive it a try, while NN will have objective-oriented stricken concept. The principle is ANN hasstronger foundation with learning skills and improvement is self-learned. We are able to monitor theirperformances from time to time. And this gave an idea to Zimmermann, Neunier and Grothmann [10]to use Black/Litterman approach [11] for a feed-forward neural network to work on a Error CorrectionNeural Network (ECNN) that characterise the mistakes made previously and enhanced it by utilizingthe mistakes done. That feed-forward NN refers to one of the neural networks that work on a singleconnection line, but unlike recurrent neural network, the communication process only goes one way.With more creations on enhancing the portfolio theory, this includes making the theory profitable,and by means of profitable is not experimenting in the lab but put it in the actual market. The beautyMarkowitz’s Portfolio Theory [8] is that, by using just mean and variance as a parameter, the theorycan work perfectly well and show remarkable output. On the positive side, researchers focus on thesetwo parameters and inclusive of the model’s skewness to work on the construction of a portfolio whichwill match the preferences of investors based on their forecast alongside with the trading strategies in it[12]. With that, this construction takes the mean-variance-skewness of the model relationship as part ofthe main objectives to resolve many unclear works and provide a higher level of return [13]. Althoughmany of the models were made to prove a theory, there are others who work well in the real capitalmarket and have been part of the usage of the program or software to be adapted in the software. Butthe slack problem of the software is that, it can be profitable for the creator, but costly to the buyers, asmany patches needed to be done to make sure the algorithm did not grow exponentially and makingsure that the neural network should learn the right thing. This is simply because, in a human mind,what we were induced as a bad thing, we will try to erase and do not follow it, but doesn’t apply thesame for a machine. We may wonder, that the algorithm should have a level to deter bad judgement,but simply, the machine evolves with us thus even there is a bad signal; it will be as new to us just as tothem.On the other hand, it will be on the selection process of a portfolio. The selection of a portfolio mayseem easy as mentioned, but is one of the most tedious processes in reality. It is not like selecting fruits,differentiating the bad from the good ones and to have known which the best asset is. The process ofselecting good assets for your portfolio, can be pronounced as a vague or ambiguous statement,because what do you mean by ‘good’? Thus, in this operation of selecting the most preferred portfoliothat gives you the best return with minimal risk is through heuristic process. Heuristics meanspertaining to a trial-and-error method of problem solving used when an algorithmic approach isimpractical.This might keep many wonder, how are we going to trial and error our portfolio, and how muchmoney can we invest in? Therefore, this places Neural Network as part of the process to simulate thereal market and to be the best on portfolio selection. One of the methods that were proposed in [14]will be to use Hopfield Neural Network [15] and to study the groundwork. Having Hopfield Nets isthat it is capable of working on different classes of combinatorial optimization problem. This will setapart how the optimization and selection process are given the ground rules, and most importantly, thebounding and cardinality constraints can be rid off as studied by Chang [16] and Kellerer [17].

3. Data and Methodology

The data samples are taken from the FTSE Bursa Malaysia EMAS Index. The reason of adaptingthis sample is that FTSE Bursa Malaysia EMAS Index is constructed based on Malaysia’s Top 30Companies, Mid 70 Companies and 225 small capitalization companies. In other words, this 325companies, but 324 to be exact (as one of the company namely Quill Capita, is not removed but ishaving his shares halted) to represent the rest of the listed companies in Malaysia. In fact, with more- 170 -instruments that are listed out such as Islamic Bonds and Malaysian Government Securities (MGS), ourfocus still remains on the equities.

The next section will discuss the relevant procedures to handle the sample that is using MicrosoftExcel, C++ and SmartFolio for computation and data analysis. The Microsoft Excel special tooldesigned by Hanyang Financial Engineering Lab (Thomas Ho Company, 2003) is to create theEfficient Frontier practised by Markowitz Modern Portfolio Theory. The C++ is used for the purposeof randomly selecting companies as part of the learning process for Layer 1. The main reason of usingC++ is, it is much faster and will have no problem even having Matrix Multiplication of more than 20variables (Excel can only do 40 variables per time). In addition, C++ coding is easily embeddable inmany other programs, like Matlab and Fedora for further research on Layer 2 and 3 in the future.

3.1. Sampling Procedures

Layer 1: Prototype (for the purpose of this research only)1. Collection of data from Yahoo! Finance and to eliminate any outliers that existed2. With the data that accounted 325 companies data will be used to compute the Efficient Frontierusing Microsoft Excel.3. Next, to run a series of testing, as definitely we won’t be investing in 325 companies in ourportfolio thus we set a range using C++ to have random selection of stocks4. C++ will random select the stocks and to our preference, as for the analysis in this model, there isa range of 2 to 29 assets will be selected.5. The random generation of stocks with the data will be pasted into the efficient frontier columnsand it will result in the graphs being created.6. Graph is compared with the Efficient Frontier that has 325 Assets in Portfolio and Top 20 tocompare their performance. 325 of the assets.7. A series of 50 run is being carried out for the purpose of getting the best model and to see theeffects.8. Differencing the mean return and compare with the benchmark mean return.

Assumptions undertaken for the purpose of this paper: Analysis is done on random generation program to select 20 stocks. The number of trading days is 252 The weight on Risky Portfolio is fixed 0.7 or 70%, while Risk-Free Asset is fixed at 0.3 or 30% ofthe actual portfolio The series is run through a range of -0.5 to 2.0 set of Weight Proportion that may exist, with that,the curve of Efficient Frontier can be seen. As mentioned above this is the q for the optimizationpurpose, or ‘risk tolerant’ factor. The risk free rate is adapted from Bursa Malaysia’s Malaysian Government Securities (MGS) as of1stof April 2010, with the risk free rate of 2.57% or 0.0257

Microsoft Excel Efficient Frontier Construction1. From the random generation of output that was produced by the C++ program made by the authorunder the file out.txt, simply copy the whole file and paste it on a new worksheet.2. From the pasting, you can see from the graphs area that will be resulted from the calculation thatwe will describe further.3. For investors analysis, the diagrams and the rest of the computation is done. But as for developers,the calculation process will be described here. Upon getting the input for the time series of data,the first calculation is to compute the returns.4. Calculate the mean (average) of all the returns that Step 3 has calculated.5. Daily mean and annual mean will be computed by multiplying the results from Step 4 with 252(number of trading days per year)6. Calculate the excess return by taking the stock returns you got from Step 2 minus by the mean.7. Transpose the excess return matrix.- 171 -8. Matrix Multiply for the excess return matrix from step 6 with step 7 transposition of the excessreturn matrix to get the variance covariance matrix9. Calculate the Annualized VCM with multiplying 252 again.10. Calculate the Risk-Free Return by taking the Expected Return from Annual Expected Returnminus by Risk Free Rate (2.57% for our study)11. Derive the variable z of the matrix, from the Risk Free Return and Expected Return, MatrixMultiply with the Variance Covariance Matrix.12. Sum the whole z, and compute M by dividing the each value of z with the sum.13. Compute E(Rm) by Matrix Multiplying M with the Expected Return14. Compute the Variance as well by a series of double Matrix Multiplication, first to Matrix Multiplywith transpose of M with the Annualized VCM. Second Matrix Multiply the output with theAnnualized VCM again.15. Square the root the variance to get the standard deviation of risk free return (denoted as m)16. Repeat steps 13-15 for risky assets computation.17. Insert the weight of how much investment for risky assets and risk-free assets. This study we putrisky assets with 70% while risk free assets with 30%18. Calculate the expected return of portfolio by taking the weight of risky assets multiply theexpected return of risky assets (same for risk free assets as well)19. Calculate the rest of the formulation with covariance, variance and standard deviation of theportfolio with the function.20. The efficient frontier will be computed, as the variation of the weight from the list of -0.5 to 2 willproduce multiple points of risk and return. And from there, you are able to see the graphs.

Using SmartFolio Analysis Tool1. Using SmartFolio, the bonus package will show the platforms of how the model will work out theanalysis applying the neural network tool.2. In the first page, click on the start new SmartBook3. From the front page, click Data -> Import Data from Excel (data are randomly generated from theprogram that I used)4. You will be prompted with this window and press OK5. From the front page, you will see the list of your data with date presented nicely. Go toInitialization at the menu bar and click Portfolio Construction6. Press on Edit List and you see the set of assets that was randomly generated and pasted on the list.And what you do is simply ‘Select all’ and press OK.7. From the data that was given, the portfolio construction is generated, and optimized according totheir level. As it differs from the previous one whereby our weight for Risky Assets is 70% and30% on Risk Free Assets, this program will provide equal weightage to all the stocks (differencebetween my tool and theirs)8. From the front page, click on Analysis -> Efficient Frontier Construction, you will have a windowand a constraint button as below9. Choose Prohibit Short Selling (as Malaysia we couldn’t do that) and Zero weight in Riskless Assetand press OK10. The efficient frontier will be presented graphically.11. From there, click on the Menu Bar on Portfolio Summary and the results of analysis can be foundhere and the weight of allocation of stocks.

4. Analysis and Discussions

The random generation program has used 20 companies as the default for this study. The benchmarkfor the Top 20 Companies based on Market Capitalization chart from KLStock.com dated as of 1st ofApril 2010 [18]. As seen from the analysis, we are going to compare the mean differentiation (as ourtarget is to have the highest return) of each dummy generation (which has 50 runs) and the marginstowards the benchmark. As such, we are having two benchmarks; the Top 20 Stocks and 325 Stocks inKLSE.As for the analysis that we have run through, includes the index and the performances in theefficient frontier, as seen in the Top 20 efficient frontier of Figure 3. Below are some of the examples- 172 -of the analysis that were done and to compare how the companies performed graphically, refer toFigures 3 to 5. With the below figures, the results generated by the model are compared with thebenchmark. The reason of putting two benchmarks is that, there are many varieties of investors whomay have different preferences for risks and returns.

Figure 3. Top 20 Efficient Frontier

Figure 4. Analysis 1 Efficient Frontier

Figure 5. Analysis 22 Efficient Frontiers

Having Top 20, Top 30, Mid 70 and best of 325 will provide good benchmarks to suit thepreferences of different portfolio managers. We can see that the benchmark is the best as of 1st April2010, and there are no other portfolios selections that will supersede their performances. Thus, theinput layer of the model must be constantly fed with a large stream of inputs for better results.We have used two methods for our analysis. First method is based on the graph that is to see thegraph and compare. It can entail the fastest and easiest because it is based on what we see as a picturedefinitely paints a thousand words. The next analysis is to calculate to see the variations that existbetween the proposed analyses, individually and also, the mean of the benchmark. We used the meanas an assessment on the return of the selected benchmark portfolio rather than risk. Thus, equippingreturns as the mean return is our main target for this study; the analysis will provide us the requiredoutputs.In this model, the Neural Network layer will compute the variation and for risk as well to comparethe selected benchmark and the set of analysis. From this computation, the output will be randomlygenerated by the Artificial Intelligence program. But all of this is in Layer 1 of the model which doesnot entail much, as this output of Layer 1 will be fed into the other hidden layer to be computed further,especially on the learning site.- 173 -In Figure 3, an average out of 50 Analysis made the mean return of all the analysis higher than themean return of the Top 20 stocks. The Top 20 stocks have a mean of 7.3083 as calculated, while themean return of the 50 Analysis is 9.2924. This implies that Random Generators’ portfolio stands achance to perform better than the Top 20 stocks in Malaysia. Apart from that, the variation is only1.9842 and most of the randomly generate stocks will not run much of their return figures from themean. The variation is computed by taking each portfolio mean return minus the mean return of thebenchmark portfolio. Thus, using Artificial Intelligence that is able to provide random generation of abenchmark indexes will produce better result that has over-performed the Top 20 Stocks in Malaysia(based on Market Capitalization). This proves that in a portfolio, stocks with negative correlations tendto perform better as observed in the analysis.From the variation that 36 out of 50 analysis performed below the Top 20 stocks. This indicates72% of the stocks that is randomly generated will tend to under-performed than the Top 20 stocks inMalaysia. However, on the other hand, there are two analyses that performed extremely better thanMalaysian Top 20 that reached up to 220 points and 70 points better than the portfolio construction. Asfrom this random analysis that did not have any learning system, we hope to capture this idea in thelearning system for future analysis.On the other hand, using an analysis tool the SmartFolio, that is readily applicable in the market tofurther show the good extent of neural network and Artificial Intelligence capability, a run of 20analyses was executed to get the results to compare the Top 10. From the SmartFolio, the mean returnfor Top 10 stocks in Malaysia is 13.40% while the mean return of 20 non-bias random generated 10-stocks portfolio is able to generate 28.43% mean return. A nearly double performance as compare tothe benchmark portfolio and only 16.43% variation of the each portfolio compare to the benchmark. Asthis tool is mainly for assistance purpose, the number of stocks that underperformed the Top 10Malaysian stocks is only 2 over 20. This means only 10% of the portfolio generally performed worstthan the Top 10 stocks.One crucial limitation is that the SmartFolio would not be able to perform on the random generatorsthat the study did with certain algorithm designed by the authors. Another instance is the SmartFolio(trial version) can perform only 16 stocks per portfolio. Perhaps, using multiconnect architecture(MCA) with some modifications will increase the optimal performance thus, avoiding the Hopefieldneural network limitations [19].

5. Conclusion

The optimizing portfolio construction using artificial intelligence is an optimization processembedding theories not just Modern Portfolio Theory but engineering and IT theories like Boltzmannand Hopfield into the actual environment. This learning process adopted the theories and thus, makingthe system flexible is another added advantage to the heuristic effects and a great leap forward.Theories are made for us to know how things will happen and in fact, many theories on the surfaceprove many points, but in real practice, are not able to perform to the optimum. With that, we added theRandom Generators program as part of the Layer 1 activity to demonstrate that Artificial Intelligencecan do a better job in selecting or constructing a portfolio. Thus, it is also important for us tounderstand that Portfolio Construction is still subjected to human (behaviour) judgement, but the keypoint is the system acts as a catalyst in making human’s decision faster, wiser and clever. Adapting thisideal model, we can further optimize portfolio construction using heuristic process to learn togetherwith supersonic speed and better decision outcomes.