# Portfolio Return Modelling Using ANFIS

DOI : 10.17577/IJERTV1IS9379

Text Only Version

#### Portfolio Return Modelling Using ANFIS

Dimple Bohra

M.E. (Computer Engineering) student of Thadomal Shahani Engineering College,

Mumbai, Maharashtra, India.

Shalini Bhatia

Associate Professor, Thadomal Shahani Engineering College,

Mumbai, Maharashtra, India.

Abstract

This paper proposes the modelling of portfolio return using neuro-fuzzy system. The learning capability of neural network is combined with the ability of fuzzy logic to represent human knowledge in the form of fuzzy rules. The proposed model utilizes adaptive neuro fuzzy inference system (ANFIS). In this system, the inputs namely opening price, closing price and the desired return constitutes the training data set. The actual return so obtained by ANFIS is graphically plotted against the desired return in order to judge the accuracy achieved. The advantage of the framework is to help the investor to double check the return which can be gained by combining various investments in commodities so as to mitigate the risk in future investment.

1. Introduction

As popularly understood portfolio means identifying a particular asset class (commodities) so as to obtain optimum returns based on a set of data. Portfolio return means the summation of the gain made as a result of chosen investment in a given portfolio. Portfolio selection comes under optimization problem wherein one has the option of maximizing return for given level of risk or minimizing risk for given target return. Different optimization algorithms like Genetic Algorithm, Simulated annealing algorithm etc. are available for achieving the objective. These methods take expected returns as input for getting the proportions of each commodity to be selected for investment in a portfolio. Expected return is calculated by considering the opening and closing price of a particular commodity on the previous day. Although these methods are found to be quite effective to identify productive portfolio, a mechanism to double check the investment strategy will enhance the level of assurance in portfolio selection for getting optimum returns. In the

proposed method, the expected returns are compared graphically with the actual returns, and thereafter refine the commodity selection in a portfolio to further minimise the risk element. By using ANFIS model, a classical tool can be made available to an investor which is capable of providing investment guidance with improved returns.

2. ANFIS model

ANFIS is a type of fuzzy inference system (FIS). In nutshell, FIS is to express human knowledge and logical reasoning process in the form of fuzzy if-then rule rather than in the form of quantitative analysis. FIS are of two types i.e. Mamdani-type inference system and Takagi- Sugeno type inference system. ANFIS is functional equivalent of FIS designed to obtain similar output. ANFIS is classified under Sugeno- type inference system. The typical architecture of ANFIS [1][5] is as under:

Figure 1 ANFIS architecture [1]

A first-order Sugeno-type fuzzy model with two inputs x and y and one output z has following rules: Rule1: If x is A1 and y is B1, then f1 = p1x +

q1y + r1

Rule2: If x is A2 and y is B2, then f2 = p2x + q2y + r2

ANFIS requires a training data set that contains the desired input/output data to be modelled. This data set must be an array with the data arranged as column vectors, and the output data in the last column. The main input is opening and closing price of a commodity for the previous day. Using these values, expected return of each commodity is calculated by the formula:

Ei Ci Oi Oi

(1)

where, Ei is an expected return of ith commodity, Ci and Oi are closing and opening price of ith commodity respectively.

For the purpose of calculating the output, the opening and closing prices are obtained from the website (URL:http://www.mcxindia.com) of Multi- Commodity Exchange (MCX), India.

ANFIS can either be programmed in matlab or a built in fuzzy logic toolbox (ANFIS GUI editor) can be utilized for modelling portfolio return. The proposed method uses ANFIS GUI editor. To start GUI editor, anfisedit command is used. ANFIS GUI editor looks as under:

Figure 2 ANFIS GUI editor [2]

3. Return modelling by ANFIS

To begin with, training and checking data set is loaded from workspace which consists of 85 and 47 input/output data pairs respectively. Once the data is loaded, either own FIS is generated and saved in a file or FIS is generated by using built in grid partitioning or subtractive clustering method [6]. FIS so generated contains three membership functions (values) for both the inputs as low, stable and high. These inputs can be represented in ANFIS by triangular, bell, Gaussian function etc. By default it is bell function. Rule base is of size 3×3 as a result 9 rules are obtained using rule editor. Figure 3 shows rule editor for FIS.

Figure 3 Rule editor for FIS

As required by ANFIS, the number of output membership functions (values) is equal to number of rules i.e. 9, ranging from very poor to very good. These outputs can be either linear or constant, and all outputs must be of same type. Sugeno-type system is capable of yielding the said outputs only. After loading data and generating the FIS, FIS training is started. For training, two optimization algorithms are provided by ANFIS [2] namely hybrid and back propagation. The ANFIS is trained by a hybrid learning algorithm [3]. In the forward pass the algorithm uses Least-Square Estimator [4] method to identify the consequent parameters on the layer 4. In the backward pass the errors are propagated backward and the premise parameters are updated by gradient descent.

Table 1 summarizes the activities in each pass.[1]

Table 1 Two passes in the hybrid Learning Algorithm for ANFIS

The number of training epochs and the training error tolerance is set as the stopping criteria for training. The training process stops whenever the maximum epoch number is reached or the training error goal is achieved. Here, training error tolerance is set to 0 and epochs set to 45.

In the proposed method, four approaches have been devised:

1. Bell as input membership function and output as constant.

2. Bell as input membership function and output as linear.

3. FIS is generated using built in Grid partitioning method by trying following combinations:

1. Bell as input membership function and output as constant.

2. Bell as input membership function and output as linear.

The results obtained by utilizing the above methods are tabulated as under

Table 2 Results of all approaches

 Approach Training error Testing error for training data Testing error for checking data 1 0.0019308 0.0020322 0.0010486 2 3.6569e- 005 3.6569e- 005 3.3889e- 005 3.1 0.005568 0.0056117 0.0046299 3.2 0.005413 0.005413 0.0046189

Out of the four approaches, approach number 2 yields better results compared to others. The graphical representation also confirms that the approach number 2 is superior to other approaches.

Figure 4Testing of training data by approacp

In figure 4, red colour represents FIS output while training data is depicted in blue colour. In most of the cases, the colours are overlapping or are in close proximity, this clearly shows the efficiency of approach 2.

It would be advantageous to verify that everything is behaving the way it should be and this can be done by utilizing RuleViewer. RuleViewer is one of the components of fuzzy logic toolbox which can be opened from the View menu of ANFIS editor. Figure 5 shows Rule viewer for generated FIS.

Figure 5 Rule viewer of FIS

The Rule Viewer shows one calculation at a time and in great detail. In this sense, it presents a sort of micro view of the fuzzy inference system. In order to see the entire output surface of system, i.e. the entire span of the output set based on the entire span of the input set, the Surface Viewer is used. It can be opened from the View menu of ANFIS editor. Figure 6 shows surface viewer for generated FIS.

Figure 6 Surface viewer of FIS

4. Conclusion

ANFIS is a sophisticated tool to predict the returns of a particular portfolio by taking into account a set of data. ANFIS is one of the best trade off between neural network and fuzzy systems providing smoothness due to the Fuzzy Control interpolation and adaptability due to the Error Back propagation Training Algorithm. ANFIS is used to compare training, testing data with FIS output. However, there are some constraints of ANFIS as it supports only Sugeno- type systems. ANFIS is subject to computational

complexity restrictions. Despite the limitations, the results achieved by ANFIS are authentic.

5. References