Research Journal of Applied Sciences

Year: 2010
Volume: 5
Issue: 5
Page No. 352 - 360

A Comparison Between Haar Wavelet Transform and Fast Fourier Transform in Analyzing Financial Time Series Data

Authors : S. Al Wadi, Mohd Tahir Ismail and Samsul Ariffin Addul Karim

Abstract: Recently, the Fast Fourier Transforms (FFT) and the Discrete Wavelet Transforms (DWT) are two time series filtering methods that are used to represent the fluctuations of stocks market. In general the basic wavelet function, Haar wavelet transform is a mathematical function that cut off the data into different frequency components, satisfies some of mathematical requirements and it has better advantages than the traditional Fourier series in analyzing financial data. Fourier transform appears to have some problem associate with its transformation because it measures the data as a function of position (in frequency domain) without consider the time while wavelet transform displays their correlation as a function of scale and time (localized in both). In this study we use financial time series data taking from the Amman Stocks Market (Jordan) for a certain period of time in order to understand the similarities and dissimilarities between both of them. We look for point of abrupt changes, closing price and normalized data. In addition, some numerical results will be presented using Matlab programming.

How to cite this article:

S. Al Wadi, Mohd Tahir Ismail and Samsul Ariffin Addul Karim, 2010. A Comparison Between Haar Wavelet Transform and Fast Fourier Transform in Analyzing Financial Time Series Data. Research Journal of Applied Sciences, 5: 352-360.

INTRODUCTION

Financial time series especially stock markets, exchange rates and commodity prices always show irregular behaviors likes abrupt changes, trend and seasonal variations. Therefore to eliminate these unusual features researchers have used log transformation, curve fitting, filtering and differencing in hope to obtain a smooth data. Recently, wavelet analysis and Fourier analysis are two methods that are used for filtering time series representing.

Wavelet analysis has grown very quickly in the recent years and more recently Wall Street analysts have started using wavelets as mathematical models to analyze their financial data (Manchanda et al., 2007). Although, fourier analysis has been quite popular in the scientific world, wavelet analysis also has been used in signal processing (time scale analysis), pattern recognition, decomposition, approximation techniques, power systems, video coding, de-nosing signals, digital subscriber line and quantum field. For more details and examples refer to (Ramsey, 2002; Das and Sushama, 2009; Kadhim et al., 2004; Bereksi-Reguig et al., 2006; Vignesh et al., 2006; Daqrouq, 2005). It has been shown that wavelet transform are more efficient than Fourier transform (Arneodo et al., 2002; Razdan, 2004; Whitchera et al., 2005; Newland, 1993; Gencay et al., 2002; Mallat, 2001).

This is because wavelet transform can be used to analyze nonlinear and non-stationary time series signals, useful in identifying transient events has a good powerful in filtering the de-noise data to get more accurately data provides decomposition of a time series into several components from different scale and appears their correlation as a function on scale and time (localized in both).

However, Fourier transform provides insufficient information due to the non-localized natural of the transform for example; fail to detect the abrupt changes in time of the non-stationary signal, failure to provide meaningful and significant result for the non stationary time series and it measures the data as a function of position in frequency domain (Labat et al., 1999; Gencay et al., 2002). Therefore, to show the efficiency of wavelet transform, this study will introduce the Discrete Wavelet Transform (DWT) and Fast Fourier Transform (FFT) and then demonstrates that Haar wavelet transform is better than fast fourier transform in decomposing or analyzing financial time series data. MATLAB is used to obtain some of numerical and statistical results. The Haar wavelet is the simplest example of DWT which is Daubechies-1 transformation as discussed in Siddiqi (2004) and Daubechies (1992).

In order to illustrate the effectiveness of Haar wavelet transform, the Amman Stocks Market data sets are selected for discussion. A daily closing price index is considered for time period from January 1992 (the days when stocks exchanges were open) until October 2008 with a total of 4096 observations.

The total number of observations for mathematical convenience is suggested to be divisible by 2J. It means that the data should satisfy the condition of observations = 2J.

Therefore, we can decompose the data set until level 12 (4096 = 212 observations). Nevertheless, it found that from level 3 and onwards we will get similar results. Therefore, we decompose the data until level 3 only as suggested by Daubechies (1992).

The distributions of the daily prices fluctuations are very important, useful and necessary for understanding the market dynamic. Therefore, we studied the daily return closing price and the distribution of the normalized closing price data (Masset, 2008; Wittman, 2002).

MATERIALS AND METHODS

Wavelet transform and fourier transform: The basic idea by using Fourier transform, wavelet transform and the other filtering methods is to represent the original time-series as a new sequence which appears and explain the importance of each frequency components, trends, magnitudes, fluctuations and deferent requirements in the dynamics of the original series. We will start this section by explaining the discrete fourier transform and then the Haar wavelet transforms. For more details and examples refer to Siddiqi (2004).

Fourier transform: Spectral analysis of a data involves the decomposition of the signal into its frequency components. In other words, by using spectral analysis methods, the original data can be separated into its sub spectral components (Akin et al., 2000).

Among spectral analysis techniques, fourier transform is considered to be the best transformation between time and frequency domains because of it being time shift invariant. The fourier transform pairs are expressed as (Proakis and Manolakis, 1996; Akin, 2002).

(1)

(2)

Where:

By calculating Eq. 1 and 2 we get Fast Fourier Transforms (FFT) and Inverse Fast Fourier Transforms (IFFT), respectively. Fourier transform can be improved by other method known as Short Time Fourier Transform (STFT) or Gabour transform to get a balance between time frequency window for more details and examples refer to (Chiann and Moretin, 1998).

Haar wavelet transform: Wavelet transform analyzes the data onto a set of basic functions called as wavelets. Wavelets are obtained from a single prototype wavelet called mother wavelet by dilatations and contractions as well as by shifts (Hazarika, 1997).

The first result of the term wavelet was in a thesis by Alfred Haar. Therefore, the theoretical form was proposed by Jean Morlet; Alex Grossmann in France has researched in the term of the theoretical physics center. The main contribution in the wavelet term was done by Y. Meyer and his colleagues, who have ensured the methods disseminatio.

In 1988 Stephane Mallat has introduced the main algorithm for the wavelet transform. Consequently, many researches on wavelets have become international. Such Research is particularly active in the United States where it is spearheaded by the research of scientists such as Ingrid Daubechies, Ronald Coifman and Victor Wickerhauser (Akin, 2002; Misiti et al., 1996). Consider the input signal x (t), WT either Continuous WT (CWT) or Discrete WT (DWT). The CWT is expressed as:

(3)

where, * represents the complex conjugate, αεR+ shows the scale parameter and bεR+ denotes the translation. The function Ψa,b (t) is obtained by scaling the prototype wavelet Ψ (t) at time a and scale b and is defined as:

(4)

Generally, the orthogonal dyadic functions in wavelet applications are chosen as the mother wavelet. This transform is often discredited in a and b on a dyadic grid with the time remaining continuous. The commonly mother wavelet is defined as:

(5)

where, Ψj,k (t), j, kεZ for L2 (R), for examples and details explanation refers to Chiann and Moretin (1998), Masset (2008) and Manchanda et al. (2007). The oldest and simplest example of the wavelet transform is the Haar wavelet defined as:

(6)

Other two concepts related to wavelet transform which are the farther wavelets and the mother wavelets, φ (2t-k) is the father wavelet, Ψ(t) is the mother wavelet.

Father is used to represent the high scale smooth components of the signal while the mother wavelets display the deviations from the smooth components. Since the father wavelet generates the scaling coefficients and mother wavelet gives the differencing coefficients. The father wavelets is defined as lower pass filter coefficients (hk) and the mother wavelets as high pass filters coefficients (lk) (Daubechies, 1992).

(7)

(8)

For the Haar wavelet:

And for:

Daily closing price: The traditional definition of the stocks price distribution is:

Where:

So = Initial price of the stocks
μ =

Drift in average growth rate

σ =

Volatility

wt =

Brownian motion drift which normally distributed with zero mean and standard deviation

The daily return was defined by many ways for computational simplicity we used (Manchanda et al., 2007):

Normalized data: The aim of normalizing the data is to reduce and eliminate data redundancy. Therefore, get a modified data (financial data) more meaningful, helpful for presentation, comparison and analyzing.

Mathematically, we have two ways to normalize stock market data. Firstly, stock-based normalization: we should evaluate the mean percentage change μi, standard deviation δi then apply this relation:

where, represents the closed price. Secondly, time based normalization can be calculated by:

(9)

Where:

μ (t) = Represents the mean of time interval
δj(t) =

The standard deviation for the time interval

For more details and examples refer to (Manchanda et al., 2007; Wittman, 2002; Loh et al., 2010; Goldin and Kanellakis, 1995).

RESULTS AND DISCUSSION

Figure 1 shows Amman Stocks Market closing price (original data). Figure 2 and 3 the result of Fast Fourier Transform (FFT), the magnitude of FFT squared is called by estimation of power spectrum. The plot of the estimation power spectrum versus frequency is called by periodogram. Figure 3, 4 and 6 show the analysis and transformation by using Wavelet approximation.


Fig. 1:

Original data for Amman Stocks Market closing price between January 1992-October 2008


Fig. 2:

Since the result of this transform is a complex vector and then this figure shows the Power Spectrum Estimation or the magnitude of the complex vector square


Fig. 3:

Shows the magnitude of the frequency plot precisely for the previous transformation since the magnitude in (Fig. 2) does not appear very well

Figure 7 appears amman stocks market normalized data (using Eq. 9) (Fig. 8 and 9). The result of Fast Fourier Transform (FFT), the magnitude of FFT squared is called by estimation of power spectrum.

The plot of the estimation power spectrum versus frequency is called by periodogram. Figure 10-12 have shown the analysis and transformation normalizing data by using Wavelet approximation. In Fig. 1-6 we show the distribution of closing price and normalized closing price time series data for amman stocks market for certain period of time. From the plotting we notice that wavelets transform have a very good ability to analyze a huge amount of a singles more than fast fourier transform. Moreover, a plot of the Fast Fourier Transform (FFT) of this signal shows nothing particularly interesting.

However, Wavelet analysis is capable of revealing aspects of data that other signal analysis techniques miss aspects like trends. Furthermore, it gives different view of data than those presented by fast fourier transform; it can often compress or de-noise. While, traditional technique (FFT) has not given the similar results.

In this study, three cases are discussed as we mentioned in the abstract. Firstly, the closed price, the decompositions by using Haar wavelet level 3 explained all of the important details and features for stocks markets. However, by using FFT we notice that most of the data represented as curve approach and inherent on the x-axis and y-axis. So that, hardly to capture the financial features and explain the behavior of the capital market.

Secondly, utilize the normalization rules to reduce the data and discuss the data in small interval. As well as, this normalization removes the overall trend of the stock market, amplitude scaling and reduced the noise. To remove these distortions, preprocessing is performed on the time-series before they are compared. The preprocessing helps find similar time-series more accurately (Keogh, 2006; Loh et al., 2010). As an analogy, if the time series represented the daily temperature over the course of a year at different locations on the earth, time-based normalization would help remove the effect of the seasons that would be present in all the time series.

Unfortunately, the FFT method gives the same decompositions. Consequently, as a result the power spectrum in (Fig. 8) and the magnitude of frequency (Fig. 9) give the same result in Fig. 2 and 3, respectively with different data. Therefore, we never got any benefits from analyze the normalized data by using Fast Fourier Transform (FFT) and the data still represent as a function and approach over x-axis and y-axis.

However, during the small Fig. 10-12 we deduct some improvement in the analysis since it represented in a small interval. So that becomes more convenient to understand the fluctuations and its magnitudes and notice the behaviors more preciously in the stocks markets. Consequently, the decompositions are changed after normalized the closed price. Finally, we discuss the abrupt of change. Intuitively by refer to the Fig. 1-12 we notice that FFT cannot capture the details of abrupt of change in the stocks markets, usually it is happened by natural phenomena like climate then it affects on the stocks markets behavior. Consequently, it has very important side in analyzing the financial time series.


Fig. 4:

Data analysis: using MATLAB_Haar wavelet level 3


Fig. 5:

Statistical analysis: using MATLAB_Haar wavelet level 3

While Haar wavelet transform capture the abrupt of change very well, There are many notations about the structure break, most the financial crises already happened after the year 2004, the main reason return to increase the numbers of the non Jordanian investments during this time (2004-2009) so we notice that precisely in 2004-2006, the investments are unbalance (sometime positive and sometime negative).


Fig. 6:

Original/ de-noise data: using MATLAB_Haar Wavelet level 3


Fig. 7:

The normalized data


Fig. 8:

Power Spectrum Estimation for the normalized data, it represents by complex vector


Fig. 9:

Shows the magnitude of the frequency plot precisely for the previous transformation in Fig. 8


Fig. 10:

Shows the Data analysis: using MATLAB_Haar wavelet level 3

Moreover, in February 2006 the investment becomes more balance and continues until August 2006. However, in August 2006 the investment showed a negative balance but in September the non Jordanian investments already increased and the investments fluctuated from time to time until now a days. This instability in the investments effected on the stocks market during all the time from 2004 until 2009. Consequently, the investment is the main variable which effected in Amman stocks market. As well as, we notice that before 2004 the investment is very low and there is a very small structure break. Consequently wavelet transform has a good ability better than FFT in the analyzing.


Fig. 11:

Shows Statistical analysis: using MATLAB_Haar wavelet level 3


Fig. 12:

Shows Original/de-noise data: using MATLAB_ Haar wavelet level 3

CONCLUSION

The results have been observed for the daily return closing price or normalized data by using Discrete Wavelet Transform (DWT) technique (Haar Wavelet) provides an intuitive, powerful, meaningful and helpful to estimate time-varying features and analyzing financial time series data, since it provides very clear features for estimation (Fig. 3 and 6) and captures higher and lower frequency oscillations contained in the signals, appears the fluctuations in the stocks market, explains statistical analysis shows de-noise data, interpretive the residuals, as well as draws their correlations as a function of both scale (Wavelength) and time (position) but we detected during the analyzing of Fast Fourier Transform is inconvenient and insufficient method for analyzing, presenting the fluctuations and display abrupt of changes for the non-linear and non-stationary financial time series. Furthermore, these results lead to Wavelet transform method has applications in various ranges of problems either inside or outside financial time series.

ACKNOWLEDGEMENT

The researchers would like to thank USM for the financial support and USM fellowship scheme.

Design and power by Medwell Web Development Team. © Medwell Publishing 2024 All Rights Reserved