Meaning of a lag in time-series and autocorrelation

Hi everyone,
I know this might be a very naive question, but I am very new to time series analysis and all of a sudden I have been forced to understand a lot of unfamilair stuff
My first question is "what is the meaning of a lag (how do you define) in time-series data?"
My second question is,
I have a series of data like below
time(femtoseconds) distance (Angstrom)
0 15.769
100 16.160
200 15.571
300 15.816
400 15.702
...... ......
...... ......
49990 15.907
I want to find the time at which the distance data is NOT correlated to itself (I guess that is what they call as data being "stationary"). Could anyone of you please tell me how to find that point in time using Matlab?
Thank you very much
Sajeewa Dewage

Answers (1)

I guess you'd call xcorr() and plot it and see when the plot "levels out". Did you try that?

3 Comments

Hi Image Analyst,
Yes I tried both xcorr(distance) and xcorr(distance,'biased') both of them produce 10000 points (I have 5000 distances). There is a linear increase from near zero to a huge value (which occurs at 5000th time point) and a symmetric linear decrease back to zero at 10000th point. The whole graph is an isosceles triangle. I don't know what I should make out of this. Does this mean that the whole data set does not acheive stationarity at any point?
Thank you
Sajeewa Dewage
Of course it's going to be twice as long. That's what you expect. If you don't know why, then review how correlation works. If it looks like an isosceles triangle, then your data is just uniform, because the correlation of a box with a box is a triangle.
This is what you might expect. The correlation at lag=0 is always perfect [the correlation of x(t) vs x(t)]. Try using the 'coeff' option in xcorr.

Sign in to comment.

Asked:

on 18 May 2013

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!