Sample ACF
The sample ACF estimates the theoretical Autocorrelation Function (ACF) from observed data, and in practice is computed through the sample ACVF.
1. Sample Autocovariance
Given observations $x_1, \dots, x_n$ with sample mean $\bar{x} = \frac{1}{n}\sum_{t=1}^n x_t$:
$$\hat{\gamma}(h) = \frac{1}{n}\sum_{t=1}^{n-h}(x_t - \bar{x})(x_{t+h} - \bar{x}), \quad h = 0, 1, \dots, n-1$$Note the divisor is $n$ (not $n-h$), which ensures the sample ACVF matrix is positive semi-definite.
2. Sample ACF
$$\hat{\rho}(h) = \frac{\hat{\gamma}(h)}{\hat{\gamma}(0)}, \quad -n < h < n$$3. Asymptotic Distribution (Bartlett’s Formula)
For large $n$, the vector $\hat{\rho} = (\hat{\rho}(1), \dots, \hat{\rho}(k))^\top$ is approximately normally distributed:
$$\hat{\rho} \approx \mathcal{N}(\rho, n^{-1}W)$$where $W$ is the covariance matrix with entries given by Bartlett’s formula:
$$w_{ij} = \sum_{k=1}^{\infty} \left[\rho(k+i) + \rho(k-i) - 2\rho(i)\rho(k)\right]\left[\rho(k+j) + \rho(k-j) - 2\rho(j)\rho(k)\right]$$4. White Noise Test
For $\{X_t\} \sim \text{WN}(0, \sigma^2)$, the sample autocorrelations satisfy:
$$\hat{\rho}(h) \sim \mathcal{N}(0, 1/n) \quad \text{for } h > 0$$95% confidence bands: $\pm 1.96/\sqrt{n}$
Hypothesis test at $\alpha = 0.05$: If the process is truly white noise, approximately 95% of the sample ACF values should fall within the bands. Reject $H_0$ (white noise) if too many values exceed the bands.
For $h = 1, \dots, 30$: at most $\lfloor 0.05 \times 30 \rfloor = 1$ value should exceed the bounds under $H_0$.