11.07.2015 Views

Software issues in wavelet analysis of financial data - Numerical ...

Software issues in wavelet analysis of financial data - Numerical ...

Software issues in wavelet analysis of financial data - Numerical ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>Numerical</strong> Algorithms GroupMathematics and technology for optimized performance<strong>S<strong>of</strong>tware</strong> Issues <strong>in</strong> Wavelet Analysis <strong>of</strong>F<strong>in</strong>ancial DataRobert TongResults Matter. Trust NAG.


Overview Why Use Wavelets? Wavelet transforms Multi-Resolution Analysis <strong>S<strong>of</strong>tware</strong> implementations and algorithms Choos<strong>in</strong>g a <strong>wavelet</strong> method Some ApplicationsResults Matter. Trust NAG.2


Wavelet Transformsx(t),Decompose time series, by convolution with dilated and translated mother<strong>wavelet</strong>,ψ (t ) Cont<strong>in</strong>uous (CWT) Discrete (DWT)dψ( uu , s, s )( t )∞= ∫− ∞=1x ( t ) ψ⎛ψ ⎜⎝e.g. Morlet <strong>wavelet</strong>,ψ ( t)=Results Matter. Trust NAG.s1e2πtu , s−s− ikt −te2( t ) dtu/ 2⎞⎟⎠,Filter pair: G – high passH – low passwith D – down-sampl<strong>in</strong>g(Hx)k= ∑ hn−nk4xn


Wavelet Transforms (2) CWT requires:∫ ∞ −∞ψ ( t)dt= 0∫ ∞ −∞| ψ ( t)|2 dt= 1 DWT (orthogonal filter pair) requires:∑ h nh n + 2 j=n0,Results Matter. Trust NAG.∑2h n= 1,∑ g g n n+2 j= 0, ∑2g n= 1,nnngnn= ( −1)h1−n∑ h g n n+j= 0 2n5


Wavelet Functions1Morlet (k=5)0.2Daubechies:DB40.150.50.10.0500-0.5-0.05-0.1-1-8 -6 -4 -2 0 2 4 6 8Gaussian 3 rd derivative-0.15DB120 200 400 600 800 100010.10.50.0500-0.5-0.05-1-4 -2 0 2 4Results Matter. Trust NAG.-0.10 200 400 600 800 10006


Multi-Resolution AnalysisDiscrete Wavelet Transformx(t)Gx | 2d 1d 2Hx | 2Gs 1 | 2Hs 1 | 2Gs 2 | 2Results Matter. Trust NAG.Hs 2 | 27


Stationary DWT (SDWT)Note: DWT is NOT translation <strong>in</strong>variantchoos<strong>in</strong>g odd entries <strong>in</strong> series, <strong>in</strong> place <strong>of</strong> even ones when downsampl<strong>in</strong>ggives a different orthogonal transformationDWT MRA – choice <strong>of</strong> shift at each level gives multiple possible sets<strong>of</strong> coefficientsSDWT – NO down-sampl<strong>in</strong>g,pad filters with zeros <strong>in</strong> MRA<strong>in</strong>cludes all DWT MRA possibilitiestranslation <strong>in</strong>variant, but <strong>in</strong>creases storagecan relate <strong>wavelet</strong> coefficients to <strong>data</strong>Results Matter. Trust NAG.9


Translation <strong>in</strong>variant SDWTx(t)d 1x(t)d 2d 3d 4s 4Results Matter. Trust NAG.10


Choos<strong>in</strong>g a Wavelet Method CWTCont<strong>in</strong>uous transformVisualise as surface DWT/MRADiscrete, multiresolutionEfficient storage <strong>of</strong> signal Match<strong>in</strong>g PursuitAdapt basis to <strong>data</strong>At each level <strong>of</strong> MRA choosewaveform to m<strong>in</strong>imise residualpassed to next level SDWTTranslation <strong>in</strong>variantNo down-sampl<strong>in</strong>gResults Matter. Trust NAG.11


CWT: how can quantitative <strong>in</strong>formation be obta<strong>in</strong>ed?Results Matter. Trust NAG.12


CWT (2) F<strong>in</strong>d common normalisation for <strong>wavelet</strong> spectrum – ensure<strong>wavelet</strong> has unit energy at each scaleChoice <strong>of</strong> <strong>wavelet</strong>:non-orthogonal is useful for time series, but highly redundantChoice <strong>of</strong> scales:can use arbitrary set <strong>of</strong> scales to show structureCone <strong>of</strong> <strong>in</strong>fluence:for f<strong>in</strong>ite length series def<strong>in</strong>es where edge effects occurRelate to Fourier frequencye.g. see Torrence and Compo (1998)Results Matter. Trust NAG.13


<strong>S<strong>of</strong>tware</strong> implementation and algorithms Reproducibility is desirable –algorithms precisely def<strong>in</strong>ed to allow <strong>in</strong>dependent implementations –Taswell (1998), c.f. Buckheit and Donoho (1995) Edge effects –contam<strong>in</strong>ate ends <strong>of</strong> transform for f<strong>in</strong>ite signals – various end conditionsused to reduce their effect: periodic extension, reflection, zero-padd<strong>in</strong>g … CWT –implement quadrature and convolution <strong>in</strong> time doma<strong>in</strong> orelse convolution with Fourier Transform <strong>of</strong> <strong>wavelet</strong> <strong>in</strong> frequency doma<strong>in</strong>Parallel implementationResults Matter. Trust NAG.14


Implementation and algorithms (2) Def<strong>in</strong>ition <strong>of</strong> forward and <strong>in</strong>verse transforms –DWT orthogonality conditions allow for different choices <strong>of</strong> forward and<strong>in</strong>verse transforms Pre-process<strong>in</strong>g <strong>of</strong> <strong>data</strong> –<strong>data</strong> may need clean<strong>in</strong>g, <strong>in</strong>terpolation to produce homogeneous series, …Results Matter. Trust NAG.15


Applications De-nois<strong>in</strong>g Identify<strong>in</strong>g seasonality Self-similarity Prediction Estimation <strong>of</strong> varianceResults Matter. Trust NAG.16


De-Nois<strong>in</strong>gTransform <strong>data</strong> <strong>in</strong>to <strong>wavelet</strong> doma<strong>in</strong>Apply threshold<strong>in</strong>g – suppress smallest coefficientsTransform backUse:DWT for efficient storage – SDWT to align with <strong>data</strong>De-noised <strong>data</strong> can help modell<strong>in</strong>g <strong>of</strong> underly<strong>in</strong>g structuree.g. Capobianco (1997) – <strong>analysis</strong> <strong>of</strong> Nikkei <strong>in</strong>dexDonoho and Johnstone (1998)Results Matter. Trust NAG.17


Identify<strong>in</strong>g Seasonality Apply SDWT to <strong>data</strong> Wavelet detail coefficients at a given level capture a particular range<strong>of</strong> frequencies Identify detail coefficients carry<strong>in</strong>g seasonal periodicity Filter out seasonal effectse.g. Gencay et al. (2001) for application to FX returnsResults Matter. Trust NAG.18


Self-similarityScalogram represents energy <strong>of</strong> series <strong>in</strong> the <strong>wavelet</strong> coefficientse.g. Jamdee and Los (2004) use Morlet <strong>wavelet</strong> CWT for <strong>analysis</strong> <strong>of</strong> <strong>in</strong>terestrate series and calculation <strong>of</strong> Hurst exponentPredictionApply backward look<strong>in</strong>g <strong>wavelet</strong> MRA to time seriesUse <strong>wavelet</strong> coefficients as <strong>in</strong>put to a neural network model forpredictione.g. Renaud et al. (2004)Results Matter. Trust NAG.19


Estimation <strong>of</strong> VarianceFor DWT coefficients wSDWT coefficients w s||2 2x || = || w || =||sw||2S<strong>in</strong>ce,2|| x || ∝ Var(x)The <strong>wavelet</strong> transform provides an alternative representation <strong>of</strong> thevariance (Percival, 1995)Results Matter. Trust NAG.20


Summary1) Wavelet transforms provide a rigorous framework for <strong>data</strong> <strong>analysis</strong><strong>in</strong> time and frequency2) <strong>S<strong>of</strong>tware</strong> implementations vary <strong>in</strong> their choices <strong>of</strong> transformdef<strong>in</strong>itions3) Wavelet <strong>analysis</strong> provides an important tool for determ<strong>in</strong><strong>in</strong>g thestructure <strong>of</strong> time series aris<strong>in</strong>g <strong>in</strong> f<strong>in</strong>anceResults Matter. Trust NAG.21

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!