From ripley at stats.ox.ac.uk  Tue May 23 19:21:35 2006
From: ripley at stats.ox.ac.uk (ripley at stats.ox.ac.uk)
Date: Tue, 23 May 2006 19:21:35 +0200 (CEST)
Subject: [Rd] bug in ccf (PR#8893)
Message-ID: <20060523172135.068AE24783@slim.kubism.ku.dk>

In time-aligning the two series there will be missing values, and you 
cannot compute a ccf for series with missing values, hence the problem.

ccf(x, y, na.action=na.contiguous) works.

I guess that using ts.intersect rather than ts.union would be a simple
workaround for this by automatically trimming the ends.


On Tue, 23 May 2006, KjetilBrinchmannHalvorsen at gmail.com wrote:

> This is R 2.3.0 from CRAN, windows XP.
>
> The following looks like a bug in ccf():
>
> > x <- ts(rnorm(100), start=1)
> > y <- ts(rnorm(120), start=3)
> > ccf(x,y)
> Erro en na.fail.default(ts.union(as.ts(x), as.ts(y))) :
>         missing values in object
> > ccf(x,y, na.action=na.pass)
> Erro en na.fail.default(as.ts(x)) : missing values in object
>
>
> > sessionInfo()
> Version 2.3.0 (2006-04-24)
> i386-pc-mingw32
>
> attached base packages:
> [1] "methods"   "stats"     "graphics"  "grDevices" "utils"
> "datasets"  "base"
>
> other attached packages:
>       zoo clim.pact     akima      ncdf
>   "1.0-6"   "2.2-1"   "0.5-1"     "1.5"
>
> Kjetil
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>
>

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



[Rd] bug in ccf (PR#8893)
ripley at stats.ox.ac.uk