University

Time series econometrics ·

Estimating the mean
of a time series

In introductory statistics the Law of Large Numbers is proved for independent data, coin flips, random samples of people. But economic and financial data are the opposite of independent: today's inflation, interest rate or stock price is closely tied to yesterday's. Does averaging still work when each observation is entangled with the last? This page answers that, using the autoregressive simulation from my time-series lectures.

The problem: time-series data are autocorrelated

A time series \(\{Y_t\}\) is a sequence observed through time, and its defining feature is autocorrelation: \(Y_t\) is correlated with its own past \(Y_{t-1}, Y_{t-2},\dots\). A simple model is the first-order autoregression

$$Y_t=\mu+\phi\,(Y_{t-1}-\mu)+\varepsilon_t,\qquad |\phi|\lt 1,$$

where \(\phi\) measures how strongly today remembers yesterday. Because the observations are not independent, the clean argument \(\operatorname{Var}(\bar Y_n)=\sigma^2/n\), which relied on independence to kill the covariance terms, no longer applies directly. So it is a genuine question whether the sample mean \(\bar Y_n\) still converges to \(\mu\).

The good news: it still converges (under stationarity)

LLN for time series

If the series is stationary (its mean, variance and autocorrelations do not change over time) and its autocorrelations decay as the gap grows, then the sample mean is still consistent: \(\bar Y_n \to \mu\) as \(n\to\infty\). The animation below shows it for an autoregressive series, the running average is pushed around by the persistence, but still homes in on the true mean.

What students say

“Nicky is an excellent econometrics tutor. He explains complex concepts clearly and makes them much easier to understand.”
Charles GardnerGoogle review
“I was completely lost in my economics class, and then I started working Nicky and he totally saved me. He was excellent at explaining the material and extremely accommodating to meet with me many times despite us being in different time zones! Highly recommend working with Nicky!”
Claire ChouGoogle review
“Nicky is a very good and thorough teacher. He has excellent knowledge of econometrics and takes the time to work through your questions. Highly recommended!”
ChrisEconometrics · 22/08
“Really great tutor! Encouraging, knowledgeable, friendly”
JedEconometrics · 09/02
“Very good lesson, Nicky is very helpful.”
ChrisEconometrics · 19/08
“Very helpful and clear.”
ClaireEconometrics · 22/01
“I gather it was very useful, thank you!”
ClaireEconometrics · 12/01
“Fantastic!”
JedEconometrics · 11/02
123μ = 2150100150200240sample size n
n = 1

Running sample mean \(\bar Y_n\) of a stationary autoregressive series with true mean \(\mu=2\). Even though each observation depends on the last, the average still converges to the dashed line. Press play or drag the slider.

The catch: autocorrelation slows things down

Convergence still happens, but positive autocorrelation makes it slower. Intuitively, if each observation largely repeats the last, then \(n\) autocorrelated points carry less fresh information than \(n\) independent ones, your effective sample size is smaller. The right measure of the sample mean's variance is no longer \(\sigma^2/n\) but the long-run variance, which adds up all the autocovariances:

$$\operatorname{Var}(\bar Y_n)\approx \frac{1}{n}\Big(\gamma_0+2\sum_{k=1}^{\infty}\gamma_k\Big),\qquad \gamma_k=\operatorname{Cov}(Y_t,Y_{t-k}).$$

With positive autocorrelation the extra \(\gamma_k\) terms are positive, inflating the variance relative to the independent case. This is why honest time-series inference uses HAC (Newey–West) standard errors that estimate this long-run variance, otherwise you overstate how much you know.

Intuition

Ten opinions from ten strangers tell you more than ten opinions from one person repeated with small edits. Autocorrelated data are closer to the second case: each point echoes the last, so a run of them is worth fewer "independent" observations than its length suggests.

The warning: non-stationarity breaks it

Everything above needs stationarity. If the series has a unit root or a trend (\(\phi=1\), a random walk), the mean is not even well defined over time and the sample mean does not converge to anything fixed, averaging is meaningless. Distinguishing stationary from non-stationary series is therefore the first question in any time-series analysis, and the subject of the time series econometrics notes on stationarity and unit roots.

Check your understanding

Why can't we use \(\operatorname{Var}(\bar Y_n)=\sigma^2/n\) for autocorrelated data?

That formula drops the covariance cross-terms in the variance of a sum, which is only valid under independence. With autocorrelation the \(\gamma_k=\operatorname{Cov}(Y_t,Y_{t-k})\) terms are non-zero, so the correct variance is the long-run variance that sums them.

Positive autocorrelation makes the effective sample size larger or smaller than \(n\)?

Smaller. Each observation partly repeats the previous one, so a stretch of \(n\) autocorrelated points carries less independent information; convergence is slower and standard errors are larger than the naive \(\sigma/\sqrt n\).

For which value of \(\phi\) does the sample mean stop converging to a fixed number?

\(\phi=1\) (a random walk / unit root). The series is then non-stationary, the mean drifts, and \(\bar Y_n\) does not settle on any fixed \(\mu\).

Related notes

Learning this for a
course or exam?

I tutor statistics and econometrics from first principles through to postgraduate level, with worked examples at your pace. The first consultation is free.

Book a consultation How sessions work & pricing
Free 30-min consultationNo obligation · reply within one business day
Book now