Linked Questions

1 vote
0 answers
446 views

Autocorrelation of simple sine wave in R [duplicate]

Trying to self teach a bit about autocorrelation. For a simple sine wave, I am surprised that the acf() function in R outputs a curve that converges to 0. From my ...
Patrick J's user avatar
0 votes
1 answer
374 views

Autocorrelation Algorithm [duplicate]

I'm trying to understand the autocorrelation better and wrote an auto correlation function based on the algorithm suggested in the correlogram wiki-page (https://en.wikipedia.org/wiki/Correlogram), I ...
Amir's user avatar
  • 1
0 votes
0 answers
21 views

Is this the correct computation of autocorrelation for lag=1? [duplicate]

I want to compute the autocorrelation for the series {1,2,3,4,5} at lag k=1. I step through the calculation in tabular format. ...
user366312's user avatar
  • 2,125
17 votes
2 answers
10k views

Formula for autocorrelation in R vs. Excel

I am trying to figure out how R computes lag-k autocorrelation (apparently, it is the same formula used by Minitab and SAS), so that I can compare it to using Excel's CORREL function applied to the ...
Galit Shmueli's user avatar
5 votes
3 answers
5k views

Library routine for rolling window lag 1 autocorrelation?

I am looking for a library routine that will calculate the lag 1 autocorrelation of a time series with a rolling window; meaning "slide a window of size N points along the time series, calculate the ...
trolle3000's user avatar
3 votes
3 answers
7k views

Covariance of timeseries [duplicate]

If I have data on a time series with the following structure Day Value, p 1 1.2 2 2.1 3 4.0 4 3.2 How do I calculate the first order ...
karamell's user avatar
  • 133
11 votes
1 answer
4k views

"Manual" calculation of ACF of a time series in R - close but not quite

I'm trying to understand the "mechanism" behind the calculation of ACF values in a time series. As a "prove-it-to-myself exercise" [NOTE: I updated the code in this link to reflect the information in ...
Antoni Parellada's user avatar
3 votes
2 answers
3k views

How to calculate the ccf (cross-correlation) function mannually when one time series contains NA in R?

I have two time series, for example: a = c(2, 1, 2, 1, 2, 1, 2) b = c(NA, NA, 1, 2, 1, 2, 1) ccf(a, b, na.action=na.omit, plot=FALSE) The results of ccf shows ...
Xi Wang's user avatar
  • 31
5 votes
1 answer
2k views

Interpretation of the autocorrelation of a binary process

Every second, a device returns the value 0 or 1. The values were recorded several hours, so a list like this one [1,1,1,0,0,1,0,1,...] was obtained. What is the meaning of the corresponding ...
user1420303's user avatar
1 vote
1 answer
5k views

Cross-correlation in Matlab

What is the difference between: 1) xcov(x,y,10,'unbiased')/sqrt(xcov(x,x,0,'unbiased')*xcov(y,y,0,'unbiased')); 2) xcorr(x,y,10,'unbiased'); 3) [A, B] = crosscorr(x,y,10); ? I think (but I am not ...
user avatar
5 votes
2 answers
1k views

How to calculate the autocorrelation coefficient of multi-dimensional time series

The autocorrelation coefficient formula of one-dimensional time series is as belows: $r_k = {\sum\limits^{n-k}_{l=1}}(x_1-\bar x)(x_{l+k}-\bar x)/{\sum\limits^n_{l=1}}(x_l-\bar x)^2$ I want to know ...
W.Skyman's user avatar
3 votes
0 answers
3k views

Proper normalized cross-correlation

I'm confused with the widely used approach to compute the normalized cross-correlation which is something like this: Standardize the argument vectors (of equal length $n$). Slide one over the other ...
werediver's user avatar
  • 281
1 vote
2 answers
648 views

Correlation Coefficient for lag $k$ in Time Series Data

Formula of Pearson Correlation Coefficient is : $$r_{xy}=\frac{\sum_{i=1}^{n}(x_i-\bar x)(y_i-\bar y)}{\sqrt{\sum_{i=1}^{n}(x_i-\bar x)^2}\sqrt{\sum_{i=1}^{n}(y_i-\bar y)^2}}$$ In Time series ...
time's user avatar
  • 1,617
1 vote
0 answers
1k views

Proper way of computing auto-correlation

What is the proper way of calculating the auto-correlation of a limited length real valued data series? Searching books and the web one can find two different methods for calculating the auto-...
suugakugasukidesu's user avatar
2 votes
0 answers
1k views

R: understanding the acf() function

Studying autocorrelation using R I ran into a brief exposure by Ryan Sheehy named Autocorrelation in R. In this exposure, the topic and the use of the function acf()...
Adriaan Hoogendoorn's user avatar

15 30 50 per page