On 11/28/2006 12:50 PM, [EMAIL PROTECTED] wrote: > On 11/28/2006 11:50 AM, A.I. McLeod wrote: >> Hi Duncan, > > Hi Ian. > >> >> ccf(x,y) does not explain whether c(k)=cov(x(t),x(t+k)) or >> d(k)=cov(x(t),x(t-k)) is calculated. The following example demonstrates >> that the c(k) definition is used: >> ccf(c(-1,1,rep(0,8)),c(1,rep(0,9))) >> However S-Plus acf uses the d(k) definition in their acf function. > > I don't think our code looks right, let alone our documentation. In > both R-devel and R-patched I get a lag zero value of 1 from ccf(), and I > think I should get cor(x,y), which in your example, would be -0.74: and > that is what I get from 2.4.0. > > I hope this isn't a result of my patch to allow length 1 series...
It was. I'll commit a patch to my patch soon, and clarify the docs at the same time. Duncan Murdoch ______________________________________________ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel