search for: myccf

Displaying 2 results from an estimated 2 matches for "myccf".

2007 Jan 08
1
query
Hello! I found the ccf function gives different estimates than the simple lag correlations. Why is that? This is my code: set.seed(20) x<-rnorm(20) y<-x+rnorm(20,sd=0.3) print("R CCF:") print(ccf(x,y,lag.max=2,plot=F)) myccf<- c( cor(y[-(1:2)],x[-(19:20)]) , cor(y[-1],x[-20]), cor(y,x), cor(x[-1],y[-20]),cor(x[-(1:2)],y[-(19:20)]) ) print("My CCF:") print(myccf) Thank You! Ron [[alternative HTML version deleted]]
2008 Jul 25
1
How to pass function argument of same name to internal call?
...ccf() calls plot(), which digs up plot.acf() whose default style is type='h' . I wanted to pass the argument type='l' to the plotting routine, but of course I can't put two arguments named "type" into the ccf() call. I made do with the work-around of writing "myccf," with the argument for the acf() call changed to "cortype," but that's ugly. Is there a way to "escape" an argument so it gets ignored by the main function and only gets read by the internally-called function? thanks for any ideas. Carl