Displaying 20 results from an estimated 1000 matches similar to: "ccf (cross correlation function) problems"
2006 Apr 13
1
How does ccf() really work?
I can't understand the results from cross-correlation function ccf()
even though it should be simple.
Here's my short example:
*********
a<-rnorm(5);b<-rnorm(5)
a;b
[1] 1.4429135 0.8470067 1.2263730 -1.8159190 -0.6997260
[1] -0.4227674 0.8602645 -0.6810602 -1.4858726 -0.7008563
cc<-ccf(a,b,lag.max=4,type="correlation")
cc
Autocorrelations of series 'X',
2006 Nov 27
2
NaN with ccf() for vector with all same element
hello,
i have been using ccf() to look at the correlation between lightning and electrogamnetic data. for the most part it has worked exactly as expected. however, i have come across something that puzzles me a bit:
> x <- c(1, 0, 1, 0, 1, 0)
> y <- c(0, 0, 0, 0, 0, 0)
> ccf(x, x, plot = FALSE)
Autocorrelations of series 'X', by lag
-4 -3 -2 -1 0
2008 Feb 19
4
[LLVMdev] 2008-01-25-ByValReadNone.c Failure
Hi all,
I'm seeing this failure on my PPC G4 box running TOT with llvm-gcc
4.2. Is anyone else seeing this? I'm sure it's related to the byval
stuff that's recently gone into LLVM. I'm attaching the output of
this command:
$ llvm-gcc -emit-llvm -O3 -S -o - -emit-llvm /Users/wendling/llvm/
llvm.src/test/CFrontend/2008-01-25-ByValReadNone.c
As you can see in it, there
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 =
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
2018 May 15
2
Systemfit
OK, Let's try this again! Here is the reproducible script; it is long because I had to copy the panel dataset here. My question is related to systemfit; I don't know how to get the result for the entire panel.
#Reproducible script
Empdata<- read.csv("/Users/ngwinuiazenui/Documents/UPLOADemp.csv")
View(Empdata)
install.packages("systemfit")
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
2018 May 15
0
Systemfit
... and the mailing list is picky about attachments... whatever you attached did not conform to the stringent requirements mentioned in the Posting Guide. Pasting the code right into the email is usually safest, though you DO have to post using plain text (as the Posting Guide indicates) or your code may get mangled by the automatic html format removal.
On May 15, 2018 7:04:31 AM PDT, Bert Gunter
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
2018 May 15
1
Systemfit
Unless there is good reason not to, always cc the list -- there are lots of
smarter folks than I on it who can help.
I may or may not have time to look at this. Hopefully someone else will.
-- Bert
Bert Gunter
"The trouble with having an open mind is that people keep coming along and
sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip
2018 May 16
0
Systemfit
Sadly you failed to set your email program to send plain text and the data is corrupted at my end.
I also think you need to reduce the size of the data set... the intent here is to increase your understanding, not debug your particular analysis.
I will say that I am having a very challenging time understanding what you are trying to accomplish though. What are the equations that you think need
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
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
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
2012 May 11
1
Possible artifacts in cross-correlation function ("ccf")?
Dear R-users,
I have been using R and its core-packages with great satisfaction now for many years, and have recently started using the "ccf" function (part of the "stats" package version 2.16.0), about which I have a question.
The "ccf"-algorithm for calculating the cross-correlation between two time series always calculates the mean and standard deviation per time
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 <-
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
2007 May 22
2
R-help with apply and ccf
Dear R gurus,
I would like to use the ccf function on two matrices that are each 196000 x
12. Ideally, I want to be able to go row by row for the two matrices using
apply for the ccf function and get one 196000 X 1 array output. The apply
function though wants only one array, no? Basically, is there a way to use
apply when there are two arrays in order to do something like correlation on
a row
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]]
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