similar to: How to pass function argument of same name to internal call?

Displaying 20 results from an estimated 1000 matches similar to: "How to pass function argument of same name to internal call?"

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 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)]) )
2005 Oct 10
1
acf.plot() question
When I run the "acf()" function using the "acf(ts.union(mdeaths, fdeaths))" example, the "acf()" function calls the "acf.plot()" function to generate this plot... http://members.cox.net/ddebarr/images/acf_example.png The plot in the lower right-hand corner is labeled "fdeaths & mdeaths", but the negative lags appear to belong to "mdeaths
2008 Oct 28
1
acf() plots of a data.frame: what meaning?
Hello, what is the meaning of the plots of an acf()-plot, when using a data frame as argument? The result is NOT obvious for me. There are combinations of the columns of a dataframe in the reulting plot. But an acf() is just defined for onyl one time-sreies. So what do the plots mean? I did not found a description in the help-page. Ciao, Oliver
2004 Mar 04
1
Lineair regression modelling between time series //correlation analysis
Dear R specialists, I'm working with time series and want to investigate the relationship between two time series by correlation analysis or by fitting a gen. lineair model to the plot of x(timeserie1) and y(timeserie2). Lin1 <- data.frame( Nr = c(1:lengte), NDII = window(ts.mNDII,c(1998,10),c(2003,11)), InvERC = window(Inv.ERC,c(1998,10),c(2003,11)) )
2017 Oct 18
1
dygraphs, multiple graphs and shiny
Hi All: This is really getting into the weeds, but I am hoping someone will have a solution. I am trying to use dygrahs for R, within Shiny. The situation arises when I am combining a number of dygraphs into one plot. If I am just in an RNotebook, if you look at: https://stackoverflow.com/questions/30509866/for-loop-over-dygraph-does-not-work-in-r the solution to have the plot shown from a
2003 Aug 08
1
understanding time series objects
### First, is there a way to access a univariate time series as a matrix instead of a vector? # For example: data(UKLungDeaths) # If I do apply(mdeaths,1,cumsum) # Gives an error as mdeaths is not a matrix but a vector, although when I look at it : mdeaths # the ts object has a matrix like "appearance" # The only way of doing it I've found is: mdeaths2<-as.matrix(mdeaths)
2000 Apr 03
1
cbind.ts(),ts.union() (PR#508)
Full_Name: Wolfgang Koller Version: 1.0.0 OS: linux Submission from: (NULL) (137.208.7.48) > data(UKLungDeaths) > ts.union(mdeaths, fdeaths,dframe=TRUE) Error in names<-.default(*tmp*, value = nmsers) : names attribute must be the same length as the vector > cbind(mdeaths, fdeaths,dframe=TRUE) Error in names<-.default(*tmp*, value = nmsers) : names attribute
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
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
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 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
2014 Nov 04
1
[R] Calculation of cross-correlation in ccf
Dear All, I am studying some process measurement time series in R and trying to identify time delays using cross-correlation function ccf. The results have however been bit confusing. I found a couple of years old message about this issue but unfortunately wasn't able to find it again for a reference. For example, an obvious time shift is observed between the measurements y1 and y2 when the
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
2004 Jan 01
1
Barplot errors in MASS script
Reading "Modern Applied Statististics with S" and trying the corresponding examples both in the book and in ../lib/R/library/MASS/script, I'm now trying chapter 4 plotting bars with the following code on a linux box with R 1.8.1: ---------------------- library(MASS) library(lattice) options(echo=T, width=65, digits=5) lung.deaths <- aggregate(ts.union(mdeaths, fdeaths), 1)
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,]
2005 Oct 31
1
how to optimise cross-correlation plot to study time lag between time-series?
Dear R-help, How could a cross-correlation plot be optimized such that the relationship between seasonal time-series can be studied? We are working with strong seasonal time-series and derived a cross-correlation plot to study the relationship between time-series. The seasonal variation however strongly influences the cross-correlation plot and the plot seems to be ?rather? symmetrical (max
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
2003 Dec 02
1
Help with this topic
Dear ladies and gentlemen, I would like to calculate autocovarinace and cross-covariance scores 1, 2 and 3 of four classes A, B, C and D. I am using acf and ccf from time sires library. My problem is that I can not separate my data among the classes A, B, C and D. When I calculated acf for Score 1, I got a wrong result. The reason being that instead of using ony 60, 40 and 20, the program
2013 Jan 29
1
ccf (cross correlation function) problems
Hello everybody, I am sorry if my questions are too simple or not easily understandable. I’m not a native English speaker and this is my first analysis using this function. I have a problem with a cross correlation function and I would like to understand how I have to perform it in R. I have yearly data of an independent variable (x) from 1982 to 2010, and I also have yearly data of a variable