[R] CCF for hourly time series?

Katharina Appel KAJOAP at gmx.de
Wed Aug 12 16:15:36 CEST 2009


Hello,

I have a dataframe containing various time series (not time series objects though!)with hourly time steps. I´d like to perform ccf for I need to know the correlation factors for different lags. 
Here is an example:

x<-as.POSIXct(c("2008-12-25 16:00:00", "2008-12-25 17:00:00", "2008-12-25 18:00:00", "2008-12-25 19:00:00", "2008-12-25 20:00:00","2008-12-25 21:00:00"))
y<-c(NA, 1.5,3,7, 1, 0.1)
z<-c(0.3,0.35,0.7,0.72,0.72,0.8)
x<-as.data.frame(x)
prec<-cbind(x,y)
theta<-cbind(x,z)
 ccf(ts(mat1[,4]),ts(mat1[,j]),lag.max=24,type='correlation',na.action=na.pass)


that gives me "error in na.fail.default(as.ts(x)):missing values in object"
In order to create the data frame I already intersected different time series so I know that the timeindex is the same for all rows and missing values were replaced by NA. 
Does that already impede creating a ts-object? 
Is there another possibility to perform the cross-correlation?

Thanks in advance,
Katharina
-- 
___________________
Katharina Appel
Große Weinmeisterstraße 30
14469 Potsdam

Tel.: 0331-2370828
e-mail: Kajoap at gmx.de

Jetzt kostenlos herunterladen: Internet Explorer 8 und Mozilla Firefox 3 -
sicherer, schneller und einfacher! http://portal.gmx.net/de/go/atbrowser




More information about the R-help mailing list