An empirical analysis to study the cyclical trends on stock exchange using wavelet methods

Article history: Received 1 June 2010 Received in revised form 10 September 2010 Accepted 19 September 2010 Available online 19 September 2010 During the past few decades, there have been many evidences to believe that the stock markets around the world follow cyclical trends. In this paper, we study the cyclical trends using wavelet function based on various time windows on some major stock market indices. We use two methods of Daubechies and reverse bi-orthogonal wavelet methods and determine the optimal values of both methods. The results are used for Tehran stock exchange using the most recent ten years daily information as an empirical study. The details of our analysis on TEDPIX index for the last decade indicate that there are, at least, four trends of weekly, monthly, quarterly and yearly and the cycles would be expected to be repeated in future.


Introduction
During the past few years there has been a growing interest in using technical methods on studying the trends on stock market.In fact, many people believe that in an efficient market all the fundamental factors are reflected into the prices on stock market and no one can benefit of the existing financial views from the companies' statements for future stock price prediction.Therefore, many prefer to use technical analysis as an alternative strategy to predict the future stock market.Technical analysis has become an interesting subject of research among many and there are virtually hundreds of methods which are used for predicting stock prices, future commodities, currency values, etc (Edwards & Magee, 2001).Fernandez (2007) studied the behavior of the stock prices of a subset of eight U.S. industries from the late 1800's to the great depression.He also studied the relationship between the cycles and the cooperation among businesses, (Fernandez, 2007).One of the important issues on predicting the stock prices is to study the cyclical behavior of stock market.In fact, there have been tremendous efforts on using different scientific tools to determine the cyclical behavior of stock market.The Hodrick-Prescott filter (1997) is one of the technical tools used in macroeconomics and also in the study of real business cycle theory.The method tries to separate the cyclical piece of a time series from raw data based on obtaining a smoothed non-linear representation of time series.The other technical method to predict the trend on stock market is to use wavelet function (Vidakovic, 1999;Capobianco, 2002;Crowley, 2005;Walker, 2008).The wavelet decomposition methods are used to analyze of the oscillations and changes in frequencies since they normally provide concurrent information on the frequency (scale) and localization in time (translation).However, in order to implement the wavelet decomposition, we need to perform some requirements so that the linear and cyclic trends can be eliminated by standard least squares techniques.Caetanoa and Yoneyama (2007) used wavelet function to study the trend of some major stock indices in Brazil.Aguiar-Conraria et al. (2008) used the wavelet function to study the time frequency effects of monetary policy.They used cross-wavelet tools to study the relationship between monetary policy variables and macroeconomic variables and they reported that the changes are not homogeneous across the different frequencies.Mulligan and Lombardo (2004) studied 12 maritime equity price series for behavioral stability and efficient market pricing for the 1989-2002 period including wavelet function.
In this paper, we present an empirical analysis on time series data from Iranian stock market for the period of November, 1999 to February, 2010 using the wavelet function.The primary aim of this paper is to extract the cyclical behavior of the market.The performance of the market is compared with other technical methods and they are analyzed.This paper is organized as follows.We first introduce the wavelet function in details in section 2. Section 3 is devoted to empirical analysis of our study on TEDPIX index in Iranian stock exchange.Finally, conclusion remarks are given in section 4 to summarize the contribution of this paper.

Wavelet Function
Generally, any wave-like oscillation that starts out at zero, increases, and then decreases back to zero is an example of wavelet function.Wavelets are purposefully designed to have specific properties which make them useful for signal processing.A wavelet is a function used to divide a given function into various scale components.Normally one can assign a frequency range to each scale component.Each scale component can then be analyzed with a resolution which matches its scale and the transformation is the representation of a function by wavelets.However, the primary purpose of this research is to use it for deriving the trend from stock market.There are two primary assumptions with the implementation of the wavelet on stock market: There are cyclical patterns on market and the cycles have constant amplitude.Without loss of generality we assume that all 5, 20, 65, 260 and 1040 data represent the weekly, monthly, quarterly, yearly and four yearly periods, respectively.We consider these five periods as basis for our wavelet analysis.Therefore, the index of the stock market is analyzed as follows, There are different wavelet methods which could be used to verify whether any cyclical patterns exist in stock market or not.We have run 67 different wavelet scenarios using the MATLAB toolbox and, based on the four criteria explained in this section, two methods of Daubechies (DB) wavelets (Daubechies, 1988) and reverse bi-orthogonal are chosen for the discussion of this paper.Next section, we explain the details of our empirical implementation of our wavelet.

Case Study
Tehran stock exchange (TSE) is one of the well known middle-east stock market where the shares of over four hundred companies are publicly traded.TSE is Iran's largest stock exchange and it was first opened in 1967.As of July 2010, 337 companies, with a market capitalization of US$72 billion were listed on TSE.TSE is also a full member of the World Federation of Exchanges and a founding member of the Federation of Euro-Asian Stock Exchanges.Despite the fact that most stock exchanges in the world have been experiencing a bear market for the past few years, TSE has been one of the world's best performing stock exchanges in recent years.There are over 40 industries directly involved with TSE stock exchange such as telecommunications, agriculture, petrochemical, mining, steel iron, copper, banking and insurance, financial mediation, etc.This is one of the most important attributes of this exchange which makes its index a unique choice.There are six indexes computed on this market and the main one is called TEDPIX.From down to up we can study the behavior of different trends from weekly to four years, respectively shown on Fig 3 .As we can observe, the seasonal trend represents four cycles where the annual trend shows only one cycle.Daubechies wavelet with db5 represents the best estimate where it meets all four necessary assumptions.Table 1 shows the details of the implementation of the wavelet for different values of db.As we can observe from Table 1, the wavelet function with db5 represents the minimum value of the energy percentage, the maximum ratio of covariance divided by energy, the maximum ratio of correlation and the minimum value of the sum of least square (RMSE).

Fig. 3. The results of the multi-scale decomposition based on Daubechies wavelet with db5 trends
We have also used reverse bi-orthogonal wavelet family.Table 2 shows the details of our computations for reverse bi-orthogonal wavelet.As we can observe from Table 1, the wavelet function with db5 represents the minimum value of the energy percentage, the maximum ratio of covariance divided by energy, the maximum value of the correlation and the mimimum value of the sum of the least square (RMSE).The results of Table 2 also indicates that we can conclude that the best performance of reverse biorthogonal wavelet can be achieved when rbio1.5.The details of our survey on multi-scale decomposition with rbio1.5 is shown in Fig 4. The results of this study also indicate that we may expect to see the same trend on stock exchange.In other words, the change on the bull session into a bear session could be predicted using the wavelet function.However, the authors believe that the technical analysis used in this research must be used along with some other fundamental surveys.In other word, a technical analysis can be used after good fundamental analysis justifies the future prospects.
Multi scale component using rbio=1.5Actual versus Synthesized signal There are also some issues to be considered when one is interested in investing on TSE market.First, the market is presently suffering from liquidity issue.The big percentage of the shares of many stocks are presently held by semi-govermental sectors and they are not willing to make so many transactions on a daily basis.Second, most companies enjoy the subsidized energy prices and any future plan on deregulating the energy prices could change the fundamentals and the present study cannot be used for future trend prediction.Third, the market does not offer margin and short selling are nor permitted.This could reduce the chance of increasing the leverage on stock market.However, there is a positive side on this regulation since the issue of margin call will not happen on this market.

Conclusion
In this paper, we have used two wavelet methods to extract the cyclical information of one of the most important middle-east indexes.The implementation of Daubechies method on Iranian stock exchange called TEDPIX indicates that there are several cyclical trends from weekly, monthly and seasonal to yearly and four-year on that market.The results of the reverse bi-orthogonal wavelet method also confirm the same results with some slight changes.Since the index has benefited from a relatively healthy economy during the past decade, one may wish to use other technical methods to predict the future of this market.One possible future research is to use Hodrick and Prescott filtering technique to repeat the results and compare them with wavelet techniques.The other opportunity for future research is to study the effects of deregulation of energy prices on trends of cycles on TSE market.
Multi scale component using rbio1.5 terms.There are four criteria to measure the quality of a wavelet in model (4) which are as follows, 1.The percentage of lost energy, 2. The correlation coefficient, 3. The ratio of covariance divided by energy, 4. The min of sum of the least squares.
Fig 1. depicts the trend of TSE for a ten-year period from 2000 to 2010.

Fig. 1 .
Fig. 1.The trend of TSE from year 2000 to 2009 (Source: Wikipedia)This index is computed based on price and dividend yields.We have collected the historical daily information from late 1999 to early 2010.As we explained in the previous section, we have used different cycles from weekly to four-year period and different wavelet filters have been implemented to detect various trends.Fig 2.shows the details of our implementation of Daubechies wavelet with db5.

Fig. 2 .
Fig. 2. The implementation of Daubechies wavelet with db5 The first figure on the top left side of the Fig 1 represents the actual versus the synthesis data.The six figures on the right side show the extracted cyclical trends of weekly to four year and finally the residual of the data is reported on the down left side of the figure.In order to understand the behavior of different cyclical trends we show them in details in a separate figure shown in Fig. 3.

Fig 4 .
Fig 4. The details of the implementation of reverse bi-orthogonal wavelet with rbio=1.5 Again, we can observe similar trends from Fig 4 as we learned from the other figures.The structure of the figure is similar to what we had on Fig 2. The details of the trends are also shown in Fig 5 where the first one from top represents the four-year cycle.The four-year cycle shows the details of a cyclical pattern and it looks like the one we saw on Fig 3.The yearly pattern is also similar to what we see on the previous method.From the seasonal figure we see fewer cycle on this one compared with the previous wavelet filter.The last one represents the weekly pattern when there are more cycles on Daubechies method than the reverse biorthogonal wavelet.

Table 1
Four different characteristics used for performance evaluation of Daubechies wavelet

Table 2
The values of four criteria for different values of rbio