Time Series Analysis DM 2 / A.A

Similar documents
CS490D: Introduction to Data Mining Prof. Chris Clifton

High Dimensional Data Mining in Time Series by Reducing Dimensionality and Numerosity

Time Series Analysis with R 1

Proximity and Data Pre-processing

Time series representations: a state-of-the-art

Similarity Search Over Time Series and Trajectory Data

The Curse of Dimensionality. Panagiotis Parchas Advanced Data Management Spring 2012 CSE HKUST

Knowledge Discovery in Databases II Summer Term 2017

Chapter 15. Time Series Data Clustering

CS570: Introduction to Data Mining

Data Mining: Data. Lecture Notes for Chapter 2. Introduction to Data Mining

HOT asax: A Novel Adaptive Symbolic Representation for Time Series Discords Discovery

A NEW METHOD FOR FINDING SIMILAR PATTERNS IN MOVING BODIES

CS 521 Data Mining Techniques Instructor: Abdullah Mueen

BUSINESS ANALYTICS. 96 HOURS Practical Learning. DexLab Certified. Training Module. Gurgaon (Head Office)

Symbolic Representation and Clustering of Bio-Medical Time-Series Data Using Non-Parametric Segmentation and Cluster Ensemble

Discovering Playing Patterns: Time Series Clustering of Free-To-Play Game Data

GEMINI GEneric Multimedia INdexIng

Data Mining: Data. What is Data? Lecture Notes for Chapter 2. Introduction to Data Mining. Properties of Attribute Values. Types of Attributes

Data Mining: Data. Lecture Notes for Chapter 2. Introduction to Data Mining

UNIT 2 Data Preprocessing

Data Mining and Analytics. Introduction

Data Preprocessing. Why Data Preprocessing? MIT-652 Data Mining Applications. Chapter 3: Data Preprocessing. Multi-Dimensional Measure of Data Quality

A Study of knn using ICU Multivariate Time Series Data

Further Maths Notes. Common Mistakes. Read the bold words in the exam! Always check data entry. Write equations in terms of variables

Finding Similarity in Time Series Data by Method of Time Weighted Moments

ABSTRACT. Data mining is a method of gathering all useful information from large databases. Data

By Mahesh R. Sanghavi Associate professor, SNJB s KBJ CoE, Chandwad

Drill-down Analysis with Equipment Health Monitoring

Data Preprocessing. Javier Béjar. URL - Spring 2018 CS - MAI 1/78 BY: $\

Data Preprocessing Yudho Giri Sucahyo y, Ph.D , CISA

Data Preprocessing. Data Mining 1

MINI-PAPER A Gentle Introduction to the Analysis of Sequential Data

Data Preprocessing. Javier Béjar AMLT /2017 CS - MAI. (CS - MAI) Data Preprocessing AMLT / / 71 BY: $\

Satellite Images Analysis with Symbolic Time Series: A Case Study of the Algerian Zone

CPSC 340: Machine Learning and Data Mining. Principal Component Analysis Fall 2016

Online Pattern Recognition in Multivariate Data Streams using Unsupervised Learning

Intro to ARMA models. FISH 507 Applied Time Series Analysis. Mark Scheuerell 15 Jan 2019

Preprocessing Short Lecture Notes cse352. Professor Anita Wasilewska

Accelerometer Gesture Recognition

ECLT 5810 Clustering

ECLT 5810 Clustering

SAS Publishing SAS. Forecast Studio 1.4. User s Guide

Ensemble of Specialized Neural Networks for Time Series Forecasting. Slawek Smyl ISF 2017

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

P-spline ANOVA-type interaction models for spatio-temporal smoothing

Reddit Recommendation System Daniel Poon, Yu Wu, David (Qifan) Zhang CS229, Stanford University December 11 th, 2011

K236: Basis of Data Science

SAS (Statistical Analysis Software/System)

Data Mining. Part 2. Data Understanding and Preparation. 2.4 Data Transformation. Spring Instructor: Dr. Masoud Yaghini. Data Transformation

ECLT 5810 Data Preprocessing. Prof. Wai Lam

University of Florida CISE department Gator Engineering. Data Preprocessing. Dr. Sanjay Ranka

Data Preprocessing. S1 Teknik Informatika Fakultas Teknologi Informasi Universitas Kristen Maranatha

Nearest Neighbor Classification. Machine Learning Fall 2017

Data Mining: Concepts and Techniques. (3 rd ed.) Chapter 3

Table Of Contents: xix Foreword to Second Edition

Data Preprocessing. Slides by: Shree Jaswal

Data Preprocessing. Data Preprocessing

IAT 355 Visual Analytics. Data and Statistical Models. Lyn Bartram

Mining of Massive Datasets Jure Leskovec, Anand Rajaraman, Jeff Ullman Stanford University Infinite data. Filtering data streams

Machine Learning / Jan 27, 2010

Overview of Clustering

Data Preprocessing. Komate AMPHAWAN

YADING: Fast Clustering of Large-Scale Time Series Data

Unified approach to detecting spatial outliers Shashi Shekhar, Chang-Tien Lu And Pusheng Zhang. Pekka Maksimainen University of Helsinki 2007

Contents. Foreword to Second Edition. Acknowledgments About the Authors

Spatial Outlier Detection

Data Mining: Concepts and Techniques. (3 rd ed.) Chapter 3. Chapter 3: Data Preprocessing. Major Tasks in Data Preprocessing

SOCIAL MEDIA MINING. Data Mining Essentials

Classification of Subject Motion for Improved Reconstruction of Dynamic Magnetic Resonance Imaging

Forecasting Video Analytics Sami Abu-El-Haija, Ooyala Inc

2. (a) Briefly discuss the forms of Data preprocessing with neat diagram. (b) Explain about concept hierarchy generation for categorical data.

Applications and Trends in Data Mining

DATA WAREHOUING UNIT I

Research Article Piecewise Trend Approximation: A Ratio-Based Time Series Representation

Statistical Pattern Recognition

Statistical Pattern Recognition

Hierarchical Piecewise Linear Approximation

Data Mining. Jeff M. Phillips. January 7, 2019 CS 5140 / CS 6140

Advance Process Control SECS/HSMS A/D. Recipe Process step Data quality NOVELLUS PECVD

Points Lines Connected points X-Y Scatter. X-Y Matrix Star Plot Histogram Box Plot. Bar Group Bar Stacked H-Bar Grouped H-Bar Stacked

Data Mining: Concepts and Techniques. (3 rd ed.) Chapter 3

8. Automatic Content Analysis

ECG782: Multidimensional Digital Signal Processing

ON SELECTION OF PERIODIC KERNELS PARAMETERS IN TIME SERIES PREDICTION

Efficient ERP Distance Measure for Searching of Similar Time Series Trajectories

Code No: R Set No. 1

BBS654 Data Mining. Pinar Duygulu. Slides are adapted from Nazli Ikizler, Sanjay Ranka

Mobility Data Management & Exploration

scikit-learn (Machine Learning in Python)

SYS 6021 Linear Statistical Models

Statistical Pattern Recognition

CS6220: DATA MINING TECHNIQUES

Robust Regression. Robust Data Mining Techniques By Boonyakorn Jantaranuson

General Instructions. Questions

Summary of Last Chapter. Course Content. Chapter 3 Objectives. Chapter 3: Data Preprocessing. Dr. Osmar R. Zaïane. University of Alberta 4

Fast trajectory matching using small binary images

2. Data Preprocessing

3. Multidimensional Information Visualization II Concepts for visualizing univariate to hypervariate data

Chapter 7: Numerical Prediction

Transcription:

DM 2 / A.A. 2010-2011 Time Series Analysis Several slides are borrowed from: Han and Kamber, Data Mining: Concepts and Techniques Mining time-series data Lei Chen, Similarity Search Over Time-Series Data Past, Present and Future

Contents Basics Simple trends models & cycles ARIMA TS similarity Regression, seasonal and cyclic variations Autocorrelation models Time series & preprocessing methods Euclidean, DWT, EDR, ERP Patterns (Motifs)

Time Series Data and Applications A time series is an ordered sequence of data values at consecutive timestamps financial stock data sensory data trajectory of moving objects video data 3

Properties of Time Series Data Time series data Temporal data correlation High dimensionality Containing repeated patterns 4

A time series can be illustrated as a time-series graph which describes a point moving with the passage of time 5

Need for normalization Values and times can be differently shifted in each TS Normalize the time series before using them (e.g., measuring the distance) Other variations (e.g., acceleration and deceleration along the time axis) need other solutions see later (Goldin and Kanellakis, 1995)

Moving Average Moving average of order n Smoothes the data Eliminates cyclic, seasonal and irregular movements (see later) Loses the data at the beginning or end of a series Sensitive to outliers (can be reduced by weighted moving average) 7

Application - Detrending Obtain the trend for irregular data series Subtract trend Reveal oscillations trend 8

Contents Basics Simple trends models & cycles ARIMA TS similarity Regression, seasonal and cyclic variations Autocorrelation models Time series & preprocessing methods Euclidean, DWT, EDR, ERP Patterns (Motifs)

What is Regression? Modeling the relationship between one response variable and one or more predictor variables Analyzing the confidence of the model E.g., height vs. weight 10

Regression Yields Analytical Model Discrete data points Analytical model General relationship Easy calculation Further analysis Application - Prediction 11

Linear Regression - Single Predictor w1 Model is linear y: response variable y = w0 + w1 x where w0 (y-intercept) and w1 (slope) are regression coefficients Method of least squares: D w1 = ( x i =1 i x )( yi y) D ( x i =1 i x) 2 w0 x: predictor variable w = y w x 0 1 12

Linear Regression Multiple Predictor Training data is of the form (X1, y1), (X2, y2),, (X D, y D ) E.g., for 2-D data or y y = w0 + w1 x1+ w2 x2 Solvable by Extension of least square method x2 (XTX ) W=Y W = (XTX ) -1Y Commercial software x1 (SAS, S-Plus, etc.) 13

Nonlinear Regression with Linear Method Polynomial regression model E.g., y = w + w x + w x2 + w x3 0 1 2 3 Let x2 = x2, x3= x3 y = w0 + w1 x + w2 x2 + w3 x3 Log-linear regression model E. g., y = exp(w + w x + w x + w x ) 0 1 2 2 3 3 Let y =log(y) y = w0 + w1 x + w2 x2 + w3 x3 14

Categories of Time-Series Movements Categories of Time-Series Movements Long-term or trend movements (trend curve): general direction in which a time series is moving over a long interval of time Cyclic movements or cycle variations: long term oscillations about a trend line or curve Seasonal movements or seasonal variations e.g., business cycles, may or may not be periodic i.e, almost identical patterns that a time series appears to follow during corresponding months of successive years. Irregular or random movements Time series analysis: decomposition of a time series into these four basic movements Additive Modal: TS = T + C + S + I Multiplicative Modal: TS = T C S I 15

Estimation of Trend Curve The freehand method Fit the curve by looking at the graph Costly and barely reliable for large-scaled data mining The least-square method Find the curve minimizing the sum of the squares of the deviation of points on the curve from the corresponding data points 16

Trend Discovery in Time-Series: Estimation of Seasonal Variations Seasonal index Set of numbers showing the relative values of a variable during the months of the year E.g., if the sales during October, November, and December are 80%, 120%, and 140% of the average monthly sales for the whole year, respectively, then 80, 120, and 140 are seasonal index numbers for these months Deseasonalized data Data adjusted for seasonal variations for better trend and cyclic analysis Divide the original monthly data by the seasonal index numbers for the corresponding months 17

Seasonal Index 160 Seasonal Index 140 120 100 80 60 40 20 0 1 2 3 4 5 6 7 8 9 10 11 12 Month Raw data from http://www.bbk.ac.uk/manop/man/docs/qii_2_2003%20time%20series.pdf April 13, 2011 Data Mining: Concepts and Techniques 18

Trend Discovery in Time-Series Estimation of cyclic variations Estimation of irregular variations If (approximate) periodicity of cycles occurs, cyclic index can be constructed in much the same manner as seasonal indexes By adjusting the data for trend, seasonal and cyclic variations With the systematic analysis of the trend, cyclic, seasonal, and irregular components, it is possible to make long- or short-term predictions with reasonable quality 19

Contents Basics Simple trends models & cycles ARIMA TS similarity Regression, seasonal and cyclic variations Autocorrelation models Time series & preprocessing methods Euclidean, DWT, EDR, ERP Patterns (Motifs)

Autocorrelation Correlation of a time series with itself Similarity between each pair of observations as a function of the time separation between them Not so easy to see from the data Original time series Correlogram (ACF vs. Time lag)

ARIMA [Box and Jenkins (1976)] Autoregressive integrated moving average Complex model that includes two processes Element 1: Autoregressive process You can estimate coefficients that describe consecutive elements of the series from previous elements: x(t) = c + a1*x(t-1) + a2*x(t-2) +... + ε observations made of a random error component and linear combination of prior observations

ARIMA / 2 Element 2: Moving average process each element in the series can also be affected by the past error (beside autoregressive components): x(t)= µ + εt b1*εt - 1 b2*εt - 2 b3*εt - 3 - observations made of a random error component and a linear combination of prior random shocks

Contents Basics Simple trends models & cycles ARIMA TS similarity Regression, seasonal and cyclic variations Autocorrelation models Time series & preprocessing methods Euclidean, DWT, EDR, ERP Patterns (Motifs)

Similarities for TS Several DM tasks are based on similarities Clustering compare the whole TS to form groups Patterns compare segments of TS KNN Classification compare whole TS to labeled data TS are generally different from vector data Dimension is variable Correspondance between elements can be flexible (S[i] might be compared against T[j], i j)

Popular Distance Measures Lock-step Measure (one-to-one) o Minkowski Distance L1 norm (Manhattan Distance) L2 norm (Euclidean Distance) L norm (Supremum Distance) Elastic Measure (one-to-many/one-to-none) o o Dynamic Time Warping (DTW) Edit distance based measure (Ding et al., 2008) Longest Common SubSequence (LCSS) Edit distance with Real Penalty (ERP) Edit Sequence on Real Sequence (EDR)

Similarity Measures Without Warping Euclidean distance Given R = <r1, r2,, rn> and S = <s1, s2,, sn> R r1 r2 rn Lp-norm distance S s1 s2 27 sn

Similarity Measures With Warping The distance function allows the matching between two time series on warping positions R r1 r2 r3 rm S s1 s2 sn 28

Similarity Measures With Warping (cont'd) Dynamic Time Warping (DTW) r1 r2 rm R r1 r2 r3 rm r1 r2 r3 rm S s1 s2 case 1 sn s1 s2 sn s1 s2 case 2 case 3 29 sn

Similarity Measures With Warping (cont'd) Longest Common Subsequences (LCSS) r1 r2 rm r1 r2 r3 R ε >ε rm r1 r2 r3 >ε rm S s1 s2 case 1 sn s1 s2 sn s1 s2 case 2.1 case 2.2 30 sn

Similarity Measures With Warping (cont'd) Edit distance with Real Penalty (ERP) r1 r2 rm R dist(r1,s1) r1 r2 r3 dist(r1,g) rm dist(s1,g) sn r1 r2 r3 rm S s1 s2 case 1 sn s1 s2 s1 s2 case 2 case 3 31 sn

Similarity Measures With Warping (cont'd) Edit Distance on Real sequence (EDR) r1 r2 rm r1 r2 r3 R subcost rm 1 r1 r2 r3 rm 1 S s1 s2 case 1 sn s1 s2 sn s1 s2 case 3 case 2 32 sn

(Ding et al., 2008) Comparison of Distance Measures

Dimensionality Reduction Since the dimensionality of time series is usually high, problems can arise Similarity computations become expensive dimensionality curse: query performances on multidimensional indexes degrades dramatically with the increasing dimensionality y value dimensionality reduction 1 time 100 a time series with dimensionality 100 O a 2D reduced data point x a 2-dimensional reduced space 34

Dimensionality Reduction Dimensionality reduction techniques: Singular Value Decomposition (SVD) Discrete Fourier Transform (DFT) Discrete Wavelet Transform (DWT) Piecewise Aggregate Approximation (PAA) Piecewise Linear Approximation (PLA) Adaptive Piecewise Constant Approximation (APCA) Chebyshev Polynomials (CP) 35

Discrete Fourier Transform (DFT) Transform time series data from the time domain to frequency domain xt time series data at timestamp t (0 t n - 1) Xf transformed data DFT: Keep only the first k components 36

Contents Basics Simple trends models & cycles ARIMA TS similarity Regression, seasonal and cyclic variations Autocorrelation models Time series & preprocessing methods Euclidean, DWT, EDR, ERP Patterns (Motifs)

Motifs Patterns over a set of temporal sequences that for certain periods of time reflect a similar and/or a symmetric tendency Corresponding intervals can be different in each TS Based on any time series similarity notion Given the similarity function between two subsequences X and Y, sim(x,y), X matches Y if sim(x; Y ) > R where R is a user supplied positive real number

Motifs example Sample pattern / motif Blue-Green & Blue-Red segments correspond Variants can consider also Green-Red segs.

Motifs Given a database of time series D a minimum support minsupp and a minimum value of similarity/correlation Rmin a set S of subsequences (taken from D) form a (approximate) motif, if S > minsupp For all pairs (X,Y) from S, sim(a,b)> Rmin

Motif extraction algorithms Often they are based on simplified representations of the data, in order to improve performances Dimensionality reduction techniques Discretization of the TS SAX representation of time series

SAX: Symbolic Aggregate approximation Dim. Reduction/Compression Symbolic Aggregate approximation SAX : ℝ SAX : ccbaabbbabcbcb Essentially an alphabet over the Piecewise Aggregate Approximation (PAA) rank Faster, simpler, more compression, yet on par with DFT, DWT and other dim. reductions 42

SAX Illustration 43

SAX Algorithm Parameters: alphabet size, word (segment) length (or output rate) 1. Select probability distribution for TS 2. z-normalize TS 3. 4. 5. PAA: Within each time interval, calculate aggregated value (mean) of the segment Partition TS range by equal-area partitioning the PDF into n partitions (eq. freq. binning) Label each segment with arank for aggregate s corresponding partition rank 44

Finding Motifs in a Time Series EMMA Algorithm: Finds motifs of fixed length n SAX Compression (Dim. Reduction) Possible to store D(i,j) (i,j) Allows use of various distance measures (Minkowski, Dynamic Time Warping) Multiple Tiers Tier 1: Uses sliding window to hash length-w SAX subsequences (aw addresses, total size O(m)). Bucket B with most collisions & buckets with MINDIST(B) < R form neighborhood of B. Tier 2: Neighborhood is pruned using more precise ADM algorithm. Ni with max. matches is 1-motif. Early stop if ADM matches > maxk>i ( neighborhoodk ) 45