Quant

Time series and econometrics

Work with AR (autoregressive) and MA (moving average) models, spot unit roots and spurious regressions, test cointegration for pairs trades, model volatility clustering and avoid the backtest traps.

Read first: Statistics and machine learning

7 concepts8 min read25-question test, from a bank of 33Updated

Concept 1 of 71 min

AR(1): mean, variance, forecasts and half-life

The rule
An AR(1) process xt = c + φ xt−1 + εt with |φ| < 1 has a long-run mean of c ÷ (1 − φ).
Worked examples

Forecasts fade towards the mean

Given
Mean0
φ0.6
x today8
  1. 1 step: 8 × 0.6 = 4.8
  2. 2 steps: 4.8 × 0.6 = 2.88
  3. 3 steps: 2.88 × 0.6 ≈ 1.73

Each step keeps 60% of the gap to the mean.

Long-run mean and variance

Given
Constant1
φ0.6
Var(ε)2
  1. Mean = 1 ÷ (1 − 0.6) = 2.5
  2. Variance = 2 ÷ (1 − 0.62) = 3.125

The mean is 2.5, not the constant 1, and the variance is 3.125, not 5.

The picture
Formula
Mean=c ÷ (1 − φ)
variance=σ² ÷ (1 − φ²)
forecast k steps ahead: mean + φk × (x − mean)
half-life=ln 0.5 ÷ ln φ
Why it holds

Its variance is σ² ÷ (1 − φ²) and its lag-k autocorrelation φk.

Its forecasts shrink the gap to the mean by φ each step, and its half-life is ln 0.5 ÷ ln φ, or ln 2 ÷ θ for a continuous Ornstein-Uhlenbeck process. The constant is not the mean: in equilibrium the mean equals c plus φ times itself.

Dividing σ² by 1 − φ instead of 1 − φ² confuses the variance with the mean formula. The mean lag 1/(1 − φ) is not the half-life.

Pairs traders size their holding periods on the half-life of the spread's mean reversion. Each step ahead keeps a share φ of today's gap to the mean, so forecasts fade geometrically towards it.

Watch out
  • Taking the constant as the mean.
  • Dividing by 1 − φ for the variance.
  • Quoting the mean lag 1/(1 − φ) as the half-life.
In the interview
  1. A spread between 2 related assets mean-reverts. How would you estimate how long a trade on it should last?

    A complete answer covers

    • Fit an AR(1), or an Ornstein-Uhlenbeck process, to the spread.
    • The half-life is ln 0.5 ÷ ln φ, or ln 2 ÷ θ.
    • Size the holding period and stop-loss on it.
    • Check that the coefficient is stable over time, not a feature of one period.

Also in our technical interviews, on camera, with a score.

Concept 2 of 71 min

Reading autocorrelation: ACF, PACF and tests

The rule
An MA(q) process's autocorrelation function (ACF) cuts off after q lags, and an AR(p)'s partial autocorrelation function (PACF) after p lags.

The why, the charts, the worked example and the interview questions are in Essentials, with every quiz.

See the plansSign in

Concept 3 of 71 min

Unit roots and stationarity

The rule
When φ = 1 in an AR(1) the series has a unit root: a random walk whose shocks are permanent and whose variance grows with time.

The why, the charts, the worked example and the interview questions are in Essentials, with every quiz.

See the plansSign in

Concept 4 of 71 min

Cointegration and spurious regressions

The rule
2 non-stationary series are cointegrated when a linear combination of them is stationary, which the Engle-Granger method tests on the regression's residual.

The why, the charts, the worked example and the interview questions are in Essentials, with every quiz.

See the plansSign in

Concept 5 of 71 min

Volatility clustering: GARCH and EWMA

The rule
Volatility clustering, large moves following large moves, is modelled on the variance with GARCH (generalised autoregressive conditional heteroskedasticity), whose long-run variance is ω ÷ (1 − α − β).

The why, the charts, the worked example and the interview questions are in Essentials, with every quiz.

See the plansSign in

Concept 6 of 71 min

Backtest pitfalls and forecast errors

The rule
Overlapping return windows make observations autocorrelated, so standard errors look too small unless corrected.

The why, the charts, the worked example and the interview questions are in Essentials, with every quiz.

See the plansSign in

Concept 7 of 71 min

AdvancedHow a GARCH forecast slopes back after a shock

The rule
A GARCH(1,1) variance forecast k days ahead is the long-run variance plus today's gap to it shrunk by (α + β) to the power k.

The why, the charts, the worked example and the interview questions are in Essentials, with every quiz.

See the plansSign in

Recap

  • AR(1) xt = c + φ xt−1 + ε: mean c ÷ (1 − φ), variance σ² ÷ (1 − φ²), lag-k autocorrelation φk, half-life ln 0.5 ÷ ln φ.
  • φ = 1 is a unit root: a random walk whose variance grows with time; test it with Dickey-Fuller and difference it.
  • Regressing one trending series on another produces spurious fits; cointegration means a stationary spread.
  • GARCH captures volatility clustering; its long-run variance is ω ÷ (1 − α − β); EWMA (exponentially weighted moving average) weights the newest return 1 − λ.
  • Overlapping returns, full-sample means and unknown breaks make backtests look better than they are.
Now test it

25 questions on Time series and econometrics

Timed, like the real one, drawn from a bank of 33. Every answer explained.

Test yourself →