热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

AComparisonBetweenHaarWaveletTransformandFastFourierTransforminAnalyzingFinancialTimeS

ResearchJournalofAppliedSciencesYear:2010|Volume:5|Issue:
Research Journal of Applied Sciences
Year: 2010 | Volume: 5 | Issue: 5 | Page No.: 352-360
DOI: 10.3923/rjasci.2010.352.360  
 
A Comparison Between Haar Wavelet Transform and Fast Fourier Transform in Analyzing Financial Time Series Data
 
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.
 
 

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 toSiddiqi (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) andManchanda 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.


推荐阅读
  • 本文介绍了设计师伊振华受邀参与沈阳市智慧城市运行管理中心项目的整体设计,并以数字赋能和创新驱动高质量发展的理念,建设了集成、智慧、高效的一体化城市综合管理平台,促进了城市的数字化转型。该中心被称为当代城市的智能心脏,为沈阳市的智慧城市建设做出了重要贡献。 ... [详细]
  • SpringBoot整合SpringSecurity+JWT实现单点登录
    SpringBoot整合SpringSecurity+JWT实现单点登录,Go语言社区,Golang程序员人脉社 ... [详细]
  • sklearn数据集库中的常用数据集类型介绍
    本文介绍了sklearn数据集库中常用的数据集类型,包括玩具数据集和样本生成器。其中详细介绍了波士顿房价数据集,包含了波士顿506处房屋的13种不同特征以及房屋价格,适用于回归任务。 ... [详细]
  • 自动轮播,反转播放的ViewPagerAdapter的使用方法和效果展示
    本文介绍了如何使用自动轮播、反转播放的ViewPagerAdapter,并展示了其效果。该ViewPagerAdapter支持无限循环、触摸暂停、切换缩放等功能。同时提供了使用GIF.gif的示例和github地址。通过LoopFragmentPagerAdapter类的getActualCount、getActualItem和getActualPagerTitle方法可以实现自定义的循环效果和标题展示。 ... [详细]
  • CF:3D City Model(小思维)问题解析和代码实现
    本文通过解析CF:3D City Model问题,介绍了问题的背景和要求,并给出了相应的代码实现。该问题涉及到在一个矩形的网格上建造城市的情景,每个网格单元可以作为建筑的基础,建筑由多个立方体叠加而成。文章详细讲解了问题的解决思路,并给出了相应的代码实现供读者参考。 ... [详细]
  • 本文介绍了一个适用于PHP应用快速接入TRX和TRC20数字资产的开发包,该开发包支持使用自有Tron区块链节点的应用场景,也支持基于Tron官方公共API服务的轻量级部署场景。提供的功能包括生成地址、验证地址、查询余额、交易转账、查询最新区块和查询交易信息等。详细信息可参考tron-php的Github地址:https://github.com/Fenguoz/tron-php。 ... [详细]
  • 本文介绍了使用Python编写购物程序的实现步骤和代码示例。程序启动后,用户需要输入工资,并打印商品列表。用户可以根据商品编号选择购买商品,程序会检测余额是否充足,如果充足则直接扣款,否则提醒用户。用户可以随时退出程序,在退出时打印已购买商品的数量和余额。附带了完整的代码示例。 ... [详细]
  • 大数据Hadoop生态(20)MapReduce框架原理OutputFormat的开发笔记
    本文介绍了大数据Hadoop生态(20)MapReduce框架原理OutputFormat的开发笔记,包括outputFormat接口实现类、自定义outputFormat步骤和案例。案例中将包含nty的日志输出到nty.log文件,其他日志输出到other.log文件。同时提供了一些相关网址供参考。 ... [详细]
  • 微软头条实习生分享深度学习自学指南
    本文介绍了一位微软头条实习生自学深度学习的经验分享,包括学习资源推荐、重要基础知识的学习要点等。作者强调了学好Python和数学基础的重要性,并提供了一些建议。 ... [详细]
  • [译]技术公司十年经验的职场生涯回顾
    本文是一位在技术公司工作十年的职场人士对自己职业生涯的总结回顾。她的职业规划与众不同,令人深思又有趣。其中涉及到的内容有机器学习、创新创业以及引用了女性主义者在TED演讲中的部分讲义。文章表达了对职业生涯的愿望和希望,认为人类有能力不断改善自己。 ... [详细]
  • baresip android编译、运行教程1语音通话
    本文介绍了如何在安卓平台上编译和运行baresip android,包括下载相关的sdk和ndk,修改ndk路径和输出目录,以及创建一个c++的安卓工程并将目录考到cpp下。详细步骤可参考给出的链接和文档。 ... [详细]
  • 解决Cydia数据库错误:could not open file /var/lib/dpkg/status 的方法
    本文介绍了解决iOS系统中Cydia数据库错误的方法。通过使用苹果电脑上的Impactor工具和NewTerm软件,以及ifunbox工具和终端命令,可以解决该问题。具体步骤包括下载所需工具、连接手机到电脑、安装NewTerm、下载ifunbox并注册Dropbox账号、下载并解压lib.zip文件、将lib文件夹拖入Books文件夹中,并将lib文件夹拷贝到/var/目录下。以上方法适用于已经越狱且出现Cydia数据库错误的iPhone手机。 ... [详细]
  • 本文介绍了Linux系统中正则表达式的基础知识,包括正则表达式的简介、字符分类、普通字符和元字符的区别,以及在学习过程中需要注意的事项。同时提醒读者要注意正则表达式与通配符的区别,并给出了使用正则表达式时的一些建议。本文适合初学者了解Linux系统中的正则表达式,并提供了学习的参考资料。 ... [详细]
  • Android日历提醒软件开源项目分享及使用教程
    本文介绍了一款名为Android日历提醒软件的开源项目,作者分享了该项目的代码和使用教程,并提供了GitHub项目地址。文章详细介绍了该软件的主界面风格、日程信息的分类查看功能,以及添加日程提醒和查看详情的界面。同时,作者还提醒了读者在使用过程中可能遇到的Android6.0权限问题,并提供了解决方法。 ... [详细]
  • CentOS7.8下编译muduo库找不到Boost库报错的解决方法
    本文介绍了在CentOS7.8下编译muduo库时出现找不到Boost库报错的问题,并提供了解决方法。文章详细介绍了从Github上下载muduo和muduo-tutorial源代码的步骤,并指导如何编译muduo库。最后,作者提供了陈硕老师的Github链接和muduo库的简介。 ... [详细]
author-avatar
shzq110_113
这个家伙很懒,什么也没留下!
Tags | 热门标签
RankList | 热门文章
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有