Two series can appear related because each retains its own history. Persistence makes consecutive observations similar and reduces the new information contributed by each observation. This experiment connects that memory to spurious regression: an apparently persuasive fit between independently generated processes.

From mean reversion to a unit root

A first-order autoregressive process follows:

Xt=c+ρXt−1+εt,εt∼iidN(0,1),t=1,…,250.X_t=c+\rho X_{t-1}+\varepsilon_t,\quad \varepsilon_t\overset{\mathrm{iid}}{\sim}N(0,1),\quad t=1,\ldots,250.

We fix c=0c=0 and X0=0X_0=0. For ∣ρ∣<1|\rho|<1, a shock decays at rate ρk\rho^k and variance converges to 1/(1−ρ2)1/(1-\rho^2). Negative ρ\rho produces alternating signs. Because the initial value is fixed, the process has a transient rather than starting in its stationary distribution.

At ρ=1\rho=1, it becomes a random walk. Shocks never dissipate:

Xt=∑j=1tεj,Var⁡(Xt∣X0=0)=t.X_t=\sum_{j=1}^t\varepsilon_j, \qquad \operatorname{Var}(X_t\mid X_0=0)=t.

Variance increases linearly, not exponentially. A unit root is nonstationary; “explosive” is usually reserved for ∣ρ∣>1|\rho|>1, outside this experiment’s range.

Persistence and mean reversionn = 250 · c = 0 · σ² = 1 · X₀ = 0
Var(X₂₅₀ | X₀ = 0)
—
Long-run variance
—
Trajectory seed
—

Moving ρ keeps the same innovations, isolating persistence. A new trajectory changes the seed. The vertical scale stays at least −35…35 for comparison and expands if needed.

Independent walks, misleading regression

R²
—
Durbin–Watson (DW)
—
β̂₁
—
Walks seed
—

R² > DW is a warning heuristic, not a formal test. Independent draws do not always satisfy it. Samples are never filtered to force the result; seeds make the displayed draws reproducible.

Simulated observations
tAR(1)XₜYₜ

When a fit misleads

The second plot generates two independent walks and fits Yt=α+βXt+etY_t=\alpha+\beta X_t+e_t. Accumulated shocks can create coincident trends, an apparent slope and high R2R^2 without a causal relationship or shared mechanism.

Residuals retain their time order when computing Durbin–Watson:

DW=∑t=2250(et−et−1)2∑t=1250et2.DW=\frac{\sum_{t=2}^{250}(e_t-e_{t-1})^2}{\sum_{t=1}^{250}e_t^2}.

Highly persistent residuals tend to produce a small DW. The comparison R2>DWR^2>DW, associated with the Granger–Newbold discussion, is a warning heuristic here. It is not a test with a specified significance level, need not occur in every draw and cannot validate a regression when absent.

Empirical warning. Investigate stationarity, deterministic trends and possible cointegration before interpreting a levels regression. Differencing may help for some processes, but changes the question and does not replace diagnosis. Seeds change reproducibly: samples are not searched or filtered to guarantee an impressive correlation.

References: BYU–Idaho, white noise and random walks and statsmodels, Durbin–Watson definition.