Part III · Models · Chapter 3B

Mean reversion and momentum

The AR(1) model

Where we are

Chapter 3A defined a trading model and how to test one honestly. This chapter builds the most basic model worth studying, a regression of each period's return on the one before. Its single weight answers the question every trading system has to answer: does the next move continue the last one, or reverse it?

What you need first
  • Log returns and the square-root-of-time rule (Chapter 1A).
  • Correlation (Chapter 1F).
  • Base rates, standard errors and walk-forward testing (Chapter 3A).
In plain terms

Under momentum a move tends to be followed by another in the same direction, while under mean reversion it tends to be followed by a move back. One number, the weight a model puts on the last return, tells them apart from each other and from a random walk. In real markets that number is small, specific to a horizon and liable to change sign when calm turns to stress.

1 · The AR(1) model

The most basic useful model is an autoregressive linear regression of order one, or AR(1) model. The series is regressed on its own past (autoregressive) at a single lag (order one). It captures the two most fundamental trading behaviors, mean reversion and momentum, by predicting the next log return as a linear function of the previous one:

r^t=w rt−1+b \hat{r}_t = w\,r_{t-1} + b (3B.1)

Here rt−1r_{t-1} is the last period's log return and r^t\hat{r}_t the prediction for the current period. The weight ww and the bias bb are the model's only two parameters. The sign of ww determines everything. The actual return is the prediction plus a fresh shock:

rt=w rt−1+b+εt r_t = w\,r_{t-1} + b + \varepsilon_t (3B.2)

The innovation εt\varepsilon_t is a random shock with mean zero and standard deviation σ\sigma, independent of everything before it. Chapter 1G wrote the same equation for the decay of a pricing error, using ϕ\phi (phi), the usual statistical letter, in place of ww. The first figure below uses ϕ\phi too.

With w=−0.05w = -0.05 and b=0b = 0, a day that rose 1% predicts −0.05×1%=−0.05%-0.05 \times 1\% = -0.05\% for the next. Adding a hypothetical daily drift of b=0.03%b = 0.03\% makes the prediction −0.05%+0.03%=−0.02%-0.05\% + 0.03\% = -0.02\%.

2 · Three regimes

A negative weight, w<0w < 0, means mean reversion. It flips the sign of the lag, so a positive return predicts a negative one and a negative return predicts a positive one: "what goes up must come down". This regime is common at second-to-minute timescales in liquid markets, where dealer mean reversion (from gamma hedging) and microstructure noise (the bid-ask bounce) dominate. It is also common at multi-week timescales for individual equities and indices, where overreaction followed by correction recurs.

A positive weight, w>0w > 0, means momentum. It reinforces the sign: "what goes up keeps going up". This regime is most common at intermediate timescales of weeks to months, across asset classes. It is the empirical foundation of decades of trend following research. It also underlies factor strategies like Jegadeesh-Titman 12-1 momentum, from Jegadeesh and Titman (1993, Journal of Finance), which ranks stocks by their past 12-month return excluding the latest month (Chapter 10F). Hurst, Ooi and Pedersen (2017, Journal of Portfolio Management) have documented cross-asset trend in 140+ years of data.

A weight near zero, w≈0w \approx 0, means a random walk. The next return is independent of the previous one, so the model has no predictive content. This is the efficient market hypothesis in its weakest form, a good approximation at most timescales for most liquid markets. Trade fees, slippage and adverse selection eat any strategy that operates in this regime.

3 · How far the paths spread

A process is stationary when its statistical behavior does not drift over time: its variance stays bounded, its distribution holds steady and forecasts far ahead converge to the long-run mean. Take the variance of both sides of (3B.2), writing VV for the variance of each return. Because εt\varepsilon_t is independent of rt−1r_{t-1}, their variances add, so a stationary VV must satisfy V=w2V+σ2V = w^2 V + \sigma^2:

V=σ21−w2 V = \frac{\sigma^2}{1 - w^2} (3B.3)

With σ=1%\sigma = 1\% and w=0.5w = 0.5, V=1/0.75=1.33V = 1/0.75 = 1.33 in squared percent, a standard deviation of 1.15% a period. A positive answer exists only when ∣w∣<1|w| < 1, which is the condition for stationarity. As ww approaches either +1 or −1, VV grows without limit.

What a position lives through, though, is the accumulated return, the price path, where the two ends behave in opposite ways. Over nn periods the standard deviation of the summed returns is approximately

sd(∑t=1nrt)≈σn1−w \text{sd}\Big(\sum_{t=1}^{n} r_t\Big) \approx \frac{\sigma\sqrt{n}}{1 - w} (3B.4)

A random walk, with w=0w = 0, gives the square-root-of-time rule of Chapter 1A. As ww approaches +1 the denominator shrinks toward zero and the paths fan out without limit. As ww approaches −1 the denominator approaches 2 and the paths draw in, because each return is largely undone by the next.

Where the spread of the paths comes from

Step 1: add up the process. Sum (3B.2) over t=1t = 1 to nn, with b=0b = 0 and Sn=r1+⋯+rnS_n = r_1 + \cdots + r_n:

Sn=w∑t=1nrt−1+∑t=1nεt S_n = w\sum_{t=1}^{n} r_{t-1} + \sum_{t=1}^{n} \varepsilon_t (3B.5)

Step 2: rewrite the lagged sum. The sum of r0r_0 to rn−1r_{n-1} is Sn−rn+r0S_n - r_n + r_0. Substituting it and collecting SnS_n on the left gives

(1−w) Sn=∑t=1nεt+w (r0−rn) (1 - w)\,S_n = \sum_{t=1}^{n} \varepsilon_t + w\,(r_0 - r_n) (3B.6)

Step 3: drop the small term. For a stationary process, r0r_0 and rnr_n are single returns of fixed size, while the sum of nn shocks keeps growing. Over a long horizon, Sn≈∑εt/(1−w)S_n \approx \sum \varepsilon_t / (1 - w).

Step 4: take the standard deviation. The nn independent shocks sum to a standard deviation of σn\sigma\sqrt{n}. Dividing by 1−w1 - w gives (3B.4).

Over a year of 250 steps with σ=1%\sigma = 1\%, (3B.4) gives 1%×250=15.8%1\% \times \sqrt{250} = 15.8\% for a random walk. At w=0.9w = 0.9 it gives 15.8%/0.1=158%15.8\%/0.1 = 158\%, and at w=−0.9w = -0.9 it gives 15.8%/1.9=8.3%15.8\%/1.9 = 8.3\%.

The figure below simulates price paths whose log returns follow the AR(1) process, all starting at 100, under four controls:

  • Weight φ, from −0.9 to 0.95, starting at 0.
  • Innovation vol σ, from 0.5% to 5%, starting at 1%.
  • Steps per path, from 100 to 500, starting at 250.
  • Paths, 10, 50 or 200, starting at 50, with a seed starting at 42 and a button that regenerates them.

The readouts estimate the lag-1 autocorrelation and the Hurst exponent, both defined below, from the first path, and a verdict names the regime. The verdict reads random walk for φ from −0.3 to 0.3, momentum above 0.3, near-non-stationary from 0.85, and mean reversion below −0.3. Drag φ to 0.9, then to −0.9, to compare how far the paths spread.

0.00
1.0%
250
empirical ρ (lag 1) = −0.079
Hurst H (path 0) = 0.45
|φ| = 0.00

Random walk regime. Near-zero autocorrelation. The next move is statistically independent of the last. No exploitable signal at this horizon. Frictions (spread, slippage) will eat any attempted strategy operating here.

One weight, three regimes. Simulated price paths whose log returns follow an AR(1) process, rt = φ × rt−1 + εt, with innovations of volatility σ, all starting at 100. Push φ toward 1 and the paths fan out; push it negative and they stay closer to their start than a random walk does. The readouts estimate the lag-1 autocorrelation and the Hurst exponent from the first path.

At the starting settings the paths span roughly 73 to 157. At φ = 0.9 they span about 6 to 7,000, while at φ = −0.9 they stay between about 84 and 129. Measured across the 50 paths, the standard deviations of the final log prices are 0.158, 1.57 and 0.085, as (3B.4) predicts.

Two readouts deserve a second look. At φ = 0 the estimated autocorrelation is −0.079 rather than zero, which is sampling noise, as the next section explains. At φ = −0.9 the Hurst estimate is −0.10, outside the range of zero to one that a true Hurst exponent occupies. The readout estimates it from the variance ratio at a lag of only 8 steps.

4 · Reading a fitted weight

The weight in a fitted AR(1) is interpretable as the first-order autocorrelation of returns, the correlation between each return and the one before it:

w≈Corr(rt,rt−1) w \approx \text{Corr}(r_t, r_{t-1}) (3B.7)

A fitted weight is a regression slope, the covariance of rtr_t and rt−1r_{t-1} divided by the variance of rt−1r_{t-1}, as Chapter 3C derives. For a stationary series the two returns have the same variance, so the slope equals the correlation.

A weight of −0.05 means returns are weakly mean-reverting: a 1% up move predicts roughly a 0.05% down move on average. A weight of +0.10 means returns are weakly momentum-driven. The magnitude tells you the predictive content, which in financial markets is small. Typical first-order autocorrelations of daily SPX returns lie between −0.05 and +0.05, with most of the absolute value coming from microstructure noise rather than fundamental signal.

Worked example: How many days it takes to see an autocorrelation of 0.05

Step 1: the standard error. With no true autocorrelation, the estimate from nn returns has a standard error of about 1/n1/\sqrt{n}. A year of 250 daily returns gives 1/250=0.0631/\sqrt{250} = 0.063, more than the 0.05 you are trying to detect.

Step 2: the sample size. To detect a true 0.05 with 80% power at a two-sided 5% level, you need n=(1.96+0.84)2/0.052=3,136n = (1.96 + 0.84)^2/0.05^2 = 3{,}136 days, about 12 years of trading.

Like the sample size calculation you would do before a trial, it shows why a weight fitted to a year or two of daily data is mostly noise.

Where the noise comes from: the bid-ask bounce

Much of the small negative autocorrelation in short-horizon returns is manufactured by the way prices are recorded. Trades print at the bid or at the ask, so a recorded price jumps between the two even when the value between them has not moved (Chapter 2C).

Suppose a stock's value sits at $100.00, with a bid of $99.95 and an ask of $100.05, while each trade prints at one or the other at random. The recorded price is then the value plus an error of ±$0.05, with some variance s2s^2. Each recorded change is the difference of two errors, with variance 2s22s^2. Consecutive changes share one error with opposite signs, which gives them a covariance of −s2-s^2. Their correlation is therefore −s2/2s2=−0.5-s^2/2s^2 = -0.5: strong apparent mean reversion in a price that never moved.

Real moves dilute the effect. If the value also moves with variance σ2\sigma^2 a period, the autocorrelation becomes −s2/(σ2+2s2)-s^2/(\sigma^2 + 2s^2). With a half-spread of 0.05% and a hypothetical volatility of 0.03% a minute, that is −0.0025/0.0059=−0.42-0.0025/0.0059 = -0.42. With a daily volatility of 1% it is −0.0025/1.005=−0.0025-0.0025/1.005 = -0.0025, so the bounce that dominates minute returns is invisible in daily ones. Nor can you trade it, because capturing it means buying at the bid and selling at the ask, which is the market maker's business rather than the taker's.

This is regression to the mean from measurement error, the pattern of a stable tumor marker measured with independent assay error: successive visit-to-visit changes correlate at −0.5 while the true level never moves.

5 · The Hurst exponent and the variance ratio test

A more powerful way to detect mean reversion or momentum than fitting an AR(1) is to compute the Hurst exponent HH of the return series. It measures how variance scales with the time horizon. Over kk periods, where ∝\propto means "proportional to",

Var⁡(∑t=1krt)∝k2H \operatorname{Var}\Big(\sum_{t=1}^{k} r_t\Big) \propto k^{2H} (3B.8)

For a random walk (no autocorrelation) H=0.5H = 0.5, so 2H=12H = 1 and variance scales linearly with time. For mean-reverting series H<0.5H < 0.5: variance grows more slowly than linearly because reversals shrink the cumulative move. For momentum-driven (persistent) series H>0.5H > 0.5: variance grows faster than linearly because trends compound.

The related variance ratio test of Lo and MacKinlay (1988, Review of Financial Studies) formalizes this into a statistical test of the random-walk null hypothesis. The variance ratio at lag kk is

VR(k)=Var⁡(rt+⋯+rt+k−1)kVar⁡(rt) \text{VR}(k) = \frac{\operatorname{Var}(r_t + \cdots + r_{t+k-1})}{k \operatorname{Var}(r_t)} (3B.9)

Under the random-walk null, VR(k)=1\text{VR}(k) = 1 for all kk. A ratio above 1 indicates momentum and a ratio below 1 mean reversion. The ratio also says how wrong the square-root-of-time rule is, since the true kk-period standard deviation is kV\sqrt{kV} times VR(k)\sqrt{\text{VR}(k)}. The two measures are linked: if variance scales as k2Hk^{2H}, then VR(k)=k2H−1\text{VR}(k) = k^{2H-1}, which is how the figure above estimates HH.

The two-period ratio is easy to work out. For any stationary series with variance VV and lag-1 autocorrelation ρ1\rho_1, a two-period sum has variance V+V+2ρ1VV + V + 2\rho_1 V, so dividing by 2V2V gives VR(2)=1+ρ1\text{VR}(2) = 1 + \rho_1. A weight of −0.05 gives 0.95 and a weight of +0.10 gives 1.10. For an AR(1) the ratio settles at long lags to (1+w)/(1−w)(1 + w)/(1 - w), which is 0.905 and 1.22 for the same two weights.

Lo and MacKinlay's 1988 paper found significant momentum in weekly US stock returns, with variance ratios above 1 at lags of 1 to 4 weeks, which challenged the random-walk hypothesis on those horizons. Tools like these are how the academic literature has built robust statistical support for mean reversion at very short and very long horizons, and for momentum at intermediate ones. The retail trader who claims "I'm a mean reversion guy" is making a horizon-specific assumption without perhaps realizing it.

The figure below returns to the one-step prediction of (3B.1). The solid line is sixty synthetic returns from an AR(1) with a true weight of −0.55 (mean reversion) or +0.55 (momentum). The dashed line is the prediction made with the weight and bias you set. You choose the true regime and set the weight ww from −1.5 to 1.5, the bias bb from −0.005 to 0.005 and a seed from 1 to 30, starting at mean reversion, −0.6, 0 and 7. The readouts give the sign of your weight, the true regime and the directional accuracy, the share of steps on which the prediction and the return have the same sign. Sweep the weight across zero, then switch the regime.

−0.60
0.0000
#7
weight sign = mean reversion
true regime = mean reversion
directional accuracy = 66.1%
The sign of w is the regime. The solid line is sixty synthetic returns from an AR(1) with a true weight of −0.55 (mean reversion) or +0.55 (momentum), drawn from the chosen seed; the dashed line is the one-step prediction ŷt = w × rt−1 + b made with the weight and bias on the sliders. Directional accuracy is the share of steps on which the prediction and the return have the same sign. With b at zero only the sign of w moves it: on the default returns any negative weight scores 66.1% and any positive one 32.2%.

With the bias at zero, only the sign of ww moves the accuracy: any negative weight scores 66.1% on the default returns, and any positive one 32.2%. Under momentum, positive weights score 62.7% and negative ones 35.6%. With ww at zero and bb nudged up to 0.001, the model predicts "up" at every step and scores 57.6%, the share of up steps: the base rate of Chapter 3A.

Directional accuracy ignores magnitude, unlike the squared error that Chapter 3C minimizes. The least-squares weight for the default returns is −0.58, close to the true −0.55, while across the 30 seeds it runs from −0.77 to −0.35. Sixty returns pin down even a large weight only roughly.

6 · Why AR(1) is the right starting point

You do not get rich on AR(1) alone. The reason to learn it is pedagogical. It is the most basic non-trivial model that captures the essential question every trading system must answer: do you expect the next move to continue the current move (momentum) or reverse it (mean reversion)? Every more sophisticated model refines this question:

  • ARMA models add moving-average residual terms, which carry past shocks forward.
  • ARIMA models handle non-stationarity.
  • GARCH models add time-varying volatility.
  • Kalman filters add inference about a hidden state.
  • Hidden Markov models add switching between discrete regimes.
  • LSTMs and transformers, two kinds of neural network, add nonlinear interactions across time.

All of them, in their cleanest formulation, answer some version of "given what has happened, what comes next?" The most basic answer is a weighted combination of recent values. Start with AR(1), adding complexity only when the residuals demand it.

7 · The regime problem

The most important practical issue with AR(1) and its descendants is that the sign of ww changes over time. SPX intraday autocorrelation in calm regimes is mildly negative. That is mean reversion, courtesy of positive-gamma dealer hedging, in which dealers sell into rallies and buy into falls (Part VI shows why). In stress regimes intraday autocorrelation flips positive: momentum, courtesy of negative-gamma dealer hedging that amplifies moves. A static AR(1) fitted to all available data averages across these regimes and produces an estimated ww near zero, which belongs to neither regime and predicts nothing.

Worked example: Two regimes that cancel

Step 1: the regimes. Suppose 80% of days are calm, with w=−0.2w = -0.2 and a return variance of VV, while the other 20% are stressed, with w=+0.2w = +0.2 and a variance of 4V4V.

Step 2: the pooled slope. A single regression divides the pooled covariance by the pooled variance. The covariance is 0.8×(−0.2V)+0.2×(0.2×4V)=−0.16V+0.16V=00.8 \times (-0.2V) + 0.2 \times (0.2 \times 4V) = -0.16V + 0.16V = 0, so two real, opposite effects produce a fitted weight of exactly zero.

The fix is regime-conditional modeling: fit one AR(1) for calm regimes and another for stress regimes, with a classifier that identifies which regime is in force. This is the essence of regime-switching models and the foundation of every serious quant trading framework. Chapter 8D returns to it with positive and negative gamma exposure (GEX) as the regime indicator, and Chapter 11G with the composite regime scorecard.

Familiar ground

The regime problem is a qualitative interaction. A drug that helps one biomarker-defined subgroup and harms another can show a null effect in the whole trial, just as the pooled weight shows zero. The remedy is the same in both fields: define the subgroup, or the regime classifier, in advance and test it out of sample. A classifier tuned until the two fitted weights differ is a subgroup analysis rerun until one comes out significant.

In practice
  • Fit at the horizon you intend to trade, since the weight at one minute says nothing about the weight at one month.
  • Report the weight with its standard error, about 1/n1/\sqrt{n}, before believing it.
  • Discount short-horizon mean reversion for the bid-ask bounce, which a trader who crosses the spread cannot capture.
When it fails

An AR(1) fitted in one regime fails when the regime changes. The sign of the weight can flip exactly when the stakes are highest, as stress arrives. A weight near zero may mean either a random walk or two regimes cancelling, which the fit alone cannot tell apart.

Decision rule
  • Trade a weight only if it is several standard errors from zero out of sample, at the horizon you trade, with a predicted move larger than the round-trip cost.
  • Condition on the regime before trusting any fitted weight on SPX, with calm and stress fitted separately and the classifier fixed in advance.
Common mistake: "I am a mean reversion trader"

Mean reversion and momentum are properties of a horizon, not of a market or a personality. The same index can revert over minutes, trend over months and revert again over years. Name the horizon and measure the weight or the variance ratio there, then measure it again when the regime changes.

What to carry forward
  • The AR(1) model predicts r^t=w rt−1+b\hat{r}_t = w\,r_{t-1} + b. A negative weight means mean reversion, a positive one momentum and a weight near zero a random walk.
  • Price paths spread by about σn/(1−w)\sigma\sqrt{n}/(1-w), so they fan out as ww approaches +1 and draw in as it approaches −1.
  • The fitted weight is the lag-1 autocorrelation. On daily SPX it is too small for a year of data to measure, given a standard error of about 1/n1/\sqrt{n}.
  • The sign of the weight changes between calm and stress, so a pooled fit can show zero where two real effects cancel. Model the regime instead.

8 · Check yourself

Question 1

A fitted AR(1) on 1,260 daily returns gives w=−0.08w = -0.08 and b=0b = 0. What does it predict after a 2% rise? Is the weight distinguishable from zero?

Answer

After a 2% rise it predicts −0.08×2%=−0.16%-0.08 \times 2\% = -0.16\%. The standard error is about 1/1,260=0.0281/\sqrt{1{,}260} = 0.028, which puts the weight about 2.8 standard errors from zero. That is distinguishable in sample, though the weight must still survive walk-forward testing and a 0.16% expected move must still beat the round-trip cost.

Question 2

With σ=1%\sigma = 1\% a day and w=0.6w = 0.6, what is the standard deviation of a single return? What is it for the price path over 100 days?

Answer

By (3B.3), V=1/(1−0.36)=1.5625V = 1/(1 - 0.36) = 1.5625, a standard deviation of 1.25% a day. By (3B.4), the 100-day spread is about 1%×10/0.4=25%1\% \times 10/0.4 = 25\%, against 10% for a random walk.

Question 3

A two-day variance ratio comes out at 0.90. What lag-1 autocorrelation does that imply, and which regime?

Answer

Since VR(2)=1+ρ1\text{VR}(2) = 1 + \rho_1, the autocorrelation is −0.10, which is mean reversion at a one-day horizon.