热门标签 | 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.


推荐阅读
  • Spring源码解密之默认标签的解析方式分析
    本文分析了Spring源码解密中默认标签的解析方式。通过对命名空间的判断,区分默认命名空间和自定义命名空间,并采用不同的解析方式。其中,bean标签的解析最为复杂和重要。 ... [详细]
  • 如何自行分析定位SAP BSP错误
    The“BSPtag”Imentionedintheblogtitlemeansforexamplethetagchtmlb:configCelleratorbelowwhichi ... [详细]
  • 阿里Treebased Deep Match(TDM) 学习笔记及技术发展回顾
    本文介绍了阿里Treebased Deep Match(TDM)的学习笔记,同时回顾了工业界技术发展的几代演进。从基于统计的启发式规则方法到基于内积模型的向量检索方法,再到引入复杂深度学习模型的下一代匹配技术。文章详细解释了基于统计的启发式规则方法和基于内积模型的向量检索方法的原理和应用,并介绍了TDM的背景和优势。最后,文章提到了向量距离和基于向量聚类的索引结构对于加速匹配效率的作用。本文对于理解TDM的学习过程和了解匹配技术的发展具有重要意义。 ... [详细]
  • 本文介绍了设计师伊振华受邀参与沈阳市智慧城市运行管理中心项目的整体设计,并以数字赋能和创新驱动高质量发展的理念,建设了集成、智慧、高效的一体化城市综合管理平台,促进了城市的数字化转型。该中心被称为当代城市的智能心脏,为沈阳市的智慧城市建设做出了重要贡献。 ... [详细]
  • Linux重启网络命令实例及关机和重启示例教程
    本文介绍了Linux系统中重启网络命令的实例,以及使用不同方式关机和重启系统的示例教程。包括使用图形界面和控制台访问系统的方法,以及使用shutdown命令进行系统关机和重启的句法和用法。 ... [详细]
  • Webpack5内置处理图片资源的配置方法
    本文介绍了在Webpack5中处理图片资源的配置方法。在Webpack4中,我们需要使用file-loader和url-loader来处理图片资源,但是在Webpack5中,这两个Loader的功能已经被内置到Webpack中,我们只需要简单配置即可实现图片资源的处理。本文还介绍了一些常用的配置方法,如匹配不同类型的图片文件、设置输出路径等。通过本文的学习,读者可以快速掌握Webpack5处理图片资源的方法。 ... [详细]
  • 本文主要解析了Open judge C16H问题中涉及到的Magical Balls的快速幂和逆元算法,并给出了问题的解析和解决方法。详细介绍了问题的背景和规则,并给出了相应的算法解析和实现步骤。通过本文的解析,读者可以更好地理解和解决Open judge C16H问题中的Magical Balls部分。 ... [详细]
  • 本文介绍了机器学习手册中关于日期和时区操作的重要性以及其在实际应用中的作用。文章以一个故事为背景,描述了学童们面对老先生的教导时的反应,以及上官如在这个过程中的表现。同时,文章也提到了顾慎为对上官如的恨意以及他们之间的矛盾源于早年的结局。最后,文章强调了日期和时区操作在机器学习中的重要性,并指出了其在实际应用中的作用和意义。 ... [详细]
  • web.py开发web 第八章 Formalchemy 服务端验证方法
    本文介绍了在web.py开发中使用Formalchemy进行服务端表单数据验证的方法。以User表单为例,详细说明了对各字段的验证要求,包括必填、长度限制、唯一性等。同时介绍了如何自定义验证方法来实现验证唯一性和两个密码是否相等的功能。该文提供了相关代码示例。 ... [详细]
  • 深度学习中的Vision Transformer (ViT)详解
    本文详细介绍了深度学习中的Vision Transformer (ViT)方法。首先介绍了相关工作和ViT的基本原理,包括图像块嵌入、可学习的嵌入、位置嵌入和Transformer编码器等。接着讨论了ViT的张量维度变化、归纳偏置与混合架构、微调及更高分辨率等方面。最后给出了实验结果和相关代码的链接。本文的研究表明,对于CV任务,直接应用纯Transformer架构于图像块序列是可行的,无需依赖于卷积网络。 ... [详细]
  • 本文介绍了如何使用Express App提供静态文件,同时提到了一些不需要使用的文件,如package.json和/.ssh/known_hosts,并解释了为什么app.get('*')无法捕获所有请求以及为什么app.use(express.static(__dirname))可能会提供不需要的文件。 ... [详细]
  • 本文讨论了如何在codeigniter中识别来自angularjs的请求,并提供了两种方法的代码示例。作者尝试了$this->input->is_ajax_request()和自定义函数is_ajax(),但都没有成功。最后,作者展示了一个ajax请求的示例代码。 ... [详细]
  • Spring常用注解(绝对经典),全靠这份Java知识点PDF大全
    本文介绍了Spring常用注解和注入bean的注解,包括@Bean、@Autowired、@Inject等,同时提供了一个Java知识点PDF大全的资源链接。其中详细介绍了ColorFactoryBean的使用,以及@Autowired和@Inject的区别和用法。此外,还提到了@Required属性的配置和使用。 ... [详细]
  • 本文介绍了一个适用于PHP应用快速接入TRX和TRC20数字资产的开发包,该开发包支持使用自有Tron区块链节点的应用场景,也支持基于Tron官方公共API服务的轻量级部署场景。提供的功能包括生成地址、验证地址、查询余额、交易转账、查询最新区块和查询交易信息等。详细信息可参考tron-php的Github地址:https://github.com/Fenguoz/tron-php。 ... [详细]
  • VueCLI多页分目录打包的步骤记录
    本文介绍了使用VueCLI进行多页分目录打包的步骤,包括页面目录结构、安装依赖、获取Vue CLI需要的多页对象等内容。同时还提供了自定义不同模块页面标题的方法。 ... [详细]
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社区 版权所有