A Complete Introduction To Time Series Analysis (with R):: Estimating Autocorrelation

Hair Parra
Analytics Vidhya
Published in
4 min readJul 3, 2020

--

Over-differenced LakeHuron series data ACF. Ideally, a stationary series should have most lags within the confidence bounds.

In the last article, we went over a couple of important properties of the autocovariance function, and in previous articles, we have used multiple times the ggAcf and ggPacf functions to plot the ACF and PACF respectively. But how are these actually estimated them, and how do we know that they are being correctly estimated (and hopefully not too off from the truth)? In this short article, we will explain precisely that. Let’s start!

Estimating autocovariance

Suppose that you have some time series with observed values

Then we have the following:

Sample mean

This one is probably not surprising. The interesting one is the following:

Sample autocovariance

further, this implies that

Why is this the case? First recall that the covariance between two vectors U and V is given by

When it comes to the sample version of these estimators, you can think as replacing the expectation operator by some average with the data; so, in this case, we would get

if the lowercase indexed u and v represent the random vector (observed ) components. For time series, however, both “u”…

--

--

Hair Parra
Analytics Vidhya

Data Scientist & Data Engineer. CS, Stats & Linguistics graduate. Polyglot.