Your SlideShare is downloading. ×
MFC-092 AksoyLeblebicioglu.DOC
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

MFC-092 AksoyLeblebicioglu.DOC

289

Published on

Published in: Business, Economy & Finance
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
289
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
2
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Modelling the Ise100 Index by Using Fuzzy Logic and Neural Fuzzy Systems Hakan AKSOY (corresponding author) Ph.D. Candidate (in Finance) Senior Portfolio Manager Department of Management Koc Asset Management Bogazici University, Istanbul, Turkey Besiktas, 34349, Istanbul, Turkey
  • 2. Email: haksoy@bilkent.edu.tr Phone: +90 (532) 706 53 66 Fax: +90 (212) 213 71 56 Prof. Dr. Kemal LEBLEBICIOGLU Electrical Engineering Department Middle East Technical University ODTU, 06531, Ankara, Turkey Modelling the Ise100 Index by Using Fuzzy Logic and Neural Fuzzy Systems Abstract Fuzzy logic and neural fuzzy models has been constructed to forecast the monthly returns of the ISE100 Index of Turkey by using the following financial variables: price over earning ratio, dividend price ratio, equity transaction ratio, volatility, foreign investment over the ISE100 Index, foreign investments over market capacity of the ISE100 Index, technical analysis of the ISE100 Index, the Dow Jones Index of the New York Stock Exchange, gross national product, industrial production index, capacity utilisation index, balance of payments, FX reserves, external debt stock, FX rate, inflation rate, domestic debt stock, budget 2
  • 3. deficit, repo rate, bond price index, domestic risk and foreign risk. Each of the fuzzy logic and neural fuzzy method has its good and bad aspects and they are complementary methods in designing advanced models. Fuzzy logic is better than neural fuzzy systems in mathematical modelling and expert knowledge but worse than in learning and optimization ability. Consequently, this study compares the modellings of the ISE100 Index of Turkey are demonstrated by using the fuzzy logic and neural fuzzy systems in system view approach. Keywords:Stock Market, Efficient Market, Anomalies, Classifier Systems,Learning, Fuzzy Logic, Dynamic Games, Optimization. JEL Classification: C45, C53, C82, G14. 1. SYSTEM VIEW OF THE TURKISH ECONOMY Economy can be viewed as a system of financial and real variables. These variables are related not only to each other, but also to the domestic and global security and commodity markets. In Turkey, there are three main security markets to trade in TL terms: the stock market, the repo market and the bond market. The stock market in Turkey is the most risky one, an observation that is valid for the markets in the world as well. The Istanbul Stock Exchange (ISE) is the only stock market in Turkey whereby stocks may be bought and sold. Like every investment, investing in stocks entails some degree of risk. There are two types of risk; systematic risk and nonsystematic risk. The nonsystematic risk can be overcome by a sound 3
  • 4. investment strategy, called diversification. However by using the variables in the system of the economy, the systematic risk can be minimised with some nonparametric methods if it is not eliminated (Lo and MacKinlay, 1988). In the past decade, fuzzy systems have been used with conventional techniques in many scientific applications and engineering systems, especially in system theory. Fuzzy sets, introduced by Zadeh (1965) as a mathematical way to represent vagueness in linguistics, are different than the classical set theory. In a classical nonfuzzy set, element of the universe either belongs to or does not belong to the set, in other words the membership of an element is crisp. A fuzzy set is a generalisation of an ordinary set in that it allows the degree of membership for each element in a unit interval. Fuzzy logic and neural networks are complementary methods in designing advanced models. Each method has its good and bad aspects. Fukuda and Shibata (1994) presented the comparison of these techniques. Fuzzy logic is better than neural networks in mathematical modelling, knowledge representation and expert knowledge but worse than neural networks in learning and optimization ability. In this study the bad and good aspects of the fuzzy logic and neural fuzzy systems will be demonstrated by using the modellings of the ISE100 Index. In order to design various types of stock market models, the title of the paper by Lo and MacKinlay (1988) will come to the rescue: ‘Stock Prices do not follow random walks’. In their paper they present that considerable evidence exists justifying this statement and show that stock returns are to some extent predictable. Human reasoning can be modelled as if the thought process is described by the application of fuzzy logic (LeBaron et al, 1999). Traders are capable of handling a large number of rules for mapping of market states into expectations. Tay and Linn (2001) shows this by allowing agents the ability to compress information into a few fuzzy notions which they can in turn process and analyse with fuzzy logic. 4
  • 5. Kooths (1999) developed a macroeconomic model to realise an alternative to conventional expectation hypothesis. The experience and rule based expectations can be used in forecasting behaviour that is characterised by explicit rule orientation (theory foundation), vague formulation (bounded rationality) and learning process (acquisition of experience). Consequently, to characterise the ISE100 Index, there may be easily implemented fuzzy models to explain to some extent predictable behaviour patterns. Thus, this kind of mathematical advanced model for the ISE100 Index has been used for the first time in the literature. In the next section, information about investment instruments, stock market and financial variables is presented. Section 3 presents general concepts about fuzzy logic, membership functions, rule generation and the description of financial time series modelling for the ISE Index. In section 4, a similar model for the ISE100 Index is constructed and optimized by using neural fuzzy systems, followed by the conclusion and studies to be undertaken in the future. 2. THE ISE100 INDEX OF TURKEY AND THE DEPENDENT VARIABLES Every investment has some degree of risk; it requires a certain sacrifice at the present for an uncertain future benefit. When we look at the risk return analysis of the remaining assets; namely stock, repo and bonds: Stock market has the highest level of risk. In Turkey the average fluctuations of bond and repo market are almost similar and significantly less risky with respect to the stock market, because the markets are affected by the similar politic and macroeconomic events. The ISE price indices are computed and published throughout the trading session while the return indices are calculated and published only at the close of 5
  • 6. the session. The ISE100 Index is used as a main indicator of the ISE. The ISE100 is composed of market companies except investment trusts. The contents of the ISE100 Index are selected on the basis of predetermined criteria directed for the companies to be included in the indices as well as in consideration of their ability to represent relevant sectors. The market capitalisation is weighted by the publicly- held portion of each constituent stock kept in custody (Takasbank) (except those kept in non-fundable accounts). The basic formula for calculating of the ISE100 index is as follows: 100 ∑ ( Pit N it Fl it ) i =1 (2.1) ISE100t = Dt where Pit is the closing price stock 'i' at period 't', Nit is the total number of shares of the stock 'i' at period 't' (Paid-in capital/1,000), Flit is the flotation weight (publicly-held portion) of the stock 'i' kept in custody (except those kept in non- fungible accounts) at period 't', and Dt is the value of divisor at period 't' (adjusted base market value). In the calculation of the index only registered prices are taken into account. While forecasting the stock market that is the most risky market, the systematic risk should be reduced by using the variables in the system of economy. These financial variables are price over earning ratio, dividend price ratio, equity transaction ratio, volatility, foreign investment over the ISE100 Index, foreign investments over market capacity of the ISE100 Index, technical analysis of the ISE100 Index, the Dow Jones Index of the New York Stock Exchange, gross national product, industrial production index, capacity utilisation index, balance of payments, FX reserves, external debt stock, FX rate, inflation rate, domestic debt stock, budget deficit, repo rate, bond price index, domestic risk and foreign risk. In this study, modelling depends on three basic variables. These are risk variables, stock market variables and economic variables. 6
  • 7. 2.1 Risk Variables Risk variables consists of two factors: 1. Domestic Risk Factor: All of the risk factors were triggered or instigated by the Turkish government, social and financial groups or instruments. Some examples are the Korkmaz Yiğit case in the final quarter of 1998 and the row between the President and the Prime Minister in February 2001. In each of the cases the stock market was drastically hit. 2. International Risk Factor: Similarly, all of the risks were instigated or caused by external factors such as international politics or social and financial groups. In the beginning of the second half of 1998, the devaluation in Russia threatened the international investors in Turkey and the stock market decreased by 60.6% from 4615 to 1819. The devaluation in Brazil in 1999 is another significant example of international risk factors. 2.2 Stock Market Variables Stock market variables can be grouped into three factors: 1. Technical Analysis of the ISE100 Index: Technical analysis is based on the widely accepted premise that security prices are determined by the supply of and the demand for securities. Typically, technical analysts record historical financial data on charts and study these charts in search of meaningful patterns and they aim to use the patterns to predict future prices. For this variable, I created a survey and gave it to a number of professional investors. For every month from 1997 to 2000, 30 days moving average, 10 days moving average, relative strength index, volatility and total volume of the ISE100 Index were calculated and given to the professional investors in the survey. Investors were asked to forecast the next month's return by considering these parameters from -2 to 2. 7
  • 8. 2. Dow Jones Index in New York Stock Exchange: It is observed that there is a significant correlation between the Dow Jones and the ISE100 Index in the last ten years. The Turkish Stock Market is an emerging market and is heavily influenced from foreign investors because the significant portion of the market consists of foreign investors. Since foreign investors take their positions by considering worlds largest stock market; the New York Stock Exchange, there is a significantly strong correlation between the Dow Jones and the ISE100. 3. Stock Market Ratios: Not only the prices but also some other financial ratios and anomalies affect the stock market significantly. The most important factors are: 3.A. Price over Earnings Ratio: Price over earnings ratio fluctuates inversely to the risk of an asset. For this variable from 1997 to 2000, monthly price over earning ratios are calculated by the ISE and they are used in the simulation for the modelling. 3.B. Dividend to Price Ratio: The return on stocks, or the yield to a holder of a stock, is equal to the dividend (as percent of price) plus the capital gain. There are more than 300 stocks in the ISE. It is used as a variable for the weighted average of each stock's dividend performance calculated by the ISE. 3.C. Volume / ISE100 Index Level: Next to the prices, trading volume is the second most important statistic that an analyst should follow. Because of the high inflation rates and the stock exchange's growth in Turkey, equity turnover ratio gives more precise results. Equity turnover ratio, in other words trading volume over the ISE100 Index level gives the average transaction rate in the ISE. The basic reasons for the importance of the equity turnover ratio are as follows: • Active investors want liquid markets, in which a large volume of contracts is traded. This is desirable because it allows those who are trading large positions to buy or sell at any time without causing a significant price change. 8
  • 9. • In any case of danger such as a need for liquidity or insider knowledge of bad news, investors need to sell the stock if the demand is enough. • The demand for well performing stocks is always higher than the ones that cause more transactions and higher equity turnover ratio. • After making profit, selling the stock is easier than after stopping the loss, selling the stock in human psychology. Thus, in bullish market (market in positive trends) volume and transaction rate increase. However, in bearish market (market in negative trends) generally investors expect that the market will turn back. As a result they prefer to hold the stock. For this variable, the ratio of the monthly trading volume over the monthly average of the ISE100 Index level is calculated. 3.D. Volatility of the monthly returns of the ISE100 Index: Volatility is defined as a measure of the risk of the stock market investments. Corporations use stock markets to raise capital for investments. The most important function of the stock market is to raise capital for corporations. If stock prices rationally reflect fundamental values, the stock market can then serve as a forecasting signalling for firms and investors to guide the process of capital allocation. If stock prices deviate from real values because of noise trading or volatile movements, investors may not want to hold equities, which tend to increase capital cost and affect investment negatively. The standard deviation of the monthly returns of the ISE100 Index is calculated and used as a variable. 3.E. Foreign Investments / ISE100 Index Level: In emerging markets, foreign investments are high relative to the domestic investments. From 1997 to 2000, the foreign investments in the ISE change between $3.07 billion to $15.36 billion that is quite important for the Turkish economy. Since the emission, the total money in the Turkish Economy is around $3-5 billion, the decision of the foreign investors can affect the Turkish economy deeply. Consequently, the ratio of foreign investments over the ISE100 Index is very important to analyse how the market will behave; because, the decision-makers of the foreign investments are very 9
  • 10. professional in managing their portfolios. They can follow the news faster than the regular investor and can affect the market. 3.F. Foreign Investments / Market Capacity of ISE100: Free float market capacity of the ISE changes between approximately $7 billion to $24billion. As written above, the foreign investments in the ISE change between $3.07 billion to $15.36 billion. As seen from the numbers, the market leader of the ISE is foreign- investors. However, even foreign-investors have faced big losses in the ISE. As also mentioned earlier, if the investors' movements are synchronised with the market, the index fluctuates normally. If the big players of the ISE have large amount of losses, they will not allow the market to soar sharply. Consequently, the ratio of foreign investments to market capacity of the ISE100 is also a good indicator to analyse the trend of the index. 2.3 Economic Variables The economic variables can be grouped into four factors in which the last one, TL market has high correlation with the ISE. Thus, the importance of the TL market is more than the other parts in the modelling part. To group them into their categories, these four factors are: 1. Real Economic Indicators: Macroeconomic performance in Turkey can be measured by three broad measures: GNP, industrial production and capacity utilisation level. News of these three variables makes the headlines because these issues affect our daily lives. They also dominate the research agenda in macroeconomics. 1.A. Gross National Product (GNP): When the growth rate is high, the production of goods and services is rising, making possible an increased standard of living. With the high growth rate typically go lower unemployment and the availability of more jobs. High growth is a target and hope of most securities. The growth rate of real GNP is the most important of all the macroeconomic indicators by which to judge the economy's long run performance. In Turkey, quarterly real GNP values 10
  • 11. are available. By using linear interpolation method, the data are converted to the monthly real GNP values. Because of the seasonality, the each month's data are divided by the previous year's same month's data as a variable for the models. 1.B. Industrial Production Level: Growth rates of total factor productivity differ widely across sectors. It also raises doubts about how effectively output is measured in some service industries, such as banks or the government. While analysing the growth of a country, it should be better to consider the measurement of industrial productivity. The State Institute of Statistics releases the industrial production data every month. As a variable, because of the seasonal effects, the change in the ratio of the industrial production level with respect to the previous year's same month is calculated. 1.C. Capacity Utilisation Level: Production depends on the amount of output produced in an economy to the inputs of factors of production and to the state of technical knowledge. For the production, any company in the economy works in full capacity or less than full capacity, depending on the external and internal effects. Consequently, capacity level of a company affects the production and the growth. SIS releases the data of the capacity utilisation level every month. As a variable, the difference of the data with respect to the previous year's same month is used. 2. Foreign Exchange (FX) Market Indicators: Because of the heavy influences of the foreign investors in Turkish markets, it is important to analyse the foreign exchange (FX) market. These are: 2.A. Balance of Payments: The balance of payments is the record of the transactions of the residents of a country with the rest of the world. The simple rule for balance of payments accounting is that any transaction that gives rise to a payment by a country's resident is a deficit item in that country's balance of payments. Thus, imports of cars or oil, use of foreign shipping, gifts to foreigners, purchase of land in the other country, or making a deposit in a Bank in Switzerland are all deficit items. Examples of surplus items, by contrast, would be sales of cars 11
  • 12. abroad, payment by foreigners, pensions from abroad or foreign purchases of stock. When there is a net outflow, balance of payments is in deficit. To control the economy and have the healthy growth in a country, the surplus in balance of payments is necessary. When the foreign investors leave the country, it will turn into a deep deficit and affect the economy worse. As a variable, the total previous 12 months balance of payments' surplus or deficit are calculated. 2.B. FX Reserves: The Central Bank of Turkey holds reserves that they would sell in the market when there was an excess demand for dollars. Conversely, when there was an excess supply of dollars, they would buy the dollars. As a variable, the total intervention of the Central Bank of Turkey in the previous 12-month period is used. 2.C. Total External Debt Stock: The easiest way to finance the government's and the private companies' budget deficit is to find an external debt. The interest rate and the cost in external debt are relatively lower than the domestic debt. Thus, the government prefers to borrow external debt. Besides, long term debt issues in external debt stock are more frequent than the issues in domestic debt stock. In Turkey, the data for the external debt stock is released in every quarter of the year. By using linear interpolation method, the quarterly data are converted to monthly data. As a variable, the change of the debt stock with respect to the previous year's same month is calculated. 2.D. FX Rate: FX rate is the value of one unit of foreign money in TL terms. A rise in the exchange rate means that foreign prices have increased relative to the prices of goods produced here. Goods abroad have become more expensive relative to the prices of goods at home, which other things equal, implies people are likely to switch some of their spending to goods at home. This is often described as an increase in the competitiveness of our products, as our goods become cheaper relative to foreign goods. In this case of devaluation, the stock market will be cheaper and have comparative advantage in prices, while other 12
  • 13. things being constant. Monthly devaluation rate in United States Dollar is used as a variable in the models. 3. Price Indicators: The budget deficit and the domestic debt show how the government can turn its debt relaxed. These variables cause high inflation. 3.A. Inflation: The inflation rate is the percentage rate of increase of the level of prices during a given period. The inflation is one of the main concerns of citizens, policy makers, and macroeconomists. During periods of inflation, the prices of goods people buy are rising. Partly for this reason, inflation is unpopular, even if people's incomes rise along with the prices. Inflation is also unpopular because it is often associated with other disturbances to the economy such as the oil price increases that would make people worse off. Mainly, there are two types of inflation wholesome price index (WPI) and consumer price index (CPI). These price indexes depend on different categorical variables. To sum up, CPI is more individual needs' price increase oriented. However, in an economy the price changes are generally measured by WPI because it gives the large amount of goods' price index. As a variable, the increase in WPI with respect to the previous year's same month is used. 3.B. Total Domestic Debt Stock: When the budget is in deficit, the national debt increases. National debt is the result of past budget deficits. The Treasury sells securities more or less continuously. Long term debt issues are less frequent. Issues of the Treasury debt are not only made for the purpose of financing the budget deficit but also made to refinance parts of national debt that are maturing. The Treasury sells the amount of Treasury Bills or Government Bonds it has offered at the auction to the bidders who offer the highest prices, or lowest interest rates. If the debt is in Turkish Lira terms, it will be the total domestic debt. When the foreign investors leave the country in case of crisis, the Treasury has alternative debtors, the domestic investors. However in domestic borrowing the 13
  • 14. interest rate is relatively high. As a variable, the ratio of the total change of the domestic debt over the average WPI prices in 12 months is calculated. 3.C. Budget Deficit: Like private companies, the government has a budget too. When the government is spending more than it receives, the budget is in deficit. The size of the budget deficit is affected by the government's fiscal policy variables; such as government purchases, transfer payments, and tax rates. To finance the deficit, the government has to borrow debt from creditors or the budget should be in surplus by increasing revenues or decreasing expenditures in the next periods. As a variable, the ratio of the total budget deficit over the average WPI prices in 12 months is calculated. 4. TL Market Indicators: In Turkey, there are other markets to invest in TL-terms. These are repo and bond market. Although their volatility is less than the ISE, they are almost influenced by similar effects. Thus, the correlation between each other is relatively high. 4.A. REPO Rates: Repurchase agreements (repos) are instruments used to help finance part of their inventories of marketable securities for one or few days. For instance, if an investor ends a day of trading with an increase of $1 million in its inventory of marketable securities, a repo may be sold to finance the $1 million inventory overnight. The investor is essentially making a short-term loan to the other investor with his inventory serving as collateral. Repos that last longer than overnight, called term repos, can span 30 days or even longer. Term repos are marketable securities, actively traded between the money market trading desks of large banks and brokerage houses. In another words, repo is a short-term loan instrument to find money to enter the stock market. In the ISE, it is calculated the average monthly repo rates and used as a variable for cost of carrying money. 4.B. Treasury Bills' and Government Bonds' Price Index in the ISE (DIBS): A bond is a promise by a borrower to pay the lender a certain amount at a specified date and pay a given amount of interest per year. The interest rates on bonds issued by different borrowers reflect the differing risks of default. Default occurs when a 14
  • 15. borrower is unable to meet the commitment to pay interest or principal. Government Bonds represent the indebtedness of government. The owners of the bonds are creditors; government is the debtor. Government Bonds are of such high quality that their yield is often used as an example of a riskless, default free or interest rate. In the ISE government bonds are also traded. There are approximately 20-30 government bonds traded in the ISE and these bonds change according to the maturity date and interest rates in the meantime. The ISE calculates the weighted average price of the government bonds, the DIBS Index. As a variable, the monthly return of the DIBS Index is used. 3. MODELING, OPTIMIZATION AND RESULTS FOR THE ISE100 INDEX BY USING FUZZY LOGIC Fuzzy logic has been applied very successfully in many areas where conventional model based approaches are difficult or expensive to implement for the design and the learning. However, as the system complexity increases, reliable fuzzy rules and membership functions used to describe the system behaviour become difficult to determine. Furthermore, due to the dynamic nature of economic and financial applications, rules and membership functions must be adaptive to the changing environment in order to continue to be useful. It has been considered as one of the most attractive strategies in identifying complex systems, particularly for nonlinear systems with imprecise and uncertain knowledge of system information and behaviour. In contrast to a regular knowledge base in expert system, the fuzzy rules, being structured knowledge, can be coded into relevant explicit numerical algorithms or a fuzzy model with fuzzy identification or fuzzy reasoning based on system non-fuzzy input or data by Lin and Lee (1996). Fuzzy logic can be applied to system modelling, estimation, optimal and optimization of control and adaptive control problems. Only system and input- output data are required. 15
  • 16. If the number of variables are too much, the number of rules will increase much faster. This will cause a rule explosion in the model. In order to prevent the rule explosion, an expert should make a hierarchical modelling in fuzzy logic. In the beginning of this study, a hierarchical modelling is used too. In the model, there is also middle layers to combine related variables in groups. The membership functions of the input and middle variables are optimized. Finally, in this section a model for the stock exchange will be developed to estimate the monthly returns of the ISE100 Index with 22 financial input variables. 3.1 Prepositional Logic and Rule Generation In crisp logic, such as binary logic, variables are true or false, black or white, 1 or 0. An extension to binary logic is multi-valued logic, where variables have many crisp values. Prepositional logic on the other hand, is defined with uncertain terms. The next months' return of the ISE100 index is estimated as 6% increase. In some aspects it may be a good increase, in another it may be a very good increase. Thus, with some degree it is a good increase and a very good increase. In the example given above, very bad decrease, bad decrease, neutral, good increase and very good increase are the linguistic terms which can be converted from the real data with some degree. A relationship is defined to express the distribution of truth of a variable. For example, 'good increase' may be defined as a distribution around a value 'x'. Any value within the distribution may be interpreted as 'good increase', although with different degrees of truth or confidence. Theoretically, a fuzzy set F of a universe of disclosure X={x} is defined as a mapping, by which each x is assigned a number in range [a,b]. This indicates the boundaries of the attribute F of x. If x is the monthly return of the ISE100 index, 'good increase' may be considered as a particular value of the fuzzy variable, and 16
  • 17. each x is assigned a number in the range of real numbers. Ugood inc.(x) is element of [a,b] that indicates the extent to which that x is considered to be good increase. Ugood inc.(x) is element of [a,b] is called a membership function. Let X be a time- invariant set of objects x. A fuzzy set F in X may be expressed by a set of ordered pairs F = {(x,U(x)) | x is an element of X}, where U is the membership function that maps X to the membership space M, and U(x) is the grade of membership or degree of truth of x in F. In addition when M contains the values 0 and 1 only, then F is non-fuzzy and U is the characteristic function of a non-fuzzy set. Thus, binary and multi-value logic are extreme sub-cases of fuzzy logic. As an example, let the monthly returns of the ISE Index in 2000 be 2.1%, 9.4%, -4.5%, 16.7%, -2.3%, -5.3%, 2.8%, 2.5%, -11.3%, 1.5%, 2.2% and 4.1%, respectively. Increases around 10% are considered Very-Good-Increase, around 5% Good-Increase, around 1% Neutral, around -1% Bad-Decrease and -5% Very-Bad-Decrease. In the example there are not more then two membership-functions for each x as seen in the below (While constructing the architectures of the models there are similarities). 1 0.75 0.5 0.25 0 -12% -9% -6% -3% 0% 3% 6% 9% 12% 15% 18% very bad bad neutral good very good Figure 3.1 Membership Functions 17
  • 18. As a result of the membership functions the data can be converted easily. Simplicity, piecewise linear membership functions have been assumed. Membership functions can be continuous curves of many different shapes (Lin and Lee, 1996). 1 0.75 0.5 0.25 0 -12% -9% -6% -3% 0% 3% 6% 9% 12% 15% 18% very bad bad neutral good very good 18
  • 19. Monthly Very- Very- Return of Good- Good- Bad- Bad- Date ISE100 Increase Increase Neutral Decrease Decrease 00/01 2.10% 0% 0.275% 0.725% 0% 0% 00/02 9.40% 0.880% 0.120% 0% 0% 0% 00/03 -4.50% 0% 0% 0% 0.125% 0.875% 00/04 16.70% 1% 0% 0% 0% 0% 00/05 -2.30% 0% 0% 0% 0.675% 0.325% 00/06 -5.30% 0% 0% 0% 0% 1% 00/07 2.80% 0% 0.450% 0.550% 0% 0% 00/08 2.50% 0% 0.375% 0.625% 0% 0% 00/09 -11.30% 0% 0% 0% 0% 1% 00/10 1.50% 0% 0.125% 0.875% 0% 0% 00/11 2.20% 0% 0.300% 0.700% 0% 0% 00/12 4.10% 0.775% 0.225% 0% 0% 0% Table 3.1 Fuzzification of the Variables Fuzzification of the five crisp variables as in the figure above, causes spreading of the variables with a distribution profile that suits the problem. In fuzzy problems, the rules are produced based on experiences. Concerning problems that deal with fuzzy engines or fuzzy control, all possible input-output relationships should be in fuzzy terms. The input output relationships or rules are expressed with 'if then' statements such as: If (a is in A1) and (b is in B1), then (c is in C5); or If (a is in A1) and (b is in B2), then (c is in C1); or If (a is in A2) and (b is in B5), then (c is in C3). The A's and the B's are fuzzified inputs, and the C's are the actions for each variable. For 2 variables with 5 membership functions for each, total number of rules should be 25 rules (5x5) as seen in the below table. 19
  • 20. Table 3.2 Rules VAR. B B1 B2 B3 B4 B5 A1 C5 C1 C2 C2 C5 A2 VAR. A C4 C4 C1 C3 C3 A3 C2 C3 C4 C1 C5 A4 C1 C2 C4 C4 C1 A5 C1 C1 C3 C5 C2 The rules become more difficult to tabulate if the fuzzy statements are more in number, that is if there are 3 variables with 5 membership functions for each, total number of rules would increase to 125 rules (5x5x5). 3.2 Defuzzification In fuzzy logic, the values are not crisp, and their fuzziness exhibits a distribution described by the membership function. If one tries to get two fuzzy variables, what will the output be? The question has been addressed by various fuzzy logics such as: • Min operation (Mamdani). • Max-min operation (Zadeh). In general, defuzzification is the process where the membership functions are sampled to find the grade of membership. The grade of the membership is used in the fuzzy logic equation and after an outcome region is defined, the output is deduced. Several techniques have been developed to produce an output, such as: • Center of Area (COA). • Mean of Maximum (MOM). As an example by using min rule (Mamdani) for fuzzy logic operation and COA for defuzzification: 20
  • 21. Let, if (a is in A4) and (b is in B1) then (c is in C1); if (a is in A5) and (b is in B1) then (c is in C1); if (a is in A4) and (b is in B2) then (c is in C2); if (a is in A5) and (b is in B2) then (c is in C1). UA4(a)=0.282, UA5(a)=0.718, UB1(b)=0.191 and UB2(b)=0.809. Then, Min(UA4(a), UB1(b))=0.191 for (c is in C1); Min(UA5(a), UB1(b))=0.191 for (c is in C1); Min(UA4(a), UB2(b))=0.282 for (c is in C2); Min(UA5(a), UB2(b))=0.718 for (c is in C1). Since there is one question but four answers, the defuzzification process will be done via taking the COA of the four rectangles as seen in the graphics below, and will give the value of the output. 1 0.8 0.6 0.4 0.2 0 Membership Functions: C1(0.19), C1(0.19), C1(0.72) and C2(0.28) Figure 3.2 Defuzzification Fuzzy system can express knowledge but can not learn to adapt by itself. In many applications, partial understanding of the knowledge is available, but a complete set of rules is not. However input-output data may be available to determine the rest. What is needed is technology that can work with a partial knowledge base and can also learn from the additional data in order to perform the 21
  • 22. task correctly. Fuzzy logic handles the explicit knowledge, whereas optimization handles the knowledge implicit in the data. A fusion of both these into one provides a better way of resolving problems. 3.3 Modelling One of the main advantages of fuzzy logic is that it more closely models the kind of reasoning that a person engages in when dealing with issues or elements that are not precisely defined and that involve aspects of degree or judgement. However it may not be possible to think in terms of sharp boundaries for modelling. Thus, the disadvantages of fuzzy logic systems are the same as those found in traditional knowledge based systems: Someone has to write rules, which means that expert knowledge has to be available and formalised. These systems can not learn on their own, nor can they adapt to changing market conditions, except by manually rewriting the rules, adjusting the membership functions or other specific rule-finding methodologies. According to professional investors, the stock markets are generally affected by four main criteria (Virtual Trading, 1995): • Stock Market Factors • Macro Economic Factors • Political Risk Factors • Inter-market Factors. In the model designed for the ISE100 and the investors, the inter-market factors (effects of other markets) are included in macro economic factors and stock market factors part. Thus, the models in the following pages generally consist of three main parts; finance, economy and political risk. The Economy section has two main parts: Economic ratios and TL market. TL market, consists of repo and DIBS and is also part of Inter-market factors. 22
  • 23. Economic ratios part consists of three parts: Real economy, FX market and prices. Real economy shows the fundamental changes in Turkey. These are GNP, industrial production index and capacity utilisation ratio. The FX market consists of FX rate and FX ratios. FX ratios depend on balance of payments, FX reserve and total foreign debt in Turkey. FX rate is the monthly percent changes in the ratio of USD to TL. The stock market section has three main parts: The stock market ratios, technical analysis of the stock market and the Dow Jones Index in United States. The Dow Jones is the most popular stock market in the world and has the highest volume. Thus, it is also a good indicator for the inter-market factors. Technical analysis sometimes explains what the fundamental analysis can not explain. The stock market ratios section consists of three parts: financial ratios, transactions and foreign investments. Financial ratios depend on the ISE100’s average price over earnings ratio and dividend rate. Transactions depend on the ratios of average monthly volume to the ISE100 Index and monthly standard deviation. Foreign investments depend on the ratio of foreign investments to the ISE100 Index and the ratio of foreign investments to market capacity of the ISE100 Index. Finally, in the political risk section, there are only two parts: Domestic political risk and external political risk. Consequently, the inputs used in all of the models are summarised in the table below. Foreign debt and GNP variables are originally in quarterly format. To convert them into monthly format, linear interpolation method is used. Thus, there are 22 input variables, all of which are in monthly format. 23
  • 24. Table 3.3 Variables Used in the Models V1 P/E Price over Earning Ratio V2 Dividend to Price Ratio Dividend Ratio V3 Volume/ISE100 Equity Turnover Ratio V4 Standard Deviation Volatility V5 Foreign Investment/ISE Foreign Investment/ISE V6 Foreign Investment/MCAP Foreign Investment/Market Capacity of the ISE V7 Technical Analysis Technical Analysis of the ISE V8 Dow Jones % Change in Dow Jones of the New York Stock Exchange V9 GNP % Change in Gross National Product (y-o-y) V10 Industrial Production % Change in Industrial Production (y-o-y) V11 Capacity Utilization % Change in Capacity Utilization (y-o-y) V12 Balance of Payments Central Bank Balance of Payments (y-o-y) V13 FX Reserves Increase in FX Reserve of Central Bank (y-o-y) V14 Foreign Debt Increase in Foreign Debt Stock of Turkey (y-o-y) V15 FX Rate US Dollar/TL Parity V16 Inflation % Change in Wholesome Price Index V17 Budget Deficit Budget Deficit/Wholesome Prices (y-o-y) V18 Domestic Debt Increase in Domestic Debt/Wholesome Prices (y-o-y) V19 Repo Rates Monthly Average of Repo Rate V20 DIBS Government Bills and Bonds Index (according to the ISE) V21 External Risk Risk from outside of Turkey V22 Domestic Risk Risk from inside of Turkey For each variable the maximum, minimum, average and the standard deviations are given in the following table. By using these values with expert opinion, the groups of the fuzzy membership functions of the variables are given in the next table. All of the variables have five membership functions. As explained before, if there are two variables with five membership functions for each, number of rules will be 25. Number of rules will be 125 for three variables with five membership functions. To have five membership functions, there should be seven numbers. As seen in Figure 3.1, the inner three membership functions are triangles and the outer two membership functions are trapezoids. In Table 3.4; 1, 2 and 3 are the border points of the first trapezoid; 2, 3 and 4 are the border points of the first triangle; 3, 4 and 5 are the border points of the second triangle; 4, 5 and 6 are the border points of the third triangle and 5, 6 and 7 are the border points of the last trapezoid. The 24
  • 25. middle number for each triangle is the head and the others are the bottom numbers. The last number for the first trapezoid and the first number for the last trapezoid are the bottom numbers. Table 3.4 Statistical and Membership Range of the Variables MAX MIN AVE STDEV 1 2 3 4 5 6 7 Y 0.798 -0.390 0.057 0.196 0.798 0.526 0.254 0.057 -0.139 -0.265 -0.390 A1 -7.329 -39.020 -18.258 7.559 -7.329 -9.014 -10.700 -18.258 -25.817 -32.418 -39.020 A2 4.070 0.620 2.169 1.009 4.070 3.624 3.178 2.169 1.160 0.890 0.620 A3 -197.098 -1072.839 -480.452 172.129 -197.098 -252.710 -308.323 -480.452 -652.581 -862.710 -1072.839 A4 -0.073 -0.431 -0.183 0.072 -0.073 -0.091 -0.110 -0.183 -0.255 -0.343 -0.431 A5 6.312 3.123 4.410 0.750 6.312 5.736 5.159 4.410 3.660 3.391 3.123 A6 0.135 0.089 0.110 0.011 0.135 0.128 0.121 0.110 0.099 0.094 0.089 A7 2.000 -2.000 0.167 1.548 2.000 1.857 1.715 0.167 -1.382 -1.691 -2.000 A8 0.102 -0.151 0.012 0.051 0.102 0.083 0.063 0.012 -0.039 -0.095 -0.151 A9 1.056 0.404 0.734 0.212 1.056 1.001 0.947 0.734 0.522 0.463 0.404 A10 0.213 -0.121 0.031 0.081 0.213 0.162 0.112 0.031 -0.050 -0.085 -0.121 A11 6.500 -7.200 -0.658 3.437 6.500 4.640 2.779 -0.658 -4.096 -5.648 -7.200 A12 4329.000 -10411.000 -2122.208 3782.136 4329.000 2994.464 1659.927 -2122.208 -5904.344 -8157.672 -10411.000 A13 10048.000 -4623.500 1552.525 3272.174 10048.000 7436.349 4824.699 1552.525 -1719.649 -3171.574 -4623.500 A14 12150.000 3747.500 7118.146 2328.215 12150.000 10798.180 9446.361 7118.146 4789.931 4268.715 3747.500 A15 0.071 -0.008 0.040 0.019 0.071 0.065 0.059 0.040 0.021 0.007 -0.008 A16 0.071 0.004 0.039 0.016 0.071 0.064 0.056 0.039 0.023 0.014 0.004 A17 1093.099 327.127 676.431 280.966 1093.099 1025.248 957.397 676.431 395.464 361.296 327.127 A18 214.214 112.876 154.373 27.876 214.214 198.231 182.248 154.373 126.497 119.687 112.876 A19 1.927 0.214 0.677 0.255 1.927 1.429 0.932 0.677 0.422 0.318 0.214 A20 -102.410 -107.700 -104.546 1.571 -102.410 -102.693 -102.975 -104.546 -106.118 -106.909 -107.700 A21 2.000 -2.000 0.313 0.938 2.000 1.625 1.250 0.313 -0.625 -1.313 -2.000 A22 2.000 -1.500 -0.177 0.884 2.000 1.354 0.707 -0.177 -1.061 -1.281 -1.500 After having the variables with membership functions, the rules should be produced for the last step of the modelling. As seen in Figure 3.3, there are 22 input variables and the other 14 middle variables are produced from these 22 variables. Half of the 14 middle variables are produced from two different fuzzified variables (25 rules for each variable). The other 7 variables are produced from three different fuzzified variables (125 rules for each variable). Finally, there should be 1050 rules for the overall model. The rules for each variable are given in the following two tables. 25
  • 26. Table 3.5 Rules in 2 by 2 Tables for the Modelling of the ISE100 Index FINANCIAL RATIOS Divident Ratio B1 B2 B3 B4 B5 A1 C1 C1 C2 C2 C2 Price over Earning A2 C2 C2 C2 C3 C3 A3 C2 C3 C3 C3 C4 A4 C3 C3 C4 C4 C4 A5 C4 C4 C4 C5 C5 TRANSACTION Standard Deviation B1 B2 B3 B4 B5 A1 C1 C1 C2 C2 C2 Volume / ISE100 A2 C2 C2 C2 C3 C3 A3 C2 C3 C3 C3 C4 A4 C3 C3 C4 C4 C4 A5 C4 C4 C4 C5 C5 FOREIGN INVESTMENT Foreign Inv/MCAP B1 B2 B3 B4 B5 A1 C1 C1 C2 C2 C2 Foreign Inv/ISE100 A2 C2 C2 C2 C3 C3 A3 C2 C3 C3 C3 C4 A4 C3 C3 C4 C4 C4 A5 C4 C4 C4 C5 C5 TL MARKET DIBS B1 B2 B3 B4 B5 A1 C1 C2 C2 C3 C4 Repo A2 C1 C2 C3 C3 C4 A3 C2 C2 C3 C4 C4 A4 C2 C3 C3 C4 C5 A5 C2 C3 C4 C4 C5 RISK Domestic Risk B1 B2 B3 B4 B5 A1 C1 C2 C2 C3 C4 External Risk A2 C1 C2 C3 C3 C4 A3 C2 C2 C3 C4 C4 A4 C2 C3 C3 C4 C5 A5 C2 C3 C4 C4 C5 FX MARKET FX Ratios B1 B2 B3 B4 B5 A1 C1 C1 C2 C2 C2 FX Rate A2 C2 C2 C2 C3 C3 A3 C2 C3 C3 C3 C4 A4 C3 C3 C4 C4 C4 A5 C4 C4 C4 C5 C5 ECONOMY Economy Ratios B1 B2 B3 B4 B5 A1 C1 C1 C2 C2 C2 TL Market A2 C2 C2 C2 C3 C3 A3 C2 C3 C3 C3 C4 A4 C3 C3 C4 C4 C4 A5 C4 C4 C4 C5 C5 26
  • 27. Table 3.6 Rules in 3 by 3 Tables for the Modelling of the ISE Index REAL ECONOMY Capacity Utilisation (C) Industrial Production (B) C1 C2 C3 C4 C5 B1 B2 B3 B4 B5 B1 B2 B3 B4 B5 B1 B2 B3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B2 B3 B4 B5 B1 B2 B3 B4 B5 B1 B2 B3 B4 B5 A1 D1 D1 D1 D2 D2 D1 D2 D2 D2 D2 D2 D2 D2 D2 D2 D2 D2 D2 D3 D3 D2 D3 D3 D3 D3 Risk A2 D2 D2 D2 D2 D2 D2 D2 D2 D2 D3 D2 D2 D3 D3 D3 D3 D3 D3 D3 D3 D3 D3 D3 D3 D4 A3 D2 D2 D2 D3 D3 D2 D3 D3 D3 D3 D3 D3 D3 D3 D3 D3 D3 D3 D4 D4 D3 D4 D4 D4 D4 A4 D3 D3 D3 D3 D3 D3 D3 D3 D3 D4 D3 D3 D4 D4 D4 D4 D4 D4 D4 D4 D4 D4 D4 D4 D5 A5 D3 D3 D3 D4 D4 D3 D4 D4 D4 D4 D4 D4 D4 D4 D4 D4 D4 D4 D5 D5 D4 D5 D5 D5 D5 Consequently, the final model for the ISE is shown in Figure 3.3. The result of the model by using the rules above with fuzzy logic algorithm is quite accurate, 55.18%, which is the sum of the squares of the difference of the real returns from the estimated returns divided by the real returns of the stock market. 27
  • 28. Figure 3.3 Fuzzy Logic Model for the ISE100 Index 3.4 Optimization and Results After having 55.18% explanation, the question should be: Is there any improvement in the accuracy? Thus, the next work is to find the optimum stock market model, which is developed by changing the border points of the membership functions by using steepest descent algorithm. By minimising the square of the error, which is the difference of real stock market returns from estimated stock market returns, the inner five border points of the membership functions are changed. Firstly, this process is done for the last three variables (risk, 28
  • 29. stock market and economy) and the output. Secondly, the membership functions of the 22 input variables are changed according to the same algorithm. Lastly, the same process is done to the last three variables and the output again. Finally, the new model is a little different than the first model with membership functions of the 22 input variables, the last 3 variables and the output. The learning of the model in Pentium III computer after 72 minutes is with %69.73 accuracy, which is the sum of the squares of the difference of the real returns from the estimated returns divided by the real returns of the stock market. The result of the optimization will end with 14.55% improvement in the modelling of the ISE100 Index. 80% 60% 40% 20% 0% -20% -40% Jan-97 Oct-97 Jul-98 Apr-99 Jan-00 Oct-00 Real Y Estimated Y Figure 3.4 Real and Estimated Output with 69.73% Accuracy The estimated and the real output is always observed at the same directions (When the real output is negative, the estimated output is also negative and when the real output is positive, estimated output is also positive). In February and November 1999, the difference of the real and the estimated data are the largest. This causes the accuracy of the model to decrease to 69.73%. If these two data are discarded, the accuracy will increase to above 90%. 29
  • 30. Besides, it will be better to compare these models with the data that are not used in the optimization process. The monthly data used in the optimization are taken between 1997 and 2000. The validity test is done with the monthly data of the first six months of 2001. 60% 40% 20% 0% -20% -40% Jan-01 Feb-01 Mar-01 Apr-01 May-01 Jun-01 Real Y Estimated Y Figure 3.5 Validity with 75.92% Accuracy As seen in Figure 3.5, the accuracy is 75.92%. Thus, the validity test of the model is better than the optimization part. Besides, all the data are estimated in the correct direction. For the data of April 2001, there is a little difference between the real and estimated output as in the results of the optimization part. 4. MODELING, OPTIMIZATION AND RESULTS FOR THE ISE 100 INDEX BY USING NEURO FUZZY SYSTEMS Fuzzy logic and neural networks are complementary technologies in the design of intelligent systems. They are used in an environment to improve the 30
  • 31. intelligence of systems working uncertain, imprecise and noisy environments. Each method has good and bad aspects. In 1994, Fukuda and Shibata presented the comparison of these techniques. Table 4.1 Comparison of the Fuzzy Systems with respect to the other methods Fuzzy Neural Control Genetic Alg. Symbolic AI Systems Networks Theory Math. Model Slightly Good Bad Bad Good Slightly Bad Learning Ability Bad Good Slightly Good Bad Bad Knowledge Rep. Good Bad Slightly Bad Slightly Bad Good Expert Knowledge Good Bad Bad Slightly Bad Good Nonlinearity Good Good Good Bad Slightly Bad Opt. Ability Bad Slightly Good Good Slightly Bad Bad Fault Tolerance Good Good Good Bad Bad Uncertainty Tol. Good Good Good Bad Bad Real-time Op. Good Slightly Good Slightly Bad Good Bad Fuzzy systems are better in mathematical modelling, knowledge representation, expert knowledge and nonlinearity. However in optimization and learning ability, neural networks are better. In this chapter, it is focused on the rationale of integrating fuzzy logic and neural networks into a working functional system. This happy marriage of these two techniques results with the neuro-fuzzy system method with benefits of both neural networks and fuzzy logic system. These are, the neural networks provide the distributed representation properties and the learning abilities to the fuzzy logic systems and the fuzzy logic systems provide the neural networks with high level fuzzy rule thinking and reasoning. In this section, neuro-fuzzy modelling is tried because there may be other important but unknown rules. In fuzzy logic modelling of the ISE100 Index, there are 1050 rules. If it was used similar membership functions; three triangles and 31
  • 32. two trapezoids in the neuro-fuzzy modelling and if the output of the model was directly affected by all of the 22 initial variables, there would be 2,384,185,791,015,620 (= 522 ) rules. As seen in expression 4.2, a Gaussian function is used for the modelling subsection, which makes the number of rules infinite. Consequently, with infinite number of rules in neuro-fuzzy modelling, there may be some rules, which are not included in fuzzy logic modelling with finite number of rules. 4.1 Modelling Unlike fuzzy logic, neuro-fuzzy modelling of the ISE Index is not so semantically complicated. The estimation only depends on a function; _ _ _ y = wi R1 ( x) + w2 R 2 ( x) + ....... + wn R n ( x) (4.1) where x is the input data, R is the rules, w is the constant number and y is the output. In neuro-fuzzy modelling rules are not available explicitly. Before starting to the simulations number of rules are set to a number, which is large enough. In this case, number of rules are set to 50 or in other words n is equal to 50. Rules are exponential functions; 2 _ __ _ 1 x xc R c ( x) = exp(− ) (4.2) 2 σc where c is the index of the rule, x is the input data, xc and σ c are specific parameters for the rule. If the number of variables is equal to n, there are (n+2) unknown numbers for each rule. ( N unknowns because of xc , 1 unknown because of σc and 1 unknown because of wc ). 32
  • 33. If the number of variables is equal to k and number of variables is equal to n, there are k times (n+2) unknowns. By using steepest descent algorithm, the optimum stock market model developed by minimising the square of the error, which is the difference of real stock market returns from estimated stock market returns. Finally, the model is used to estimate the real monthly return of the stock market by 22 financial variables. 4.2 Optimization and Results The optimization of the model in Pentium III computer with 50 rules ends after 18 days 9 hours with %98.99 accuracy, which is the sum of the squares of the difference of the real returns from the estimated returns divided by the real returns of the stock market. The result seems to be better; however, some of the rules are negligibly small. Thus, step by step the rules are discarded and the model is optimized again. Consequently, the final result was calculated with 8 rules in Pentium III after 3 days 18 hours with almost same accuracy, %96.66. 80% 60% 40% 20% 0% ­20% ­40% Jan­97 Aug­97 Mar­98 Oct­98 May­99 Dec­99 Jul­00 Real Y Estimated Y Figure 4.1 Real and Estimated Output with 96.66% Accuracy 33
  • 34. According to these eight rules, some of the rules can be more effective than the other rules. In the formula presented in 4.2, there are three parameters; c, xc and σc and these parameters are different for each of the eight rules. Some of the variables can be more important than the other variables because of the differences in the data and the parameters. If the square of the ratio of the difference between xc and the mean of x to σc is close to zero, the inversely correlated power of the exponential will be very small and this variable for that rule is not important. Each of the eight rules’ figures with respect to the time are given in the appendix part. All of the rules, accept rule 6 and 8 are controlled by the similar rules. In rule 1, external risk and domestic risk variables are the most important variables. In rule 2, GNP is the most important variable. In rule 3, the ratio of foreign investment to the ISE 100 Index has the dominant affect. In rule 4, technical analysis is the most important variable. In rule 5, equity per share and price over earning ratios are the dominant variables. In rule 7, capacity utilisation ratio is the most important variable. In rule 6 and 8, there is no unique variable to affect the results. Consequently, the optimization result of the neuro-fuzzy model is better than the fuzzy logic model. However, it will be better to compare these models with the data not used in the optimization process. The monthly data used in the optimization are taken between 1997 and 2000. Like the previous fuzzy logic models, the validity test is done with the monthly data of the first six months of 2001. 60% 40% 20% 0% ­20% ­40% 34 Jan­01 Feb­01 Mar­01 Apr­01 May­01 Jun­01 Real Y Estimated Y
  • 35. Figure 4.2 Validity with 56.61% Accuracy As seen in the accuracy, 56.61%, the validity test of the model is not as good as the optimization part. Besides, to compare the validity test of the neuro- fuzzy model with the fuzzy logic model, this model does not work as good as the first one. As seen in the figure, half of the data are estimated in the wrong direction which means while the real output is negative, estimated output is positive. Consequently, fuzzy logic model works better and the dominant rules in neuro-fuzzy modelling are also dominant in the fuzzy logic modelling (see figure 3.3). Thus, there is not a radical change in the fuzzy logic modelling. 5. CONCLUSION & FUTURE WORK The classical economic estimation models are too slow and they can easily be affected by seasonal trends in the data, also they are very sensitive to the disturbance in the data. On the contrary there are better ways developed to estimate the data. The most important improvement is the learning and dynamic ability of the algorithms. In this study, models of the ISE100 Index are tried to be implement in the field of economics via fuzzy logic. Especially while modelling the players’ behaviour, some of the outputs are not changed and remain flat on the graphics. As a result, the rules for the models may not be enough to explain the 35
  • 36. real outputs. There may be some other rules to explain the behaviours more explicitly and the models can be developed and can be redesigned better with the new rules. Similarly, there may be some new variables to explain the characteristics of the behaviours better. In modellings of this study there is not included any lagged variables of the inputs. There may be one or more period lagged variables to extend the models’ modelling perspectives. Besides, the data set can be enlarged by including other new variables (such as population growth or GNP per capita) and by using the weekly or daily data to test the models more accurately. For the ISE100 Index, another model is also implemented by using neural fuzzy systems. The second model can learn better than the first model in the optimization part. However, testing both of the models with the data not used in the optimization part (validity test) proves that the first model works better than the second model. The architecture of the second model shows that there are other related rules for the estimation of the ISE100 Index. Consequently, the models produced by using fuzzy logic can be developed and redesigned by observing the new rules obtained from the models by using neural fuzzy systems. Finally, the relations between the financial variables have not derived yet. Except the domestic and foreign risk variables, all of the variables can be accepted as endogenous variables and all of the variables have positive or negative correlations between each other. After deriving the rough relations between the endogenous variables used in the models, the stock market model can also be constructed for the simulations, might be happened in the future. REFERENCES 36
  • 37. Aksoy, H. and Sağlam, İ., (2001). Sınıflayıcı (Classifier) sistem ile İMKB’de yeni bir anomali gözlemi. Boğaziçi University Departmental Working Paper 15. Altuğ, S. and Yılmaz, K., (1998). Asset returns, inflation and real activity: The case of Mexico and Turkey. Boğaziçi Journal, 12, 81-103. Alper, E. and Ucer, M., (1998). Some observations on Turkish Inflation: A random walk down the past decade. Bogazici Journal, 12, 7-38. Brischetto, A. and Voss, G., (1999). A structural vector autoregression model of monetary policy in Australia. Research Discussion Paper 11, Economic Research Department, Reserve Bank of Australia. Bak, P., Paczuski, M. and Shubik M., (1997). Price variations in a stock market with many agents. Physica A 246, 430-453. Brown, M. and Harris, C., (1995). Neurofuzzy adaptive modelling and control. Prentice Hall. Brownstone, D., (1995). Using percentage accuracy to measure neural network predictions in Stock Market movements. Neurocomputing 10, 237-250. Chen, S. and Yeh, C., (2001). Evolving traders and the business school with genetic programming: A new architecture of the agent-based artificial stock market. Journal of Economic Dynamics and Control 25, 363-393. Chenoweth, T. and Obradovic, Z., (1996). A multi-component nonlinear prediction system for the S&P 500 Index. Neurocomputing 10, 275-290. De Silva, C. W., (1995). Intelligent control: Fuzzy Logic Applications. CRC. Fernandez-Rodrigez, F., Gonzalez-Martel, C. and Sosvilla-Rivero, S., (2000). On the profitability of technical trading rules based on artificial neural networks: Evidence from the Madrid stock market. Economic Letters 69, 89-94. Fukuda, T. and Shibata T., (1994). Fuzzy-neuro-GA based intelligent robotics. Computational Intelligence Imitating Life, 352-362. New York: IEEE Press. 37
  • 38. Garratt, A., Lee, K. and Pesaran, M. H., (2000). Forecast uncertainties in macroeconometric modelling: An application to the UK Economy. Gençay, R., (1998). The predicability of security returns with simple technical trading rules. Journal of Empirical Finance 5, 347-359. Granger, C. W. J. and Terasvirta, T, (1993). Modelling nonlinear economic relationships. Oxford University Press. Kaminsky, G., Lizondo, S. and Reinhart, C.M., (1997). Leading indicators of currency crises. IMF Working Paper 79. Kim, S. H. and Chun, S. H., (1998). Graded forecasting using an array of bipolar predictions: Application of probabilistic neural networks to a stock market index. International Journal of Forecasting 14, 323-337. Kooths, S., (1999). Modelling rule and experience based expectations using neuro-fuzzy systems. Computing in Economics and Finance '99, Paper No: 1032. LeBaron, B., Arthur, W. B. and Palmer, R., (1999). Time series properties of an artificial stock market. Journal of Economic Dynamics and Control 23, 1487-1516. Lederman, J. and Klein, R. A., (1995). Virtual trading: How any trader with a PC can use the power of neural nets and expert systems to boost trading profits. Probus. Leung, M. T., Hazem, D. and Chen, A., (2000). Forecasting stock indices: a comparison of classification and level estimation models. International Journal of Forecasting 16, 173-190. Lin, C. T. and Lee C. S. G., (1996). Neural fuzzy systems: A Neuro-Fuzzy Synergism to Intelligent Systems. Prentice Hall. Lin C. T., (1994). Neural fuzzy control systems with structure and parameter learning. World Scientific. 38
  • 39. Lo, A. W. and MacKinlay, A. C., (1988). Stock market prices do not follow random walks: Evidence from a simple specification test. Review of Financial Studies 1, 41-66. Marcellino, M. and Mizon, G. E., (2000). Small system modelling of real wages, inflation, unemployment and output per capita in Italy 1970-1994. Journal of Applied Econometrics 16 (3)359-370. Moalla-Fetini, R., Ordoobadi, D. J., Orsmond, D. W. H., Ghosh, A. R. and Verhoeven, M., (1998). Turkey: Recent economic developments and selected issues. IMF Staff Country Report 104. Modis, T., (1999). Technological forecasting at the stock market. Technological Forecasting and Social Change 62, 173-202. Rigobon, R. and Sack, B., (2001). Measuring the reaction of monetary policy to the stock market. NBER Working Paper 8350. Tarditi, A., (1996). Modelling the Australian exchange rate, long bond yield and inflationary expectations. Research Paper 9608, Economic Analysis Department, Reserve Bank of Australia. Tay, N. S. P. and Linn, S. C., (2001). Fuzzy inductive reasoning, expectation formation and the behaviour of security prices. Journal of Economic Dynamics and Control 25, 321-361. Zadeh, L. A., (1965). Fuzzy sets. Information and Control 8, 338-353. 0.7 APPENDIX 0.6 0.5 0.4 0.3 0.2 0.1 39 0 1997 1997.5 1998 1998.5 1999 1999.5 2000 2000.5 2001
  • 40. Figure A.1 Rule 1 of the Neuro-Fuzzy Modelling 0.25 0.2 0.15 0.1 0.2 0.05 0.18 0.16 0 0.14 1997 1997.5 1998 1998.5 1999 1999.5 2000 2000.5 2001 0.12 Figure A.2 Rule 2 of the Neuro-Fuzzy Modelling 0.1 0.08 0.06 0.04 0.02 40 0 1997 1997.5 1998 1998.5 1999 1999.5 2000 2000.5 2001
  • 41. 0.35 Figure A.3 Rule 3 of the Neuro-Fuzzy Modelling 0.3 0.25 0.2 0.15 0.1 0.05 0 1997 1997.5 1998 1998.5 1999 1999.5 2000 2000.5 2001 Figure A.4 Rule of the Neuro-Fuzzy Modelling 41
  • 42. 0.35 0.3 0.25 0.2 0.15 0.1 0.05 0 1997 1997.5 1998 1998.5 1999 1999.5 2000 2000.5 2001 0.35 Figure A.5 Rule 5 of the Neuro-Fuzzy Modelling 0.3 0.25 0.2 0.15 0.1 0.05 0 1997 1997.5 1998 1998.5 1999 1999.5 2000 2000.5 2001 42
  • 43. Figure A.6 Rule 6 of the Neuro-Fuzzy Modelling 0.45 0.4 0.35 0.3 0.25 0.2 0.15 0.1 0.05 0 1997 1997.5 1998 1998.5 1999 1999.5 2000 2000.5 2001 Figure A.7 Rule 7 of the Neuro-Fuzzy Modelling 0.45 0.4 0.35 0.3 0.25 0.2 0.15 0.1 0.05 0 43 1997 1997.5 1998 1998.5 1999 1999.5 2000 2000.5 2001
  • 44. Figure A.8 Rule 8 of the Neuro-Fuzzy Modelling 44

×