similar to: How does ccf() really work?

Displaying 20 results from an estimated 90 matches similar to: "How does ccf() really work?"

2012 Jun 07
0
na.pass option in ccf function
Hi everyone, I have been working with the ccf function recently, and in particular to do my calculations I have been using "na.action = na.pass". I noticed that the help documentation mentions that with this option the computed estimate may not be a valid autocorrelation sequence and was wondering if anyone could clarify what this means. In particular, the example below gives
2008 May 08
1
significance threshold in CCF
Hi everyone, When the CCF between two series of observations is plotted in R, a line indicating (presumably) the significance threshold appears across the plot. Does anyone know how this threshold is determined (it is different for each set of series) and how its value can be extracted from R? I've tried saving the CCF into an object and unclassing the object, but there's nothing there to
2002 Jun 11
1
extra 0 in ccf
im using R 1.5.0 on redhat. when i use ccf in the ts library i get, what i think is, an incorrect entry in the lag and acf components. as an example, look at the second entry in the lag and acf components below: > library(ts) > tmp <- ccf(ts(rnorm(3)),ts(rnorm(3)),plot=F) > tmp$lag , , 1 [,1] [1,] -1 [2,] 0 [3,] 0 [4,] 1 > tmp$acf , , 1 [,1] [1,]
2006 Sep 15
1
"ccf versus acf"
I am trying to run a cross-correlation using the "ccf()" function. When I select plot = TRUE in the ccf() I get a graph which has ACF on the y-axis, which would suggest that these y-values are the auto-correlation values. How should I adjust the code to produce a plot that provides the cross-correlation values? Here is my code: w002dat <-
2007 Mar 29
1
ccf time units
Hi, I am using ccf but I could not figure out how to calculate the actual lag in number of periods from the returned results. The documentation for ccf says:"The lag is returned and plotted in units of time". What does "units of time" mean? For example: > x=ldeaths > x1=lag(ldeaths,1) > results=ccf(x,x1) > results Autocorrelations of series 'X', by lag
2009 Apr 20
2
Cross-Correlation function (CCF) issues
Dear all, I have two series of returns and I want to find the cross-correlations between these two series. I know of the ccf, but it does not work as I'd like if i type ccf(x,y,lag.max=20,type="correlation",plot=FALSE) i got the error message Error in na.fail.default(ts.intersect(as.ts(x), as.ts(y))) : missing values in object So i found that somebody suggested to type
2009 Jul 03
0
A fast version of ccf () accepting missing values ?
Dear R-Helpers, I need to compute cross-correlation on two signals wich may contain missing values. One cannot pass "Na.action=na.pass" to the ccf() function. So, I wrote a naive function of my own (see below). Unsurprisingly, this function is not very fast. Do you think that it is possible to do better, or should I accept my fate ? Bruno. my_ccf <- function (X, Y,
2010 Apr 13
0
ccf problem (cross-correlation)
Hi all, I have a problem concerning my understanding of the cross-correlation (ccf) function in R. assume a time serie as: > t<-seq(0,6.28,by=0.01); > my_serie<-ts(sin(t),start=0,end=6.28,deltat=0.01) then I generate an other one shifted by 12 time points: > my_shifted_serie<-ts(sin(t),start=0+0.12,end=6.28+0.12,deltat=0.01) if I do the cross-correlation I get that the two
2010 Apr 26
1
Why am I getting different results from cor VS ccf ?
Hi all, I am getting different results from ccf and cor, Here is a simple example: set.seed(100) N <- 100 x1 <- sample(N) x2 <- x1 + rnorm(N,0,5) ccf(x1,x2)$acf[ccf(x1,x2)$lag == -1] cor(x1[-N], x2[-1]) Results: > ccf(x1,x2)$acf[ccf(x1,x2)$lag == -1] [1] -0.128027 > cor(x1[-N], x2[-1]) [1] -0.1301427 Thanks, Tal ----------------Contact
2010 Jul 14
1
ccf function
Hello, I am a very new R user and not a statistician so please excuse any over explanation, I'm just trying to be as clear as possible. I have performed a cross correlation of two time series (my columns) in a single data setusing: ccf(ts(A[rows,columnX]),(A[rows,columnY]), lag=NULL, type="correlation",plot=F) I?am able to get the results (for example): Autocorrelations of
2011 Jan 19
2
CCF and missing values.
Hi, I have missing values in my time series. "na.action = na.pass" works for acf and pacf. Why do I get the following error for the ccf? > ts(matrix(c(dev$u[1:10],dev$q[1:10]),ncol=2),start=1,freq=1) Time Series: Start = 1 End = 10 Frequency = 1 Series 1 Series 2 1 68.00000 138.4615 2 70.00000 355.5556 3 68.76000 304.3200 4 68.00000 231.4286 5 69.74194 357.4963 6
2011 Jun 30
0
CCF of two time series pre-whitened using ARIMA
Hi all, I have two time series that I would like to correlate but as they are autocorrelated, I am "pre-whitening" them first by fitting ARIMA models, then correlating their residuals....as described in https://onlinecourses.science.psu.edu/stat510/?q=node/75 However, http://www.stat.pitt.edu/stoffer/tsa2/Rissues.htm discusses some issues with ARIMA in R. In particular, for issue 2, if
2005 Jun 17
1
ccf
Hello group, For my research I should calculate the cross-correlation between two time series. I don't know if the function ccf can calculate this with series that have NA values. e.g. temperature: 15.5 NA 12.3 10.0 NA 14.2 15,3 .... Can you help me? Thank you very much! Laura
2008 Apr 23
1
ccf and covariance
Hi. It's my understanding that a cross-correlation function of vectors x and y at lag zero is equivalent to their correlation (or covariance, depending on how the ccf is defined). If this is true, could somebody please explain why I get an inconsistent result between cov() and ccf(type = "covariance"), but a consistent result between cor() and ccf(type = "correlation")? Or
2012 Oct 11
2
ccf(x,y) vs. cor() of x and lagged values of y
Hi I'm computing the correlation between two time-series x_t and y_t-1 (time-series lagged using the lag(y,-1) function) using the cor() function and the returned value is different from the value of ccf() function at the same lag. Any ideas why this is so? Thanks in advance for any hints. Mihnea [[alternative HTML version deleted]]
2006 Nov 28
1
ccf documentation bug or suggeston (PR#9394)
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
2009 Jul 24
1
Lag representation in ccf() while zoo object is used?
Dear All, I have 2 time-series data sets and would like to check the cross correlation. These data sets were set as a zoo object, called data, and in general look like: V1 V2 2007-01-01 00:00:00 0.0 0.176083 2007-01-01 01:00:00 0.0 0.176417 2007-01-01 02:00:00 0.0 0.175833 2007-01-01 03:00:00 0.0 0.175833 2007-01-01
2009 Jan 20
2
Confidence intervals in ccf()
Hi, I have been running the ccf() function to find cross-correlations of time series across various lags. When I give the option of plot=TRUE, I get a plot that gives me 95% confidence interval cut-offs (based on sample covariances) for my cross-correlations at each lag. This gives me a sense of whether my cross-correlations are statistically significant or not. However, I am unable to get R to
2006 Oct 02
1
CCF and ACF
Dear all, given two numeric vectors x and y, the ACF(x) at lag k is cor(x(t),x(t+k)) while the CCF(x,y) at lag k is cor(x(t),y(t-k)). See below for a simple example. > set.seed(1) > x <- rnorm(10) > y <- rnorm(10) > x [1] -0.6264538 0.1836433 -0.8356286 1.5952808 0.3295078 -0.8204684 0.4874291 0.7383247 0.5757814 -0.3053884 > y [1] 1.51178117 0.38984324
2006 Mar 02
1
CCF and Lag questions
I am new to R and new to time series modeling. I have a set of variables (var1, var2, var3, var4, var5) for which I have historical yearly data. I am trying to use this data to produce a prediction of var1, 3 years into the future. I have a few basic questions: 1) I am able to read in my data, and convert it to a time series format using 'ts.' data_ts <- ts(data, start = 1988, end =