Quantitative Methods · Methods
17Linear Time Series
The spread between the ten-year and the two-year Treasury yields, the 2s10s that a steepener trades, has a daily autocorrelation of 0.9987 over fifty years. A regression of tomorrow’s spread on today’s gives a slope of 0.99875 with a standard error of 0.00045: a -statistic of against a slope of one, a one-sided -value of 0.003 by the normal table. The spread seems to mean-revert, with a half-life of 552 trading days. But if the spread had a unit root, the normal table would be the wrong one: the right one puts the 5% critical value at , and the evidence falls short. This chapter is about the models that describe such series and the tests that tell them apart: stationarity and the autocorrelation function, autoregressive and moving-average models, the spectral view, unit roots and the regressions they make spurious, and long memory.
17.1 Stationarity and autocorrelation
Definition 17.1 (Stationary process, weak stationarity, white noise)
A process is a stationary process (strictly) if the joint law of does not depend on . It has weak stationarity if its mean is constant and depends only on . White noise is a weakly stationary sequence with mean zero and no autocorrelation at any nonzero lag.
Definition 17.2 (Autocovariance, autocorrelation and partial autocorrelation functions)
For a weakly stationary process, the autocovariance function is , and the autocorrelation function is . The partial autocorrelation function at lag is the last coefficient of the best linear predictor of from : the correlation at lag once the intermediate lags are accounted for.
Under white noise the sample autocorrelations are approximately independent , whence the bands of every correlogram. The decomposition that justifies the models of the next section is Wold’s (1938): every weakly stationary, purely nondeterministic process is an infinite moving average of its one-step prediction errors , a white noise, with and .
The 2s10s spread’s correlogram (Figure 17.1) is the signature of a nearly nonstationary level: autocorrelations that start at 0.9987 and fall almost linearly over a year of lags. Its daily changes are nearly white noise, with a standard deviation of 4.6 basis points and autocorrelations of 0.015, 0.015 and at the first three lags, within the band for the first two.
17.2 Autoregressive and moving-average models
Definition 17.3 (Autoregressive, moving-average and ARMA processes)
With white noise of variance : an autoregressive process of order , AR(), satisfies ; a moving-average process of order , MA(), is ; an ARMA process combines them, with , and the lag operator.
Proposition 17.4 (Stationarity and invertibility of ARMA)
The ARMA equation has a unique weakly stationary causal solution if and only if every root of lies outside the unit circle; it is invertible, up to a constant, if and only if every root of does, the polynomials having no common root.
Proof. Factor . For , is an absolutely summable filter, so has summable coefficients and defines the solution; if some no summable causal inverse exists (for , none at all). The MA side is the same argument applied to . ∎
For the AR(1) , the condition is , the autocorrelations are , and a deviation from the mean decays by half in periods, the half-life of chapter 4’s Ornstein–Uhlenbeck process sampled daily. An AR() has a partial autocorrelation function that cuts off after lag ; an MA() has an autocorrelation function that cuts off after lag . The orders are chosen by an information criterion.
Definition 17.5 (Information criterion)
An information criterion ranks models by fit penalised for size: Akaike’s and Schwarz’s , for maximised log-likelihood and parameters; the smallest wins.
AIC aims at prediction and tends to choose large models; BIC is consistent for the true order when there is one. On the 2s10s daily changes AIC chooses an AR(10) whose coefficients are all below 0.035 in absolute value: statistically detectable with 12 574 days, economically nothing.
17.3 The spectral view
Definition 17.6 (Spectral density, periodogram)
The spectral density of a weakly stationary process with summable autocovariances is , : the decomposition of its variance by frequency, . The periodogram at the Fourier frequencies is its sample counterpart.
White noise has a flat spectrum, ; an AR(1) with near one concentrates its variance at low frequencies, . The periodogram is asymptotically unbiased but not consistent: each ordinate is approximately times an exponential variable, however long the sample, so it must be smoothed or averaged. Its low-frequency end is where persistence shows, and it is the basis of the long-memory estimate of the last section. is, up to , the long-run variance of chapter 11.
17.4 Unit roots
Definition 17.7 (Unit root, spurious regression)
A process has a unit root if its autoregressive polynomial has a root at : its first difference is stationary but the level is not, like a random walk. A spurious regression is a regression between independent processes with unit roots whose usual -statistics and indicate a relation that does not exist.
Granger and Newbold (1974) showed the problem by simulation, and it is easy to repeat: regressing one random walk of 500 steps on another, independent one, the slope’s -statistic exceeds 1.96 in absolute value in 89% of 5 000 trials, with a median of 0.17. The residual inherits the unit root, the observations are not independent, and every formula that assumed they were is wrong. The same failure hits the test of itself.
Definition 17.8 (Dickey–Fuller test)
The Dickey–Fuller test of a unit root regresses on (with a constant, and a trend if wanted) and compares the -statistic of the coefficient on with the Dickey–Fuller distribution rather than the normal; the augmented version adds lagged differences to absorb short-run dependence (Said and Dickey, 1984).
Under the unit root and with a constant, converges to for a standard Brownian motion , a functional that is neither normal nor centred at zero (Figure 17.2). Its quantiles have no closed form; MacKinnon’s (2010) response surfaces give the 1%, 5% and 10% critical values , and for large samples. The chapter’s own simulation of 20 000 random walks of 500 steps gives , and , against MacKinnon’s , and at that length.
For the 2s10s spread, with no lagged differences: not significant at 5%, significant at 10%. The augmented test depends on the lags: with five, with ten, with twenty; AIC, searching up to forty, chooses 34 and . On the sample since 1990 the Dickey–Fuller statistic is . The honest reading is that the data cannot decide: the spread mean-reverts too slowly for fifty years of daily data to tell it from a random walk.
Proposition 17.9 (Kendall’s bias of the AR(1) coefficient)
For a stationary AR(1) with an estimated mean, the least-squares coefficient satisfies (Kendall, 1954).
The bias is small in the coefficient and large in the half-life, because the half-life divides by , close to zero. The spread’s estimate 0.99875, corrected by , becomes 0.99906, and the half-life grows from 552 trading days (2.2 years) to 739 (2.9 years). The correction is an average: simulating 4 000 histories of 12 574 days from an AR(1) with , the estimated half-life has median 576 days and a 10–90% range of 352 to 969 days (Figure 17.3), and in 57% of the histories the Dickey–Fuller test does not reject the unit root at 5%, although there is none.
17.5 Long memory
Definition 17.10 (Long memory, fractional differencing, Hurst exponent)
A stationary process has long memory if its autocorrelations decay like a power, with , so that they are not summable. Fractional differencing applies with , ; the ARFIMA process is (Granger and Joyeux, 1980; Hosking, 1981). The Hurst exponent is , measured by the growth of ranges or variances of partial sums like (Hurst, 1951).
Definition 17.11 (Fractional Brownian motion)
Fractional Brownian motion with Hurst exponent is the centred Gaussian process with and (Mandelbrot and Van Ness, 1968). For it is Brownian motion; for its increments are positively correlated with power-law decay, for negatively.
For fractional Brownian motion is not a semimartingale, so the Itô calculus of chapter 3 does not apply to it, and a price that followed it would admit arbitrage; it is a model for volatility and for slowly mean-reverting quantities, not for prices. The difference between long and short memory is in the tail of the correlogram (Figure 17.4): an ARFIMA with and an AR(1) with the same first autocorrelation, 0.41, differ by a factor of a thousand at lag 10. On 20 000 simulated observations the rescaled-range estimate of is 0.78 and the log-periodogram (Geweke–Porter-Hudak) estimate 0.71, for a true 0.8; on white noise they give 0.53 and 0.46, the rescaled range being biased upward in short blocks.
The spread’s daily changes give a log-periodogram estimate from the lowest frequencies, that is with a standard error of : the changes are over-differenced, and the level behaves like a fractionally integrated process with , mean reverting in the long run but with hyperbolic rather than geometric decay. That is one reason AR(1) half-lives of the spread are unstable across samples: the AR(1) is the wrong shape of memory.
17.6 Tutorial: the half-life of a spread
Goal. Estimate the 2s10s spread’s persistence three ways and decide what the data can say about a unit root. End state: Figures 17.1, 17.2 and 17.3; the half-lives 552 and 739 days and the Dickey–Fuller statistics.
The AR(1) with its half-life and Kendall’s correction.
def ar1(x) -> dict: """OLS of x_t on (1, x_{t-1}); half-life ln(1/2)/ln(rho); Kendall's correction rho + (1 + 3 rho)/n.""" x = np.asarray(x, dtype=float) n = x.size X = np.column_stack([np.ones(n - 1), x[:-1]]) b, *_ = np.linalg.lstsq(X, x[1:], rcond=None) e = x[1:] - X @ b s2 = float(e @ e) / (n - 3) xc = x[:-1] - x[:-1].mean() se = math.sqrt(s2 / float(xc @ xc)) rho = float(b[1]) rk = rho + (1 + 3 * rho) / n def hl(r): return math.log(0.5) / math.log(r) if 0 < r < 1 else math.inf return {"rho": rho, "se": se, "t_unit": (rho - 1) / se, "c": float(b[0]), "sigma": math.sqrt(s2), "half_life": hl(rho), "rho_kendall": rk, "half_life_kendall": hl(rk), "n": n}Listing 17.1. AR(1) by least squares, half-life and bias correction. code/firm/tsa/firm_tsa.py The augmented Dickey–Fuller regression and MacKinnon’s critical values.
def _adf_reg(x, lags, trend): dx = np.diff(x) n = dx.size - lags cols = [x[lags:-1]] if trend in ("c", "ct"): cols.append(np.ones(n)) if trend == "ct": cols.append(np.arange(n, dtype=float)) for k in range(1, lags + 1): cols.append(dx[lags - k: dx.size - k]) X = np.column_stack(cols) y = dx[lags:] b, *_ = np.linalg.lstsq(X, y, rcond=None) e = y - X @ b s2 = float(e @ e) / (n - X.shape[1]) se = math.sqrt(s2 * np.linalg.inv(X.T @ X)[0, 0]) return float(b[0]) / se, float(e @ e), n, X.shape[1] def adf(x, lags: int | None = None, trend: str = "c", max_lags: int | None = None) -> dict: """Augmented Dickey-Fuller tau for Delta x_t = gamma x_{t-1} + deterministics + sum a_k Delta x_{t-k} + e_t. lags=None chooses them by AIC up to max_lags (default 12 (n/100)^(1/4)) on a common sample.""" x = np.asarray(x, dtype=float) if lags is None: max_lags = int(12 * (x.size / 100) ** 0.25) if max_lags is None else max_lags best = None for k in range(max_lags + 1): _, ssr, n, m = _adf_reg(x[max_lags - k:], k, trend) aic = n * math.log(ssr / n) + 2 * m if best is None or aic < best[0]: best = (aic, k) lags = best[1] tau, _, n, _ = _adf_reg(x, lags, trend) return {"tau": tau, "lags": lags, "n": n, "crit": mackinnon_crit(trend, n)}Listing 17.2. The augmented Dickey–Fuller test. code/firm/tsa/firm_tsa.py - Run
problem(),half_life_mc(0.99906, 12574),spurious()andlong_memory()inqm_tsa.py, thenfig_tsa.py.
What to change next. Fit an ARFIMA to the spread by the log-periodogram and compare its forecast of the spread’s decay with the AR(1)’s; rerun the tests on weekly data and see which conclusions survive.
17.7 Build: the time-series toolkit
Purpose. Every persistence the miniature firm relies on (a spread’s mean reversion, a signal’s decay, a volatility’s memory) is measured and tested here before a strategy is built on it.
Interface. acf, pacf, band; yule_walker(x, p); arma_css(x, p, q); ar1(x); adf(x, lags, trend, max_lags); mackinnon_crit(trend, n); periodogram(x); frac_diff(x, d, k); hurst_rs(x), hurst_gph(x).
Rules. Unit-root tests report their lag choice and are rerun over a range of lags; half-lives are reported with the bias correction and a simulated interval; no normal table for a coefficient near one.
Acceptance tests. code/firm/tsa/tests/: autocorrelations and partial autocorrelations of an AR(1); Yule–Walker for an AR(2); ARMA(1, 1) by conditional least squares; the Dickey–Fuller test has its nominal size on random walks and rejects a stationary AR(1); MacKinnon’s formula; a flat periodogram for white noise; fractional differencing with is differencing; Hurst estimates of white noise and of an ARFIMA.
Stretch. The KPSS test, whose null is stationarity; exact Gaussian likelihood for ARMA by the Kalman filter of chapter 19; the local Whittle estimator of .
Sources and further reading
- H. Wold, A Study in the Analysis of Stationary Time Series, Almqvist and Wiksell, 1938.
- D. A. Dickey and W. A. Fuller, “Distribution of the estimators for autoregressive time series with a unit root”, Journal of the American Statistical Association 74, 1979; S. E. Said and D. A. Dickey, Biometrika 71, 1984.
- J. G. MacKinnon, “Critical values for cointegration tests”, Queen’s Economics Department Working Paper 1227, 2010.
- C. W. J. Granger and P. Newbold, “Spurious regressions in econometrics”, Journal of Econometrics 2, 1974.
- M. G. Kendall, “Note on bias in the estimation of autocorrelation”, Biometrika 41, 1954.
- H. E. Hurst, “Long-term storage capacity of reservoirs”, Transactions of the American Society of Civil Engineers 116, 1951.
- B. B. Mandelbrot and J. W. Van Ness, “Fractional Brownian motions, fractional noises and applications”, SIAM Review 10, 1968.
- C. W. J. Granger and R. Joyeux, Journal of Time Series Analysis 1, 1980; J. R. M. Hosking, “Fractional differencing”, Biometrika 68, 1981; J. Geweke and S. Porter-Hudak, Journal of Time Series Analysis 4, 1983.
- Board of Governors of the Federal Reserve System, H.15 Selected Interest Rates, via FRED (series DGS2 and DGS10), accessed 24 September 2026.
17.8 Exercises
Exercise 17.1 ★
An AR(1) has coefficient 0.98 on daily data. What is the half-life in days, and what is the autocorrelation at lag 20?
Exercise 17.2 ★
Is the MA(1) invertible? Find the invertible MA(1) with the same autocorrelations.
Solution
Solution of Exercise 17.2.
No: the root of is , inside the unit circle. The MA(1) with coefficient and innovation variance four times larger, , has the same autocovariances ( in both cases) and is invertible.
Exercise 17.3 ★
Write the first four fractional-differencing weights for .
Solution
Solution of Exercise 17.3.
, , , .
Exercise 17.4 ★★
For an AR(1) with estimated from 1 000 daily observations, what is Kendall’s bias, and how much does it change the half-life?
Exercise 17.5 ★★
Show that the autocorrelations of an AR(2) satisfy , and compute and for , .
Solution
Solution of Exercise 17.5.
Multiply (demeaned) by , , and take expectations: ; divide by . At , , so ; then .
Exercise 17.6 ★★
Using MacKinnon’s coefficients , compute the 5% Dickey–Fuller critical value (with constant) for and .
Solution
Solution of Exercise 17.6.
: . : .
Exercise 17.7 ★★★
Coding. Regress one independent random walk of 500 steps on another 5 000 times. How often is ? What happens if you regress the differences instead?
Solution
Solution of Exercise 17.7.
spurious(): in 89% of the 5 000 regressions of levels, with median 0.17; regressing the differences, in 5.0%, the nominal rate. Differencing removes the common stochastic trend problem when the series are not cointegrated (chapter 20).
Exercise 17.8 ★★★
Find the flaw. “We regressed the daily change of the spread on the lagged level; the coefficient is with , significant at 1%, so the spread mean-reverts and we will trade its reversion with a half-life of 552 days.”
Solution
Solution of Exercise 17.8.
The -statistic of the lagged level in that regression is the Dickey–Fuller , whose 1% and 5% critical values are and : is not significant at 5%. The half-life of 552 days is also biased down (739 after Kendall’s correction) and very uncertain (a 10–90% range of about 350 to 970 days if the truth were 739). A trade that waits years for reversion must be sized for the possibility that there is none.
17.9 Problem: The Half-Life of a Spread
Problem 17.1
Weekend problem — how fast does the 2s10s spread mean-revert?
The data are the daily ten-year and two-year constant-maturity Treasury yields (FRED DGS10 and DGS2) from 1 June 1976 to 22 September 2026, on the 12 574 days with both; the spread is their difference in basis points.
Part I — The series.
- What are the spread’s mean, range and last value?
- What is its first autocorrelation, and what does its correlogram look like?
- What are the standard deviation and first autocorrelations of its daily changes?
- Which AR order does AIC choose for the changes, and does it matter economically?
- What is the Wold representation of the changes, approximately?
Part II — The AR(1).
- What are the AR(1) coefficient, its standard error, and the half-life?
- What -statistic against one, and what -value by the normal table?
- What is Kendall’s correction, and the corrected half-life?
- What do the Dickey–Fuller and augmented tests say, with 0, 5, 10 and 20 lags?
- What does the sample since 1990 give?
Part III — What the data can tell.
- If the true half-life were 739 days, how would 12 574-day estimates be distributed?
- How often would the Dickey–Fuller test then fail to reject the unit root?
- What does the log-periodogram say about the changes, and about the level?
- Why might an AR(1) half-life be unstable across samples?
- What would a steepener trader want to know that the half-life does not say?
Part IV — Judgement.
- Is the spread stationary?
- Which half-life would you use to size a mean-reversion trade, and with what caveat?
- Why is the normal table’s -value of 0.003 misleading?
- State the named result: the AR(1) half-life, its bias-corrected value, and whether a unit root can be rejected.
- In one sentence: what does a unit-root test tell a trader?
Solution
Solution of Problem 17.1.
1. Mean 84.5 bp; range to 291 bp; 25 bp on 22 September 2026. 2. 0.9987; the correlogram declines almost linearly, still 0.64 after 250 days, the signature of a unit root or near unit root. 3. 4.6 bp; 0.015, 0.015, . 4. AR(10), with every coefficient below 0.035 in absolute value: detectable in 12 574 days, worthless for prediction. 5. Approximately white noise: with close to zero for . 6. , standard error 0.00045, half-life 552 trading days (2.2 years). 7. , and a normal one-sided -value of 0.003. 8. , so and a half-life of 739 days (2.9 years). 9. With 0, 5, 10 and 20 lags: , , , , against critical values (1%) and (5%). Not rejected at 5% with few lags, rejected at 5% with ten and at 1% with twenty; AIC picks 34 lags and . 10. : no evidence against a unit root. 11. Median 576 days, 10–90% range 352 to 969. 12. In 57% of the histories. 13. for the changes, : over-differenced, so the level has , a slowly and hyperbolically mean-reverting process. 14. Because the true memory is not geometric, the fitted AR(1) coefficient depends on the sample’s length and period; and near one the half-life magnifies every error. 15. The distribution of the path to reversion: how far the spread can move against the position and for how long, which depends on the volatility and on the tails of the memory, not on the half-life alone. 16. The data cannot say: consistent with a very persistent stationary process and with a unit root. 17. The bias-corrected 739 days, treated as uncertain between one and four years, with the position sized to survive no reversion at all. 18. Under a unit root the -statistic follows the Dickey–Fuller law, whose 5% point is , not ; the true -value is about 0.06. 19. Named result: the half-life of a spread: the AR(1) half-life of the 2s10s spread is 552 trading days, 739 after Kendall’s bias correction; the Dickey–Fuller statistic does not reject a unit root at 5%, and augmented versions reject or not depending on the lag choice. 20. Whether the data rule out a random walk, which, for a spread one hopes will revert, is usually the answer that it has not been ruled out.
17.10 Interview questions
Interview question 17.1 ★ researcher, trader
What is the half-life of an AR(1) with coefficient , and why is it hard to estimate when is near one?
Solution
Solution of Interview question 17.1.
periods. Near one, a small error in is a large relative error in , the estimate is biased down by about , and its distribution is skewed; the half-life can be off by a factor of two.
What the interviewer is looking for: The formula, the sensitivity, and the small-sample bias.
Interview question 17.2 ★★ researcher
Why can’t you use the usual -table to test ?
Solution
Solution of Interview question 17.2.
Under the regressor is a random walk; the estimator converges at rate , not , and its -statistic converges to a functional of Brownian motion (the Dickey–Fuller law), shifted to the left: 5% critical value with a constant, instead of .
What the interviewer is looking for: Nonstandard asymptotics and the critical values.
Interview question 17.3 ★★ researcher, mle
You regress one price series on another and get and . What do you check?
Solution
Solution of Interview question 17.3.
Whether it is a spurious regression: are both series unit-root processes, and are the residuals stationary (a cointegration test, chapter 20)? Regress changes on changes, or test the residuals with Engle–Granger critical values; look at the residuals’ autocorrelation.
What the interviewer is looking for: Spurious regression as the first hypothesis, and cointegration as the test.
Interview question 17.4 ★★ researcher
How do you tell an AR process from an MA process from their correlograms?
Solution
Solution of Interview question 17.4.
An AR() has a partial autocorrelation function that cuts off after lag and an autocorrelation function that decays; an MA() has the reverse, an autocorrelation function that cuts off after lag . ARMA has both decaying; use an information criterion to choose.
What the interviewer is looking for: The cut-off rules and a model-selection tool.
Interview question 17.5 ★★ researcher, mle
What is long memory, and where do you see it in markets?
Solution
Solution of Interview question 17.5.
Autocorrelations that decay like a power of the lag and do not sum: the fractional between 0 and one half. In markets: volatility (absolute and squared returns), trading volume, order-flow signs, some spreads and interest rates; rarely in returns themselves.
What the interviewer is looking for: Power-law decay, and volatility as the canonical example.
Interview question 17.6 ★★★ researcher
Why is the least-squares AR(1) coefficient biased downward in small samples, and how large is the bias?
Solution
Solution of Interview question 17.6.
The regression uses the sample mean, which absorbs part of each deviation, and the estimator is a ratio of correlated quadratic forms; both push it down. Kendall’s approximation with an estimated mean is : about near one, so with a year of daily data.
What the interviewer is looking for: The mechanism and the size.
Terms defined in this chapter
- Autocovariance, autocorrelation and partial autocorrelation functions
- Autoregressive, moving-average and ARMA processes
- Dickey–Fuller test
- Fractional Brownian motion
- Information criterion
- Long memory, fractional differencing, Hurst exponent
- Spectral density, periodogram
- Stationary process, weak stationarity, white noise
- Unit root, spurious regression