You are on page 1of 28

Intelligent Data Engineering and Automated Learning - IDEAL 2004 5th International Conference, Exeter, UK

Wavelet Multi-resolution Analysis of High Frequency FX Rates


Department of Computing University of Surrey, Guildford, UK August 27, 2004

Talk Outline
q q q q

Describing Time Series Data Financial Time Series Data Characteristics Wavelet Multiscale Analysis Our Time Series Analysis Approach - Algorithms - Prototype System - Case Study - Conclusions Questions

What Is a Time Series?


A chronologically arranged sequence of data on a particular variable q Obtained at regular time interval q Assumes that factors influencing past and present will continue
q

U.S. Retail Sales


Quarterly Data
450 400 Sales (Billions) 350 300 250 200 83 84 85 Year 86 87

Time Series Components


Trend Seasonal TS Data Irregular Cyclical

Trend Component
Indicates the very long-term behavior of the time series q Typically as a straight line or an exponential curve q This is useful in seeing the overall picture
q

Cyclical Component
q

A non-seasonal component which varies in a recognizable period


q q q q

Peak Contraction Trough Expansion

Time

q q

Due to interactions of economic factors The cyclic variation is especially difficult to forecast beyond the immediate future more of a local phenomenon

Seasonal Component
q

Regular pattern of up and down fluctuations within a fixed time

Time

q q

Due to weather, customs etc. Periods of fluctuations more regular, hence more profitable for forecasting

Irregular Component
Random, unsystematic, residual fluctuations q Due to random variation or unforeseen events q Short duration and non-repeating q A forecast, even in the best situation, can be no closer (on average) than the typical size of the irregular variation
q

Time Series Data Broken-Down*


TS Data Trend Cyclic Behavior Seasonal Index Irregular

*For illustration purposes only.

Financial Time Series Data Characteristics


q q

Evolve in a nonlinear fashion over time Exhibit quite complicated patterns, like trends, abrupt changes, and volatility clustering, which appear, disappear, and re-appear over time nonstationary There may be purely local changes in time domain, global changes in frequency domain, and there may be changes in the variance parameters

Financial Time Series Data Characteristics


585 545

IBM Prices

505 465 425 385 345 305 0.1 1

Nonstationary

26

51

76

101

126

151

176

201

226

251

276

301

326

351

IBM Volatility

0.08

0.06

0.04

Time Varying Volatility

0.02

0 1 26 51 76 101 126 151 176 201 226 251 276 301 326 351

Financial Time Series Data Characteristics


Having said that
q

The nonlinearities and nostationarities do contain certain regularities or patterns Therefore, an analysis of nonlinear time series data would involve quantitatively capturing such regularities or patterns effectively

How and Why?

Wavelet Multiscale Analysis


Overview
q

Wavelets are mathematical functions that cut up data into different frequency components and then study each component with a resolution matched to its scale Wavelets are treated as a lens that enables the researcher to explore relationships that were previously unobservable Provides a unique decomposition (deconstruction) of a time series in ways that are potentially revealing

Wavelet Multiscale Analysis


Step I: Take a wavelet and compare it to a section at the start of the
original signal. Calculate C to measure closeness (correlation) of wavelet with signal

Signal

Wavelet

C = C1

Wavelet Multiscale Analysis


Step II: Keep shifting the wavelet to the right and repeating Step I until
whole signal is covered

Signal

Wavelet

C = C2

Wavelet Multiscale Analysis


Step III: Scale (stretch) the wavelet and repeat Steps I & II Signal

Wavelet

C = C3

Step IV: Repeat Steps I to III for all scales

Wavelet Multiscale Analysis


Filter Bank Approach
Discrete Convolution: The original signal is convolved with a set of
high or low pass filters corresponding to the prototype wavelet

w* xt = wi xt i i=
Xt Original Signal W High or low pass filters

Wavelet Multiscale Analysis


Filter Bank Approach
H: Bank of High Pass filters

Iteration gives scaling effect at each level Xt


H Level 1 H

H (f) Xt G (f)

H* (f)

D1
L

G* (f)

Frequency

G: Bank of Low Pass filters

A1 A1

D1
Level 2

Xt = A1 + D1

A2
L L

D2
Level 3

Xt = A2 + D1+ D2

H (f) high-pass decomposition filter H* (f) high-pass reconstruction filter G (f) low-pass decomposition filter G* (f) low-pass reconstruction filter Up arrow with 2 upsampling by 2 Down arrow with 2 downsampling by 2

A3

D3

Xt = A3 + D1+ D2 + D3

Level N Xt = AN + D1+ D2 + DN

Mallats Pyramidal Filtering Approach

Wavelet Multiscale Analysis


FTSE 100
3.0E+ 05 2.5E+ 05 2.0E+ 05 1 .5E+ 05 1 .0E+ 05 5.0E+ 04 0.0E+ 00 3.0E+ 06 5.0E+ 01 4.8E+ 03 4.6E+ 03 4.4E+ 03 4.2E+ 03 4.0E+ 03 3.8E+ 03

Wavelet Decompositions

FFT (FTSE) FFT (1)

5.2E+ 03 5.0E+ 03

3.5E+ 05

Level - 3

2.5E+ 06 2.0E+ 06 1 .5E+ 06 1 .0E+ 06 5.0E+ 05 0.0E+ 00 3.0E+ 06

0.0E+ 00 -5.0E+ 01 -1 .0E+ 02 -1 .5E+ 02 2.5E+ 02

Level - 2

1 .5E+ 02 5.0E+ 01 -5.0E+ 01 -1 .5E+ 02 8.9E+ 01

2.0E+ 06 1 .5E+ 06 1 .0E+ 06 5.0E+ 05 0.0E+ 00 3.5E+ 05 3.0E+ 05 2.5E+ 05 2.0E+ 05 1 .5E+ 05 1 .0E+ 05 5.0E+ 04 0.0E+ 00

Level - 1

3.9E+ 01 -1 E+ .1 01 -6.1 01 E+ -1 E+ .1 02

FFT (2)

2.5E+ 06

Fourier Power Spectrum

FFT (3)

Analyzing High-frequency Financial Data: Our Approach


Preprocessing Data Compression Transformation Multiscale Analysis Knowledge Discovery Forecast Summarization Prediction

Tick Data

Aggregate the movement in the dataset over a certain period of time

Use the DWT to deconstruct the series

Describe market dynamics at different scales (time horizons) with chief features

Use the extracted chief features to predict

Cycle Trend Turning Points Variance Change

Analyzing High-frequency Financial Data: Our Approach


Generalized Algorithm: Summarization
I. Compress the tick data to get Open (O), High (H), Low (L) and Close (C) value for a given compression period (for example, one minute or five minutes). Calculate the level L of the DWT needed based on number of samples N in C of Step I, L = floor [log (N)/log (2)]. III. III-1. III-2. III-3. IV. V. Perform a level-L DWT on C based on results of Step I and Step II to get, Di, i = 1, . . ., L, and AL. Compute trend by performing linear regression on AL. Extract cycle (seasonality) by performing a Fourier power spectrum analysis on each Di and choosing the Di with maximum power as DS. Extract turning points by choosing extremas of each Di. Locate a single variance change in the series by using the NCSS index on C. Generate a graphical and verbal summary for results of Steps III-1 to III-3 and IV. II.

Analyzing High-frequency Financial Data: Our Approach


Generalized Algorithm: Prediction
I. II. Summarize the tick data using the time series summarization algorithm. For a N-step ahead forecast, extend the seasonal component DS symmetrically N points to the right to get DS,forecast . For a N-step ahead forecast, extend the trend component AN linearly N points to the right to get AN,forecast . Add the results of Steps II and III to get an aggregate N-step ahead forecast, forecast Forecast = DS,forecast + AN,forecast .

III.

IV.

Analyzing High-frequency Financial Data: Our Approach


A prototype system has been implemented that automatically extracts chief features from a time series and give a prediction based on the extracted features, namely trend and seasonality
Raw Signal

Volatility

DWT

Detect Turning Points and Trends

Summarization

Prediction

DWT

FFT

Detect Inherent Cycles

Statistic NCSS

Detect Variance Change

Analyzing High-frequency Financial Data: Our Approach


A Case Study
Consider the five minutes compressed tick data for the /$ exchange rate on March 18, 2004

1 .0
Input Data
1 .8 4

0 .8 0 .6 0 .4 0 .2
System Output System Output

1 .8 3

0 .0 0
Feature Trend Phrases 1st Phase 2nd Phase Turning Points Downturns Upturns Location Period Peaks at Details
Trend = 6.36e - 5 t + 1.81, t < 260 x1 xTrend = 3.65e - 6 t + 1.83, 261 < t < 288 2

2 5 5 0 7 5 1 0 01 2 51 5 01 7 52 0 02 2 52 5 02 7 5

1 .8 3

1 .8 2

108, 132, 164, and 178 5, 12, 20 36, 68, and 201 164 42 21, 54, 117, 181, 215, and 278

1 .8 2 0 2 5 5 0 7 5 1 0 01 2 51 5 01 7 52 0 02 2 52 5 02 7 5

Variance Change Cycle

Analyzing High-frequency Financial Data: Our Approach


A Case Study
For prediction, we use the chief features of the previous day (March 18, 2004), information about the prediction dominant cycle and trend (summarization), to reproduce the elements of the series for the following day (March 19, 2004):
Actual March 19, 2004

1 .8 3 1 .8 3 1 .8 3 1 .8 2 1 .8 2 0 25 50 75

Predicted (seasonal + trend) March 19, 2004

System Output

100 125 150 175 200 225 250

Root Means Square Error = 0.0000381 Correlation = + 62.4 %

Analyzing High-frequency Financial Data: Our Approach


Conclusions
I. We have presented a time series summarization, annotation, and prediction framework based on the multiscale wavelet analysis to deal with nonstationary, volatile and high frequency financial data Multiscale analysis can effectively deconstruct the total series into its constituent time scales: specific forecasting techniques can be applied to each timescale series to gain efficiency in forecast Results of experiments performed on Intraday exchange data show promise for summarizing and predicting highly volatile time series Continuously evolving and randomly shocked economic systems demand for a more rigorous and extended analysis, which is being planned analysis Successful analysis of agents operating on several scales simultaneously and of modeling these components could result in more exact forecasts

II.

III. IV. V.

Questions / Comments

You might also like