8
$\begingroup$

I am using ccf to find a correlation between 2 time series. I am getting a plot that looks like that:

enter image description here

Note that I am mainly interested in correlation for the lag=0. Questions:

  1. Do interpret it correctly that there is a cross-correlation for the lag=0, as for this lag the cross-correlation is above the dotted line?
  2. How should I interpret the level of cross-correlation in this example, is this significant (as I interpret it right now, there is a small cross-correlation)?
  3. How can I extract only acf value for lag=0?
$\endgroup$
3
$\begingroup$

How can I extract only acf value for lag=0?

The acf at lag 0 ($\text{corr}(X_t,X_t)$) is always 1.

Do interpret it correctly that there is a cross-correlation for the lag=0, as for this lag the cross-correlation is above the dotted line?

If you mean "would I conclude the population cross-correlation is non-zero?" then yes, if that dotted line is for the same significance level as you would use (and the assumptions hold).

This doesn't actually imply that the population cross correlation is actually zero (that would seem astonishing). However, if the interval for it is quite tight around zero, it may sometimes be reasonable to treat it as if it were.

How should I interpret the level of cross-correlation in this example, is this significant (as I interpret it right now, there is a small cross-correlation)?

0.3 isn't necessarily small, that depends on your yardstick. In some applications it might be fairly large, in others moderate, in still others small.

$\endgroup$
  • $\begingroup$ Does this mean that the model cannot be validated, since there is a significant cross-correlation at lag 0? $\endgroup$ – Vam Dec 20 '16 at 7:52
6
$\begingroup$

Your interpretation of the plot is correct. The only significant cross-correlation at the $5\%$ level of significance is at lag zero. Thus, we cannot say that one variable leads the other variable (that is, we cannot foresee or anticipate the movements in one variable by looking at the other).

Both variables evolve concurrently. The correlation is positive, when one increases the other increases as well, and vice versa. The correlation is nonetheless not too strong (around $0.3$).

You can get the exact values of the cross-correlations simply by storing the output in an object and looking at the element acf.

res <- ccf(x, y, lag.max = 30)
res
# information stored in the output object
names(res)
[1] "acf"    "type"   "n.used" "lag"    "series" "snames"
res$acf
$\endgroup$
  • $\begingroup$ You might want to do something like data.frame(res$lag, res$acf) so that you can easily tell which lag each correlation applies to. $\endgroup$ – eipi10 Dec 28 '14 at 5:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.