Constructing a Predicting Model for JCI Return Using Adaptive Network-based Fuzzy Inference System

The high price fluctuations in the stock market make an investment in this area relatively risky. However, higher risk levels are associated with the possibility of higher returns. Predicting models allows investors to avoid loss rate due to price fluctuations. This study uses the ANFIS (Adaptive Network-based Fuzzy Inference System) to predict the Jakarta Composite Index (JCI) return. Forecasting JCI movement is considered to be the most influential predictor, consisting of Indonesia real interest rate, real exchange rate, US real interest rate, and WTI crude oil price. The results of this study point out that the best model to predict JCI return is the ANFIS model with pi membership function. The predicting model shows that real exchange rate is the most influential factor to the JCI movement. This model is able to predict the trend direction of the JCI movement with an accuracy of 83.33 percent. This model also has better performance than the Vector Error Correction Model (VECM) based on RMSE value. The ANFIS performance is relatively satisfactory to allow investors to forecast the market direction. Thus, investors can immediately take preventive action towards any potential for turmoil in the stock market.JEL Classification: D13, I31, J22DOI: https://doi.org/10.26905/jkdp.v23i1.2521


Introduction
As a nation with the largest emerging market in Southeast Asia, Indonesia has a distinct value that attracts investors to Indonesia. According to a survey conducted by the United Nations Conference on Trade and Development (UNCTAD), Indonesia was categorized as one out of four nations with the most promising investment destination for 2017-2019 (UNCTAD, 2017). The influx of investment funds to Indonesia through capital market attracts more investors than through direct investment due to its better liquidity. As historical data reveals an average growth of the Jakarta Composite Index (JCI) for the last ten years (2008)(2009)(2010)(2011)(2012)(2013)(2014)(2015)(2016)(2017) was 13.1 percent. This value was beyond an average inflation rate, which was equal to 5.4 percent. Thus, it positioned Indonesia as a nation with the second largest growing stock exchange in the world after the Philippines.
However, JCI as a benchmark index in Indonesian stock market has a high level of volatility (Kartika, 2012), suggesting that not only investing in Indonesian stock market does provide an opportunity for large profit but also carries risks. Both internal and external factors can influence stock price movements in the capital market (Divianto, 2013;Patar, Darminto, & Saifi, 2014). Internal factors include corporate financial performance and internal company policies which generally only affect the share price of the issuers. Meanwhile, external factors include macroeconomic conditions and energy commodity prices that affect most of the issuers on the stock market (Krisna & Wirawati, 2013;Raraga, Chabachib, & Muharam, 2013). Therefore, these factors are put into consideration by many investors when measuring the potential return and risk of investment.
The high volatility in the Indonesia stock market in 2008 and 2015 which was followed by both domestic and foreign fluctuations in some macroeconomic variables made some investors restless. The decline of JCI was due to global financial crisis triggered by the housing credit crisis in America as the property sector being hit by high-interest rate of the US central bank (The Fed), forcing The Fed to reduce its benchmark interest rate from 5.25 percent in June 2007 to 2.00 percent in June 2008.
In addition, the 2008 financial crisis also had an impact on the world oil prices and Indonesian Rupiah (IDR) exchange rate. The price of West Texas Intermediate (WTI) crude fell from 140 dollars per barrel in June 2008 to 44.60 dollars per barrel in December 2008. Consequently, the IDR exchange rate went down especially in the second half of 2008 which was the culmination of the financial crisis. This poor condition was worsened by the high level of domestic inflation, leading real interest rates fell within the negative range. The decline in the JCI in the year 2015 also occurred along with both depreciation of IDR exchange rate and the issue of the Fed's interest rate increase. Understanding how macroeconomic variables and global economic conditions indices influence the movement of domestic stock market allow investors and regulators to anticipate any possible turmoil in the future domestic stock market. Therefore, the latest research on the influence of macroeconomic variables both domestically and abroad on the return of the JCI is important for setting a benchmark for the Indonesian stock market index. Some predicting models have been used to allow investors to forecast the future stock price movements (Tung & Quek, 2011). These models, such as moving averages, exponential smoothing, and Autoregressive Moving Average (ARIMA), have been quite successful in fulfilling this purpose (Anityaloka & Ambarwati, 2013;Lilipaly, Hatidja, & Kekenusa, 2014;Muslim, 2018). However, these models have some limitations as most of their variables, i.e., the stock market index, come with non-linear relationships, making impossible to predict stock market with classical linear models (Yudong & Lenan, 2009). A quality predicting model helps investors increase potential profits on the stock market and avoid the risk of losses. Therefore, stock market prediction remains a fascinating topic to discuss even to these days.

Hypotheses Development
Some computational techniques have been extensively used for non-linear prediction. The use of artificial intelligence system such as an artificial neural network (ANN), fuzzy systems, and various artificial algorithms have been widely used in finance (Atsalakis & Valavanis, 2009b). The models have been quite successful in solving the problem regarding timeseries financial prediction.
Adaptive-network-based fuzzy inference system (ANFIS) is one of the non-linear models combining the superiority of each fuzzy logic and artificial neural networks (Jang, 1993). This model uses a neural network learning method to adjust parameters in the fuzzy control system. Hence it can improve if-then rules on fuzzy control system through a superior ability of complex system behavior description (Jang, Sun, & Mizutani, 1997). With a combination of each superiority of the features, this predicting model is expected to yield better results. This assumption is supported by some previous studies that affirm satisfactory results for a model with a similar approach. One of these studies was conducted by Boyacioglu & Avci (2010) predicting Turkish stock market returns, the ISE National 100 index. This study used ANFIS approach to establish relationships among variables, e.g., gold prices, exchange rates, interest rates, inflation, reduction index, treasury bill interest rates, and closing prices of DJIA, DAX, and BOVESPA. The result of the study indicated that an ability to predict the stock market could be optimized with ANFIS. Its prediction accuracy was 98.3 percent for the ISE National 100 index.
Another study using ANFIS was conducted by Atsalakis & Valavanis (2009a) to predict stock prices on the NYSE and ASA. The result of the study indicated that the ANFIS method gave a satisfactory result. The prediction was tested by the root mean square error (RMSE), mean square error (MSE), and absolute minimum error (MAE). The input of study was stock data, i.e., daily data on day t and previous day (t-1). The accuracy rate of prediction was 62.33 percent. Yunos, Shamsuddin, & Sallehuddin (2008) predicted daily movements of the Kuala Lumpur Composite Index (KLCI) using ANFIS and ANN methods. Some technical indicators were used as input variables such as KLCI prices at time t and t-1, MA 5 days period, RSI 14 days period, and stochastic indicators. The results of this study showed that the ANFIS model was more reliable in predicting KLCI than ANN. Fahimifar et al. (2009) compare the performance of non-linear model models with linear models to predict Iranian exchange rates against the US Dollar and Euro. The non-linear models used ANFIS and ANN, while the linear model used GARCH and ARIMA. The result showed that non-linear models were better than linear models. ANFIS was the best model for prediction, followed by ANN, GARCH, and ARIMA. Raoofi, Montazer-Hojjat, & Kiani (2016) predicted the stock market index of Tehran (Iran) by using several prediction methods, i.e., ANN, ANFIS, fuzzy regression, and ARIMA. The input of study was TEDPIX daily price on day t to t-9. The result showed that the ANFIS method was able to provide the best predicting results compared to the other three methods. These previous studies support the ANFIS model as a reliable one to predict the stock market. In addition, the performance of the model depends on each predictor. A majority of previous studies use technical factors as predictors; yet, only a few studies use fundamental factors even though fundamental factors mostly trigger a lot of turmoil in Indonesia stock market.
Therefore, the ANFIS model is used in this study to predict Indonesia stock market using macroeconomic variables such as Indonesia's real interest rates, USD and IDR real exchange rates, the real American interest rates, and world oil prices. An increase in interest rate in a nation directly influences its capital market. If interest rates increase, the capital market tends to decrease (Ali, 2014;Amarasinghe, 2015). This happens because the investors attempt to transfer some of their funds to other types of investment. A study conducted by Harsono & Worokinasih (2018) showed | 4 | a similar conclusion as well, in which the interest rate has a negative and significant effect on the JCI.
Exchange rate influences stock prices based on company types. Exchange rate depreciation negatively influences import-oriented companies' stock prices, whereas the exchange rate depreciation positively affects to export-oriented companies' stock prices. The relationship of exchange rate changes with JCI depends on the dominant group of impacts as well. Some historical data shows that the decline of the JCI also followed the weakening of IDR exchange rate in 2013 and 2015. This indicates a positive relationship between the decline of IDR exchange rate and the decline of JCI. Some studies also point out both negative and significant influence of the exchange rate on JCI (Krisna & Wirawati, 2013;Harsono & Worokinasih, 2018). In this case, the interest rates of The Fed have an impact on the Indonesian capital market as well. The increase in the Fed's interest rate could lead to the withdrawal of foreign funds from the Indonesian stock market, causing turmoil on the JCI. A study by Miyanti & Wiagustini (2018), shows that The Fed's interest rate has a positive and significant effect on the JCI. Aside from being affected by the high-interest rate of The Fed, JCI is influenced by world oil prices since Indonesia is the oil importer & coal exporter country that relies on world oil prices to determine these commodity prices. For oil importing countries, rising oil prices will have a negative impact on their stock markets. Gumilang, Hidayat, & Endang (2014) and Kowanda et al. (2015) states that oil prices have both a negative and significant effect on the JCI. However, the decline in world oil prices in 2008 actually lead the JCI to plunge at the lowest level of the year. Hutapea, Margareth, & Tarigan (2014) identified the effect of oil prices on the JCI during the period 2007-2011, revealing that oil prices had a significant positive effect on the JCI.

ANFIS Architecture
ANFIS is an improved version of the fuzzy logic model which has been taken into the next level with a neural-network learning system that could transform expert knowledge into some rules for non-linear relationships. The rule establishment takes a long time, both in the selection of membership function and determination of the weighting rules. The neural network will improve the predicting model to be faster and more accurate; leading to a better consistency with long-term prediction than of classical economics models with error rates come along with the extent of prediction period. In addition, the learning technique allows better consistency of long-term prediction compared to classical economics models whose error rate increases with the progress of the predicting period. The design of the ANFIS model is presented in Figure   Figure 1. The architecture of the ANFIS Model Constructing a predicting model for JCI return using adaptive network-based Fuzzy Inference System

Endy Jeri Suswono, Dedi Budiman Hakim, & Toni Bakhtiar
| 5 | 1, showing two inputs and one output in the structure of the model. The network consists of five layers and uses two kinds of vertices, namely loop vertices and square vertices. The loop node is also called a fixed node because it has a fixed mathematical operation and no parameter adjustment process. The box-shaped knot is an adaptive node since no parameter adjustment process in this stage.
Input variables consisting of x 1 and x 2 assigned as Layer 1 into the membership function, namely A i and B i . The membership function can be explained using various membership functions like the generalized-bell which is explained through the following equation: of 1 represent the normalized weight for the 1 st fuzzy rule. w 1 and w 2 are the weight of the first and second node in a previous layer.
Moreover, the output from Layer 3 will get into Layer 4. The node in this layer is adaptive because there are parameters that will be optimized through the training process. The Layer 3 output will be multiplied by f i based on Takagi-Sugeno fuzzy inference system. The variable f i in the first order Takagi-Sugeno model is a linear combination of input variable plus a constant term, whereas in the zero order Takagi-Sugeno model, variable f i is only a constant term. These parameters will be optimized in training process. Variable f i also indicates the weights of each fuzzy rule because the output of each node in this layer will determine the output value of each node in the ANFIS model altogether. This is because at Layer 5 there is only one single node in the form of a sum operation. Therefore, the output of Layer 5 can be explained through the equation as follows: is the degree of membership input x 1 on A 1 membership and as the output of Layer 1. Meanwhile a 1 , b 1 , and c 1 are parameters for the membership function A 1 or also called premise parameters. These parameters will be optimized through the training process using the gradient descent method.
The output from Layer 1 will be connected with a set of fuzzy rules that directly impacts up to Layer 4. The node at Layer 2 is labeled 2 is labeled  i . In this layer, a multiplication operation is carried out between the output of the node at Layer 1 resulting in the new degree of membership represented by .. Thus, is obtained through the following equation: w 1 is the output value of layer 2 for node  1 . A 1 (x 1 ) is the degree of membership of the input on membership A 1 and B 1 (x 2 ) is the degree of membership input x 1 on membership of . The output of Layer 2 will enter Layer 3. The node at Layer 3 is labeled Ni is the normalization of the previous layer output node. Normalization is performed by dividing the output of i from Layer 2 with the total output of all nodes at Layer 2. Layer 3 output is labeled d . . Thus, the value of of 1 is obtained through the following equation: is the final output of the ANFIS system. f i , p i , q i , and r i are parameters that will be optimized and known as consequent parameters. The parameter optimization uses the least-squares estimator (LSE) which is further explained by the following equation (Jang, 1993): X is the consequent parameter vector. A represents the Layer 3 output matrix. A T is the matrix transpose of A. B as the actual data output vector.

ANFIS Model constructions
The design procedure of the model begins with an initial stage of data collection consisting of input

Jurnal Keuangan dan Perbankan
Volume 23, Issue 1, January 2019: 1-13 | 6 | data and output data in the form of monthly time series. Beforehand, the data are tested for stationarity. The stationarity test is carried out using the Augmented Dickey-Fuller (ADF) test. Stationary data at 5 percent level will be used as a variable for the ANFIS model.
Moreover, the pair of input and output data is divided into two parts. The first part is training data for the period of January 2003 to December 2015. The second part is testing data for the period of January 2016 to December 2017.
The data used in this study are monthly time series about Indonesia's real interest rates, the real exchange rates of IDR and USD, the real US interest rates, world oil prices, and the JCI. The data is in the form of natural logarithms (ln), except for data that is already in the form of percent such as interest rates. The real interest rate is the interest rate minus the inflation rate. Likewise, the real exchange rate is the nominal exchange rate after being adjusted with inflation factors from each country. The Indonesian real interest rate is The Bank of Indonesia interest rates minus Indonesia inflation.
The data of Indonesia interest rates and the inflation rate are retrieved from www.bi.go.id. The data about the calculation of US real interest rates are obtained from The Fed's interest rate (Federal Fund Rate, FFR) minus the American inflation rate. The FFR data was retrieved from fred.stlouisfed.org, while American inflation data was obtained at www.bls.gov. The calculation of the real exchange rates of Indonesia and the US (USDIDRR) refers to the nominal exchange rate of the US dollar against rupiah. The nominal exchange rate data is closing prices on the spot market which retrieved from www.investing.com. The oil price data refers to West Texas Intermediate (WTI) oil prices traded on the New York Mercantile Exchange (NYMEX). WTI price data is also retrieved from www.investing.com. JCI data used in the form of monthly closing values are retrieved from finance.yahoo.com.
The design of the model in this study was carried out using the help of the Matlab 2018a application. Pair of input and output data is prepared in the form of a matrix with the first four columns as input and last column as output. Fuzzy control systems are generated using the grid partition method. Ahead of the training process, number and shape of the input membership function must be assigned, This study uses two membership functions for each input and each constant output function. There are eight types of membership functions that can be selected, including trimf (triangle), trapmf (trapezium), gbellmf (generalized-bell), gaussmf (Gaussian), gauss2mf (Gaussian combination), pimf (pi), dsigmf (difference of two sigmoid), and psigmf (product of two sigmoid). Each shape of the membership function will be tested on the zero order of the ANFIS Takagi-Sugeno model for identifying the best model.
The training process uses a hybrid learning system in which the output function parameters (consequent parameters) will be optimized using the Least Square Estimator (LSE) method. Whereas the input function parameters (premise parameters) will be determined using the gradient descent method. The training process will end when the smallest error value is obtained. The error size is a root-mean-squared error (RMSE). The RMSE value is obtained through the following equation: n is the number of data sets from the test data.
^ indicates the predicted value on the data point m. is the actual value on the data point m.
Following a complete training process, the model is tested to see how it works. This testing process also uses a data pair consisting of pairs of input and output, except that at this stage there is no parameter adjustment process like in the training stage. Output data on the test data will be compared with the output of the model. The size used at the testing stage is also based on the RMSE value. The smaller the RMSE value, the better the interpretation of the model. This process can be done simultaneously with the training Constructing a predicting model for JCI return using adaptive network-based Fuzzy Inference System

Endy Jeri Suswono, Dedi Budiman Hakim, & Toni Bakhtiar
| 7 | process. After selecting the model, the performance of the model will be evaluated by comparing with the conventional econometric model, the Vector Error Correction Model (VECM). It is one of the forecasting models that fit the research design so that it can be used as a comparison to evaluate the performance of ANFIS forecasting models. The performance indicators based on RMSE value and the accuracy in terms of trend predictions of the JCI. The accuracy calculation method is explained through the following equation (Ahmad et al., 2015): is a trend in the model interpretations that is equivalent with the actual trend.
indicates total number of attempts used in the test.

Results
Stationarity test was performed using the ADF test to compare the ADF statistical values with MacKinnon Critical Value. If the statistical value is smaller than the value of MacKinnon Critical Value, then the data is stationary. Conversely, if the ADF statistical value is greater than the value of the MacKinnon Critical Value, the data is non-stationary. The results of stationarity tests are presented in Table 1.
Based on the results, SBRID is stationary at the level of five percent and the rest are not stationary. Other variables are stationary at first difference with a real level of five percent. Thus, the variables used for ANFIS model include JCI return as an output variable and Indonesian Real Interest Rate as an input variable, changes in the real exchange rate (DSBRUS),    Table 2.

First Difference
There are 179 pairs of data used in this modeling procedure. 155 of the data pairs are used as training data from February 2003 to December 2015. The remaining are 24 pairs of test data from January 2016 to December 2017. Training data is used as a basis for model formation because the parameters in the model are obtained based on the training data. The model obtained from the training process is further tested using a new pair of data (test data) by comparing the results of the measurement model with its actual value. The testing stage is used to determine whether the model is reliable enough to predict the future or only good in its establishment.
The construction of the predicting model in this study is presented in Figure 2. The model uses four inputs consisting of Indonesian real interest rate (SBRID), changes in the real USD & IDR exchange rate (DlnUSDIDRR), changes in US real interest rates (DSBRUS), and changes in WTI oil prices (DlnWTI). Each input is then arranged into two memberships, namely L i and H i . L i indicates low and H i indicates high. Assignment of membership functions is based on the results of training and testing data. The results of training and testing models are presented in Table 3. Based on the results, the selected model is one with a pi-shaped membership function. The pi-shaped membership function is explained by the following equation:

Figure 2. ANFIS Prediction Model for JCI Return
The function f(x) is a membership degree of input x, where is the input value. a, b, c, and d are parameters that will be optimized through the training process. The parameter value of the ANFIS model input membership function in the form of pi after the training process is presented in Table 4. The grouping of input variables with membership functions is then illustrated in Figure 3.    The construction of the model in Figure 1 shows that there are 16 fuzzy rules and fi as output parameters. The constant in the output function is the weight of each fuzzy rule which is also known as the consequent parameter. Information about fuzzy rules and their consequent parameters are explained further in Table 5.

Constructing a predicting model for JCI return using adaptive network-based Fuzzy Inference System
The weight of the fuzzy rule also describes how JCI response to various macroeconomic conditions which alert any potentials of fluctuation in JCI within the short term, based on the weight of the largest and smallest fuzzy rules. The condition that provides the most positive response is the 1 st fuzzy rule, i.e., the low Indonesian real interest rates (< 3 percent), low changes in the real USDIDR exchange rate (< 0.03), low changes in US interest rates (< -0.9), and low changes in WTI oil prices (< -0.2).
Meanwhile, conditions that give the greatest negative response are the 5 th fuzzy rules such as Indonesia's low real interest rates (< 3 percent), high changes in the real USDIDR exchange rate (> 0.1), low changes in US interest rates (< -0.9), and low changes in WTI oil prices are low (< -0.2). This model shows that the real exchange rate variable (USDIDR) has the greatest influence on the JCI compared to the other three macroeconomic variables.
Based on the result of model testing on the return JCI using new data pairs, it shows that the ANFIS model can predict the trend direction of the stock market with an accuracy of 83.33 percent. It is better than the VECM model which the accuracy is 62.50 percent. The error value of model testing based on the RMSE indicator is 0.0281 for ANFIS model and 0.0302 for VECM model. This value, when compared with a range of return JCI, has a ratio of 23.95 percent for ANFIS model and 25.72 percent for VECM model. The results show that the ANFIS model has better predicting performance than the VECM model. The description related to the results of predicting model with the actual values is shown in Figure 4.

Discussion
Since predicting stock market movement involves many factors, it becomes difficult to forecast the movement of the stock market. However, the development of predicting model in stock market remains an interesting topic to discuss because it helps investors to earn large profits or to avoid any potential losses. The development of computing technology is very helpful in the development of predicting model. ANFIS is one of predicting model that has been used in the application of Matlab 2018a for easier and faster one.

| 11 |
The rule if-then in ANFIS model gives a different response on the change of JCI return due to some changes in macroeconomic conditions. Fuzzy rules with the largest and smallest weight indicate the most vulnerable conditions which predict turmoil in JCI. This condition happens when Indonesia's real interest rates are low, and both world oil prices and American real interest rates have low changes. In these conditions, change of real exchange rate of USD against IDR determines whether the turmoil has positive or negative impacts. If the change in the real exchange rate is low, then the turmoil has a positive impact on JCI. Conversely, if the change in the real exchange rate is high, the turmoil will have a negative impact on JCI with the larger scale of impact compared to low change real exchange rate. This indicates that the real exchange rate is the main factor that has more potential in triggering stock market turmoil, compared to the other three macroeconomic variables.
The results of this study indicate that the stability of IDR exchange rate is very sensitive toward the JCI movement. As a regulator, The Bank of Indonesia should be able to maintain the stability of IDR exchange rate to reduce the potential turmoil in the domestic stock market. The capital market players should keep up-date of the development of macroeconomics, especially those of exchange rates such as the benchmark of interest rates and world oil prices. If there is potential turmoil in the exchange rate such as planning to increase The Fed's interest rates, the shortterm investors must refrain from entering the stock market or relocating investment portfolio to other safer instruments.
The model evaluation showed that ANFIS has better performance than VECM with RMSE value at 0.0281. This result is not as good as the results of the modeling conducted by Boyacioglu and Avci (2010) which took the case on the Turkish stock exchange. The study obtained an ANFIS forecasting model with the RMSE value of 0.0068. This discrepancy could be caused by several things such as differences in market characteristics and input variables used. However, this result reinforces the statement that non-linear models have better forecasting performance than linear models as done by Fahimifar et al. (2009) and Raoofi et al. (2016).
The performance of the predicting model is quite good to predict the future direction of JCI with an accuracy of 83.33 percent. The model can be an alternate model for predicting the direction of market movement. However, the use of this model as a benchmark to determine the price target is still very limited because the RMSE value of normalization is still quite high at 23.95 percent. The smaller the normalization value of RMSE, the better the predicting model created.

Conclusion
The forecasting model for JCI return that obtained from this research is the ANFIS model that applies pi-shaped membership function. The model has better predicting performance than VECM and able to describe the direct effect of changes in macroeconomic factors of the JCI. The predicting model shows changes in real exchange rate highly impact on JCI return compared to the other three variables. This indicates that the JCI movement was very sensitive to the stability of the exchange rate. The Bank of Indonesia, as a regulator, should maintain the stability of the Indonesian exchange rate. The investors should keep up with the information of the latest macroeconomic conditions, mainly related to exchange rates in order to anticipate stock market turmoil.

Limitations and suggestions
The ANFIS predicting model is good enough in predicting the market movement. The model obtained able to predict JCI return trend with accuracy at 83.33 percent. Although the performance is better than VECM, it has some limitation that refrains its use as a benchmark to determine price target due to its relatively high error value. Therefore, the use of other non-linear predicting models opens any possibilities for further development of the more advanced model in this field.