similar to: ccf(x,y) vs. cor() of x and lagged values of y

Displaying 20 results from an estimated 2000 matches similar to: "ccf(x,y) vs. cor() of x and lagged values of y"

2005 Mar 05
4
How to use "lag"?
Is it possible to fit a lagged regression, "y[t]=b0+b1*x[t-1]+e", using the function "lag"? If so, how? If not, of what use is the function "lag"? I get the same answer from y~x as y~lag(x), whether using lm or arima. I found it using y~c(NA, x[-length(x)])). Consider the following: > set.seed(1) > x <- rep(c(rep(0, 4), 9), len=9) > y <-
2007 May 08
2
statistics/correlation question NOT R question
This is not an R question but if anyone can help me, it's much appreciated. Suppose I have a series ( stationary ) y_t and a series x_t ( stationary )and x_t has variance sigma^2_x and epsilon is normal (0, sigma^2_epsilon ) and the two series have the relation y_t = Beta*x_t + epsilon My question is if there are particular values that sigma^2_x and sigma^2_epsilon have to take in
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 =
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
2000 Apr 04
0
stochastic process transition probabilities estimation
Hi all, I'm new with R (and S), and relatively new to statistics (I'm a computer scientist), so I ask sorry in advance if my question is silly. My problem is this: I have a (sample of a) discrete time stochastic process {X_t} and I want to estimate Pr{ X_t | X_{t-l_1}, X_{t-l_2}, ..., X_{t-l_k} } where l_1, l_2, ..., l_k are some fixed time lags. It will be enough for me to compute
2007 May 21
1
Sample correlation coefficient question NOT R question
This is a statistics question not an R question. When calculating the sample correlation coefficient cor(x_t,y_t) between say two variables, x_t and y_t t=1,.....n ( one can assume that the variables are in time but I don't think this really matters for the question ), does someone know where I can find any piece of literature that says that each (x_j,y_j) pair has To be independent from the
2002 Apr 09
2
Restricted Least Squares
Hi, I need help regarding estimating a linear model where restrictions are imposed on the coefficients. An example is as follows: Y_{t+2}=a1Y_{t+1} + a2 Y_t + b x_t + e_t restriction a1+ a2 =1 Is there a function or a package that can estimate the coefficient of a model like this? I want to estimate the coefficients rather than test them. Thank you for your help Ahmad Abu Hammour --------------
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
2013 Feb 05
1
R -HELP REQUEST
Good morning to you all, Sorry for taking your time from your research and teaching schedules.   If you have a non-stationary univariate time Series data that has the transformation: Say; l.dat<-log (series) d.ldat<-diff (l.dat, differences=1) and you fit say arima model. predit.arima<-predict (fit.series, n.ahead=10, xregnew= (n+1) :( n+10)) How could I re-transform
2007 Mar 05
1
Heteroskedastic Time Series
Hi R-helpers, I'm new to time series modelling, but my requirement seems to fall just outside the capabilities of the arima function in R. I'd like to fit an ARMA model where the variance of the disturbances is a function of some exogenous variable. So something like: Y_t = a_0 + a_1 * Y_(t-1) +...+ a_p * Y_(t-p) + b_1 * e_(t-1) +...+ b_q * e_(t-q) + e_t, where e_t ~ N(0, sigma^2_t),
2004 Apr 07
1
Time Varying Coefficients
I'd like to estimate time varying coefficients in a linear regression using a Kalman filter. Even if the Kalman Filter seems to be available in some packages I can't figure out how to use it to estimate the coefficients. Is there anyway to do that in R? Any help appreciated Thanks
2013 May 02
2
ARMA with other regressor variables
Hi, I want to fit the following model to my data: Y_t= a+bY_(t-1)+cY_(t-2) + Z_t +Z_(t-1) + Z_(t-2) + X_t + M_t i.e. it is an ARMA(2,2) with some additional regressors X and M. [Z_t's are the white noise variables] How do I find the estimates of the coefficients in R? And also I would like to know what technique R employs to find the estimates? Any help is appreciated. Thanks,
2006 Dec 20
2
Kalman Filter in Control situation.
I am looking for a Kalman filter that can handle a control input. I thought that l.SS was suitable however, I can't get it to work, and wonder if I am not using the right function. What I want is a Kalman filter that accepts exogenous inputs where the input is found using the algebraic Ricatti equation solution to a penalty function. If K is the gain matrix then the exogenous input
2009 Jun 19
1
using garchFit() to fit ARMA+GARCH model with exogeneous variables
Hello - Here's what I'm trying to do. I want to fit a time series y with ARMA(1,1) + GARCH(1,1), there are also an exogeneous variable x which I wish to include, so the whole equation looks like: y_t - \phi y_{t-1} = \sigma_t \epsilon_t + \theta \sigma_{t-1} \epsilon_{t-1} + c x_t where \epsilon_t are i.i.d. random variables \sigma_t^2 = omega + \alpha \sigma_{t-1}^2 + \beta
2013 Mar 11
2
[PATCH] block: replace kmalloc and then memcpy with kmemdup
Signed-off-by: Mihnea Dobrescu-Balaur <mihneadb at gmail.com> --- drivers/block/xen-blkfront.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c index c3dae2e..9620644 100644 --- a/drivers/block/xen-blkfront.c +++ b/drivers/block/xen-blkfront.c @@ -1203,11 +1203,10 @@ static int blkif_recover(struct
2013 Mar 11
2
[PATCH] block: replace kmalloc and then memcpy with kmemdup
Signed-off-by: Mihnea Dobrescu-Balaur <mihneadb at gmail.com> --- drivers/block/xen-blkfront.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c index c3dae2e..9620644 100644 --- a/drivers/block/xen-blkfront.c +++ b/drivers/block/xen-blkfront.c @@ -1203,11 +1203,10 @@ static int blkif_recover(struct
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
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 Oct 06
1
dlm package: how to specify state space model?
Dear r-users! I have another question regarding the dlm package and I would be very happy if someone could give me a hint! I am using the dlm package to get estimates for an endogenous rate of capacity utilization over time. The general form of a state space model is (1) b_t = G * b_t-1 + w_t w_t ~ N(0,W) (2) y_t= A' * x_t + H' * b_t + v_t v_t ~ N(0,V) (Hamilton 1984: 372) The