[MATLAB] Local Correlation Tracking in Time Series


MG-MD-Loco_corr_scoresThe correlation is an important notion in many fields of research or applied science. There is plethora of practical processes that literally spews time-series, and often many at once. It gets more interesting (and more complicated) when we need to process multiple time-series.

Let a process produce two time-series that reflects its internal state. Suppose that the process runs normally if there is some relation between two time-series at any given moment. If this relation is broken at some instant, or for some short period of time, we can say that there is some fault (interpretation can vary depending on application).

This generic and simple example applies to many practical processes. In essence we track local correlations that should be close to 1 if the system runs normally, and lower value if this symmetry is broken.

In literature one can find many and sophisticated algorithms that performs correlation tracking. In this article we will present shortly a simple, yet effective, algorithm which robustly estimates correlation between two time-series. It can detect correlation in the presence of noise (to some level) and can track non-linear relationships.

The algorithm presented in [PDF] is based on local auto-covariance matrix comparison. The comparison is done via spectral decomposition of local auto-covariance matrices using Singular Valued Decomposition (SVD). The algorithm output is data-dependent and does not require many obscure and hard to tune parameters. It can also perform in online setup – processing the data as it arrives.

The algorithm has been implemented in MATLAB in two version – batch and online. The online version demonstrates the capability to track changes and reflect them in the local correlation score (needs to be adapted for online incoming data). We implemented exponential weighting of past time windows!

You can download the code [HERE].

This entry was posted in Uncategorized and tagged , , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *