Re: [Rd] ccf documentation bug or suggeston (PR#9394)

From: <>
Date: Tue 28 Nov 2006 - 20:39:49 GMT

On 11/28/2006 12:50 PM, 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 mailing list Received on Wed Nov 29 07:44:43 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Tue 28 Nov 2006 - 21:30:52 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.