The correlogram can help provide answers to the following questions:4
Randomness (along with fixed model, fixed variation, and fixed distribution) is one of the four assumptions that typically underlie all measurement processes. The randomness assumption is critically important for the following three reasons:
where s is the standard deviation of the data. Although heavily used, the results from using this formula are of no value unless the randomness assumption holds.
If the data are not random, this model is incorrect and invalid, and the estimates for the parameters (such as the constant) become nonsensical and invalid.
The autocorrelation coefficient at lag h is given by
where ch is the autocovariance function
and c0 is the variance function
The resulting value of rh will range between −1 and +1.
Some sources may use the following formula for the autocovariance function:
Although this definition has less bias, the (1/N) formulation has some desirable statistical properties and is the form most commonly used in the statistics literature. See pages 20 and 49–50 in Chatfield for details.
In contrast to the definition above, this definition allows us to compute c h {\displaystyle c_{h}} in a slightly more intuitive way. Consider the sample Y 1 , … , Y N {\displaystyle Y_{1},\dots ,Y_{N}} , where Y i ∈ R n {\displaystyle Y_{i}\in \mathbb {R} ^{n}} for i = 1 , … , N {\displaystyle i=1,\dots ,N} . Then, let
We then compute the Gram matrix Q = X ⊤ X {\displaystyle Q=X^{\top }X} . Finally, c h {\displaystyle c_{h}} is computed as the sample mean of the h {\displaystyle h} th diagonal of Q {\displaystyle Q} . For example, the 0 {\displaystyle 0} th diagonal (the main diagonal) of Q {\displaystyle Q} has N {\displaystyle N} elements, and its sample mean corresponds to c 0 {\displaystyle c_{0}} . The 1 {\displaystyle 1} st diagonal (to the right of the main diagonal) of Q {\displaystyle Q} has N − 1 {\displaystyle N-1} elements, and its sample mean corresponds to c 1 {\displaystyle c_{1}} , and so on.
In the same graph one can draw upper and lower bounds for autocorrelation with significance level α {\displaystyle \alpha \,} :
If the autocorrelation is higher (lower) than this upper (lower) bound, the null hypothesis that there is no autocorrelation at and beyond a given lag is rejected at a significance level of α {\displaystyle \alpha \,} . This test is an approximate one and assumes that the time-series is Gaussian.
In the above, z1−α/2 is the quantile of the normal distribution; SE is the standard error, which can be computed by Bartlett's formula for MA(ℓ) processes:
In the example plotted, we can reject the null hypothesis that there is no autocorrelation between time-points which are separated by lags up to 4. For most longer periods one cannot reject the null hypothesis of no autocorrelation.
Note that there are two distinct formulas for generating the confidence bands:
1. If the correlogram is being used to test for randomness (i.e., there is no time dependence in the data), the following formula is recommended:
where N is the sample size, z is the quantile function of the standard normal distribution and α is the significance level. In this case, the confidence bands have fixed width that depends on the sample size.
2. Correlograms are also used in the model identification stage for fitting ARIMA models. In this case, a moving average model is assumed for the data and the following confidence bands should be generated:
where k is the lag. In this case, the confidence bands increase as the lag increases.
Correlograms are available in most general purpose statistical libraries.
Correlograms:
Corrgrams:
This article incorporates public domain material from the National Institute of Standards and Technology
Friendly, Michael (19 August 2002). "Corrgrams: Exploratory displays for correlation matrices" (PDF). The American Statistician. 56 (4). Taylor & Francis: 316–324. doi:10.1198/000313002533. Retrieved 19 January 2014. http://euclid.psych.yorku.ca/datavis/papers/corrgram.pdf ↩
"CRAN – Package corrgram". cran.r-project.org. 29 August 2013. Retrieved 19 January 2014. https://cran.r-project.org/web/packages/corrgram/ ↩
"Quick-R: Correlograms". statmethods.net. Retrieved 19 January 2014. http://www.statmethods.net/advgraphs/correlograms.html ↩
"1.3.3.1. Autocorrelation Plot". www.itl.nist.gov. Retrieved 20 August 2018. https://www.itl.nist.gov/div898/handbook/eda/section3/autocopl.htm ↩
"Visualization § Autocorrelation plot". https://pandas.pydata.org/pandas-docs/stable/user_guide/visualization.html#autocorrelation-plot ↩