Similarity Search on Time Series Data

13 downloads 87745 Views 496KB Size Report
Figures taken from: “A comparison of DFT and DWT based similarity search in Time- ... L2 distance of two signal in time domain is same as their L2 distance in ...
Similarity Search on Time Series Data Presented by Zhe Wang

Motivations z

Fast searching for time-series of real numbers. (“data mining”) z

Scientific database: weather, geological, astrophysics, etc. “find past days in which solar wind showed similar pattern to today’s”

z

Financial, marketing time series: “Find past sales patterns that resemble last month”

Real motivation?

Difficulties for time-series data z

Can’t use exact match like fast string match: z

z

Need to use distance function to compare two time series (next slide)

Can’t easily index the time-series data directly. z

Need faster algorithm than linear scan (whole talk)

Distance functions z

L-p distance function D(x,y) = ( ∑|xi – yi|p )1/p

z

L-2 distance function (Most popular) D(x,y) = ( ∑(xi - yi)2 )1/2

z

Finding similar signals to query signal q means finding all x such that: D(q,x) = ( ∑(qi - xi)2 )1/2 || xt – yt ||2 = || Xf – Yf ||2 L2 distance of two signal in time domain is same as their L2 distance in frequency domain

z

z

No false dismissal if we just use first few parameters. But also do not want too many false hits

Different time series data Energy distribution Example in O(fb) O(f0) Totally independent White noise time series Pink noise O(f -1) Musical score, work of art O(f -2) Stock movement, Brown noise (Brownian walks) exchange rates Black noise O(f -b) b > 2 Water level of river vs time Type

Building Index z

z

When the signal is not white noise, we can use first few DFT parameter to capture most of the “energy” of the signal Let Q to be the query time-series data: ∑first_few_freq (qf - xf )2 = kω, split q into k pieces, and search DB with ε/(k1/2), join the results.

Multi-resolution index z z

z

Base-2 MR index structure Take ω as base unit, build index for each window size of 2iω. Basic algorithm: Longest Prefix Search (LPS) Eg: if query length = 19ω use 16ω as the prefix to do search.

Index structure layout

Figure taken from: “Optimizing similarity search for arbitrary length time series queries” (also figures on three slides)

Improved algorithm z z

z

Split q into q1q2…qt, where |qi|= 2Ci Eg: Given |q| = 208 = 16 + 32 + 128 q1

q2

q3

16

32

128

Given ε = 0.6, query example shown in the next slide

Performance on 556 stocks (again)

Summary z

z

z

z

Harr DWT and DFT performs similar in feature extraction for stock data. Start monitor stock now! (All of these papers use stock data + synthetic data) Time series data is hard to optimize for similarity search. All these paper are focused on “no false dismissal”, approximation might help. (Some research done.)

Related papers z z z z z z

Tamer Kahveci and Ambuj K. Singh. Optimizing Similarity Search for Arbitrary Length Time Series Queries R. Agrawal, C. Faloutsos, and A. Swami, Efficient Similarity Search in Sequence Databases. K.-P. Chan and A.W.-C. Fu, Efficient Time Series Matching by Wavelets. C Faloutsos, M Ranganathan, Y Manolopoulos, Fast subsequence matching in time-series databases D. Rafiei and A. Mendelzon, Efficient Retrieval of Similar Time Sequences using DFT YL Wu, D Agrawal, A Abbadi A comparison of DFT and DWT based similarity search in Time-series Databases

Orthonormal transform z

Matrix Ο is known as orthonormal if it satisfy the orthonormality property:

From: http://www.math.iitb.ac.in/~suneel/final_report/node15.html