Tutorials › Exam SRM - Statistics for Risk Modeling › Estimating Sample Autocovariance

Exam SRM · Time-Series Foundations · Tutorial 395 of 926

Estimating Sample Autocovariance

Calculate sample autocovariances at specified lags, compare the two common denominator conventions, and recognize when a convention changes the interpretation.

Beginner 10 min read

What You'll Learn

  • Center a finite time series using its observed sample mean
  • Calculate lagged cross-products and sum them at a specified lag
  • Apply the fixed-series-length and available-pairs denominator conventions
  • Explain why the two denominator conventions produce different estimates
  • Recognize the distinction between a convention called unbiased and actual unbiasedness when the mean is estimated

Why Sample Autocovariance Requires a Convention

Autocovariance describes how values separated by a specified time lag vary together. For an observed series, the corresponding calculation uses products of pairs of centered observations. At a positive lag, fewer pairs are available than there are observations, so a practical question arises: should the sum be divided by the full series length or by the number of pairs used?

Both denominators are common. The resulting values can differ noticeably in a short series, even though they use exactly the same data and lagged products. A sound calculation therefore states the centering and denominator convention, rather than reporting a number without explaining how it was obtained.

Definition: For observations \(x_1,\ldots,x_n\), let \(\bar{x}=\frac{1}{n}\sum_{t=1}^{n}x_t\). At a nonnegative integer lag \(k<n\), the lagged cross-product sum is \(C_k=\sum_{t=1}^{n-k}(x_t-\bar{x})(x_{t+k}-\bar{x})\). Two common sample autocovariance conventions are \(\hat{\gamma}_{k}^{(n)}=C_k/n\), which uses the fixed series length, and \(\hat{\gamma}_{k}^{(n-k)}=C_k/(n-k)\), which uses the number of available pairs. The superscripts here identify the denominators; they are not powers.

There are \(n-k\) products at lag \(k\): the first observation in each pair can be \(x_1\) through \(x_{n-k}\), and its partner is \(k\) positions later. At lag zero there are \(n\) products, so the two conventions agree. For positive lags they generally differ. The order of the factors does not change the result: the pair at time \(t\) is \(x_t\) and \(x_{t+k}\).

A Reliable Calculation Procedure

For a hand calculation, keep the centering, products, and denominator separate. This makes it easier to detect errors and to report both conventions if a question does not specify one.

1
Find the observed mean.
Add the \(n\) observations and divide by \(n\). Use this same mean to center every observation.
2
List the centered values.
For each time \(t\), calculate \(x_t-\bar{x}\). Do not substitute raw observations into the autocovariance formula.
3
Form the lagged products.
At lag \(k\), multiply centered values \(k\) positions apart. There are \(n-k\) such products.
4
Sum and divide.
Divide the sum by \(n\) for the fixed-length convention or by \(n-k\) for the available-pairs convention. Name the convention in the result.

Worked Example: Calculate Two Lags Under Both Conventions

A hypothetical monthly index is recorded as \(2,4,1,5,3\). Calculate the sample autocovariances at lags 1 and 2 under both denominator conventions, and also find the lag-zero value.

Method. First center the observations, then calculate each lagged cross-product sum. The mean is \( \bar{x}=(2+4+1+5+3)/5=15/5=3 \). The centered series is therefore \(-1,1,-2,2,0\).

At lag 1, there are \(5-1=4\) products: \( (-1)(1)=-1 \), \( (1)(-2)=-2 \), \( (-2)(2)=-4 \), and \( (2)(0)=0 \). Thus \(C_1=-1-2-4+0=-7\).

The fixed-length estimate is \( \hat{\gamma}_{1}^{(n)}=-7/5=-1.4 \). The available-pairs estimate is \( \hat{\gamma}_{1}^{(n-k)}=-7/4=-1.75 \).

At lag 2, there are \(5-2=3\) products: \( (-1)(-2)=2 \), \( (1)(2)=2 \), and \( (-2)(0)=0 \). Thus \(C_2=2+2+0=4\). The fixed-length estimate is \(4/5=0.8\), and the available-pairs estimate is \(4/3=1.333\ldots\).

At lag 0, the sum of squared centered values is \( C_0=(-1)^2+1^2+(-2)^2+2^2+0^2=1+1+4+4+0=10 \). Both conventions divide by 5, giving \( \hat{\gamma}_0=10/5=2 \).

Check. Each lag uses the correct number of pairs, and the lag-zero estimates agree. The difference between the two positive-lag answers comes only from the denominator. A common mistake is to divide the lag-2 sum by 4, the number of lag-1 pairs; the correction is to use \(n-k=3\) pairs at lag 2.

Why the Denominators Differ

The available-pairs denominator has a simple justification when the process mean is known and used for centering. Suppose \(X_t\) has mean \(\mu\) and covariance \(\operatorname{Cov}(X_t,X_{t+k})=\gamma_k\), with the same covariance at each time for this lag. Define the known-mean sum \(C_k^{(\mu)}=\sum_{t=1}^{n-k}(X_t-\mu)(X_{t+k}-\mu)\). By linearity of expectation, each product has expectation \(\gamma_k\), so the expectation of the sum is \((n-k)\gamma_k\). Therefore, dividing by \(n-k\) gives an estimator whose expectation is \(\gamma_k\) in this known-mean setting.

$$ E\!\left[\frac{C_k^{(\mu)}}{n-k}\right] =\frac{1}{n-k}\sum_{t=1}^{n-k}E[(X_t-\mu)(X_{t+k}-\mu)] =\frac{(n-k)\gamma_k}{n-k} =\gamma_k. $$

If the same known-mean sum is instead divided by \(n\), its expectation is \(\frac{n-k}{n}\gamma_k\). For positive \(k\), the factor \((n-k)/n\) is less than 1, so this fixed-length version is scaled toward zero in expectation under these assumptions. This explains why the available-pairs convention is sometimes called the unbiased convention.

That label needs care in actual calculations: the formulas in this tutorial center on the observed mean \(\bar{x}\), not a known population mean \(\mu\). Estimating the mean from the same finite series affects the expectation of the products. Consequently, dividing by \(n-k\) does not in general make the sample autocovariance exactly unbiased when \(\bar{x}\) is estimated. “Available-pairs” precisely describes the denominator; “unbiased” is not a guarantee for every setting.

At lag zero, the common formula gives \( \hat{\gamma}_0=\frac{1}{n}\sum_{t=1}^n(x_t-\bar{x})^2 \), the variance of the observed values using divisor \(n\). This differs from the familiar sample variance with divisor \(n-1\). Do not replace the lag-zero divisor with \(n-1\) unless a question explicitly asks for that different quantity.

Worked Example: Interpret the Available-Pairs Denominator

A hypothetical monthly benefit count is recorded as \(10,12,11,15,14,16\). Find the lag-2 estimates under both conventions, and explain which denominator corresponds to the number of products.

Method. The observed mean is \( \bar{x}=(10+12+11+15+14+16)/6=78/6=13 \). The centered values are \(-3,-1,-2,2,1,3\).

At lag 2, the four pairs are the centered values at positions \((1,3),(2,4),(3,5),(4,6)\). Their products are \( (-3)(-2)=6 \), \( (-1)(2)=-2 \), \( (-2)(1)=-2 \), and \( (2)(3)=6 \). Thus \(C_2=6-2-2+6=8\).

The fixed-length estimate is \(8/6=1.333\ldots\). The available-pairs estimate is \(8/(6-2)=8/4=2\). Four products were added, so the available-pairs denominator is 4. The fixed-length denominator remains 6 by definition; it is not a claim that six lag-2 pairs exist.

Check. The mean is 13, all four lag-2 pairs are included once, and the two estimates use the same numerator. A common mistake is to call \(8/4\) the fixed-length estimate simply because four terms were summed; the fixed-length convention instead divides by the original series length, 6.

Centering Is Part of the Definition

The lagged products are products of deviations from the sample mean. Using raw observations instead can change the answer substantially, and the resulting sum is not the sample autocovariance defined above. Centering also means that a constant shift in every observation leaves the sample autocovariances unchanged: the sample mean shifts by the same constant, so each centered value remains the same.

Worked Example: Avoid Raw-Value Products

A hypothetical quarterly count series is \(3,5,4,8\). Calculate its lag-1 sample autocovariance under both conventions, and identify the error made by using raw-value products.

Method. The mean is \( (3+5+4+8)/4=20/4=5 \), so the centered series is \(-2,0,-1,3\). At lag 1, the three centered products are \( (-2)(0)=0 \), \( (0)(-1)=0 \), and \( (-1)(3)=-3 \). Therefore \(C_1=0+0-3=-3\).

The fixed-length estimate is \(-3/4=-0.75\). The available-pairs estimate is \(-3/3=-1\). As a check on centering, adding 10 to every observation would give \(13,15,14,18\), whose mean is 15 and whose centered values are still \(-2,0,-1,3\).

If raw values were multiplied instead, the lag-1 products would be \(3(5)=15\), \(5(4)=20\), and \(4(8)=32\), with sum \(67\). Dividing 67 by either denominator would not give a sample autocovariance: those products were not centered. The correction is to subtract the sample mean from every value before forming pairs.

Check. The centered sum is negative because the three lagged products sum to \(-3\); the large positive raw-product sum is a warning that the mean was not removed.

Common Exam Traps

  • Using the wrong number of pairs. At lag \(k\), there are \(n-k\) products, not \(n\). This determines the available-pairs denominator.
  • Switching conventions without saying so. The same numerator gives different positive-lag values under divisors \(n\) and \(n-k\). State which estimate you report.
  • Using raw observations. Center every observation using the same observed mean before multiplying lagged pairs.
  • Calling the \(n-k\) result automatically unbiased. Its unbiasedness argument applies directly when centering uses the known mean under the stated covariance condition. Estimating the mean from the series changes the calculation's expectation.
  • Using \(n-1\) at lag zero by habit. The autocovariance convention here uses divisor \(n\) at lag zero; the two lag denominators also agree there.
Key takeaway: For a finite series, calculate the centered lagged-product sum once. Divide that sum by \(n\) for the fixed-length convention or by \(n-k\) for the available-pairs convention. The denominator is part of the reported estimate, not a detail to leave implicit.

Check Your Understanding

For each problem, center using the observed sample mean. Unless a question says otherwise, report both denominator conventions for positive lags.

  1. A four-observation series is \(1,3,2,6\). Find the lag-1 cross-product sum and the two lag-1 estimates. (Answer: \(C_1=-3\); fixed-length estimate \(-0.75\); available-pairs estimate \(-1\).)
  2. A five-observation series is \(4,7,5,8,6\). Find the lag-1 and lag-2 estimates under both conventions. (Answer: \(C_1=-5\), giving \(-1\) and \(-1.25\); \(C_2=4\), giving \(0.8\) and \(1.3333\ldots\).)
  3. A six-observation series is \(2,4,6,8,10,12\). Find the lag-2 cross-product sum and both estimates. (Answer: \(C_2=4\); fixed-length estimate \(4/6=0.6667\); available-pairs estimate \(4/4=1\).)
  4. A four-observation series is \(1,2,4,5\). Find its mean, lag-1 cross-product sum, and both estimates. (Answer: mean \(3\); \(C_1=3\); fixed-length estimate \(0.75\); available-pairs estimate \(1\).)
  5. A five-observation series is \(0,2,3,7,8\). Calculate the lag-zero value and the two lag-2 estimates, then state why the lag-zero conventions agree. (Answer: mean \(4\); \(\hat{\gamma}_0=46/5=9.2\); \(C_2=-6\), giving fixed-length estimate \(-1.2\) and available-pairs estimate \(-2\); at lag zero, \(n-k=n\).)
Clinical Biostats