1. Home
  2. Signal processing

Time series · statistics

Statistical Time Series Analysis (STSA)

Eigenfield editorial team ·

Statistical time series analysis, often shortened to STSA, treats a sequence of measurements as one realization of a random process and asks what the structure of that process is. The questions are practical: is there a trend, do neighboring values depend on each other, how far ahead can the series be predicted, and which frequencies carry its energy. The tools are the sample mean and variance, the autocorrelation function, spectral estimates and parametric models, and they build on the signal processing operations of transforms and filters.

Stationarity comes first

Almost every method assumes the series is stationary: its mean and variance do not drift, and the dependence between two values depends only on the gap between them. A series with a visible trend or a seasonal swing violates that. The usual first step is to remove the trend, by subtracting a fitted line or by differencing, replacing x(t) by x(t) − x(t − 1). Differencing a straight-line trend leaves a constant, and differencing again leaves zero, which is why one or two differences handle most trends in practice.

Only after that does it make sense to estimate correlation. Calculating an autocorrelation on a trending series produces large values at every lag that say only that the series is trending.

Sample autocovariance and autocorrelation

For a series x(1) … x(n) with mean x̄, the sample autocovariance at lag k is

c(k) = (1/n) ∑ (x(t) − x̄)(x(t + k) − x̄)

summed over the t for which both terms exist. The factor 1/n, not 1/(n − k), is the standard choice because it guarantees a valid, nonnegative-definite sequence. The autocorrelation is r(k) = c(k)/c(0).

A short example makes the arithmetic concrete. Let x = [1, 3, 4, 6, 6]. The mean is 20/5 = 4 and the deviations are −3, −1, 0, 2, 2. Then c(0) = (9 + 1 + 0 + 4 + 4)/5 = 18/5 = 3.6. At lag 1 the products are (−3)(−1) = 3, (−1)(0) = 0, (0)(2) = 0 and (2)(2) = 4, so c(1) = 7/5 = 1.4 and r(1) = 1.4/3.6 = 0.389. At lag 2 the products are 0, −2, 0, giving c(2) = −2/5 = −0.4 and r(2) = −0.111.

Five points are far too few for conclusions, since the standard error of an autocorrelation is roughly 1/√n, here 0.45. Both values lie well inside that band. For a long series, values outside ±2/√n are the ones worth noticing.

Autoregressive models

An autoregressive model of order one, AR(1), says x(t) = φ·x(t − 1) + e(t), where e(t) is white noise. The autocorrelation of such a process decays geometrically, r(k) = φk, so r(1) = φ directly. With the data above the estimate is φ ≈ 0.389, and the model predicts r(2) ≈ 0.151, while the data show −0.111. With n = 5 that gap means nothing; with a long series it would argue for a higher-order model.

For order p the Yule-Walker equations link the coefficients to the autocorrelations by a linear system whose matrix has constant diagonals, so it can be solved quickly by a recursion. The residual variance follows from c(0) and the fitted coefficients. Order is chosen by an information criterion or by the point where the partial autocorrelation drops into the noise band.

Spectra of random series

A random series has a spectrum in the sense of a power spectral density, not a line pattern. The raw estimate, the periodogram, is the squared magnitude of the transform of the data. It is unbiased but noisy: its standard deviation equals its mean at every frequency, however long the record. Smoothing across neighboring frequencies, averaging periodograms of segments, or fitting an autoregressive model and reading its spectrum all reduce that variance. Tapering with a window before the transform controls leakage from strong components into weak ones. The indexing of the output is handled by a frequency axis.

Forecasting and filtering

Given a fitted model, a forecast is the conditional expectation. For AR(1), the prediction h steps ahead of a deviation d from the mean is φh·d, which decays to the mean. With φ = 0.389 and a current deviation of 2, the one-step forecast is 0.78 and the two-step forecast 0.30. The forecast error variance grows with h toward the series variance.

When the process itself drives a changing hidden state, estimation by recursive filtering is more natural than a fixed model; the continuous and discrete forms are on the Kalman-Bucy filtering page. Smoothing a noisy series by averaging neighbors is a convolution with a weight vector.

Practical cautions

Check the sampling first: the series must be evenly spaced, or interpolated onto an even grid. Report the method with the result, since sample autocovariance conventions (1/n against 1/(n − k)) and AR coefficient sign conventions differ between packages, and seasonality, outliers, or level shifts produce spurious structure that no correlation figure will label as such. A plot of the data, and one of the residuals after fitting, catches most problems before any statistic does.

Back to top