Problem with cross correlation - xcorr



Hi All!

I am having a problem with the output from xcorr, as it doesn't give me what I am expecting.

I have two time series, which have been generated by a mathematical population model, where each series corresponds to the density of each population over time. These time series are oscillating and are completely out of phase, i.e. when one peaks the other is at a trough
and vice verse.

I analyse these time series in the following way:
[r, lags]=xcorr(M(:,1),M(:,2),25);
plot(lags,r)
where M is a matrix that contains the two time series and 25 is the max time lag.

From the plot that I get the most dominant lag is a zero, which is clearly wrong! It should be about 15. Also there is a sharp discontinuity at zero (shouldn't this be smooth?).

Can anybody help?

Thanks,
Steven.
.



Relevant Pages

  • Re: data signal
    ... to get 10 cycles at some frequency would require the length of the time series to be the proper length to match. ... It isn't at all clear what it is you're driving at here -- now that you're beginning to get some familiarity w/ the nuts and bolts of Matlab, you need to figure out what it is you're really after -- is it a randomly changing frequency, a random distribution of on/off time periods, what... ... I didn't really expect what you tried to be what you expected, but I don't have enough of a picture of what you're expecting to tell you how to proceed at this point... ...
    (comp.soft-sys.matlab)
  • Re: RM ANOVA and other methods
    ... I could use 1 2-way Repeated Measures ANOVA to analyse the data, ... here in the context of one-way ANOVA, ... It sounds like you are expecting a significant quadratic trend. ...
    (sci.stat.edu)
  • Re: Time series analysis, delay coordinate embedding, phase (state) space reconstruction
    ... > I am trying to analyse a time series using the delay coordinate ... > embedding. ...
    (sci.nonlinear)
  • Time series analysis, delay coordinate embedding, phase (state) space reconstruction
    ... I am trying to analyse a time series using the delay coordinate ... embedding. ...
    (sci.nonlinear)
  • Re: Is my financial model guessing or predicting the right sign of the price changes?
    ... The model provides a certain *theoretical time series* ... If you're doing linear prediction there is an underlying assumption that the financial data is Gaussian. ... So you may be just expecting too much from your predictor. ...
    (sci.stat.math)

Loading