Solution (source code)

= Solution

A <unit-root autoregressive process> retains shocks permanently, whereas a <causal time series> with $|\phi|<1$ reverts towards its mean. Testing the unit root determines whether stationary autoregressive analysis is appropriate or <differencing> is needed. For the model without an intercept or trend, use the <Dickey–Fuller test> against the lower-sided alternative $\phi<1$ near the null. Put
$$
\widehat\phi=\frac{\sum_{t=2}^nX_{t-1}X_t}{\sum_{t=2}^nX_{t-1}^2},\qquad
\widehat\sigma^2=\frac1{n-2}\sum_{t=2}^n(X_t-\widehat\phi X_{t-1})^2,
\qquad T_n=\frac{(\widehat\phi-1)\sqrt{\sum_{t=2}^nX_{t-1}^2}}{\widehat\sigma}.
$$
This is the ordinary regression statistic for a zero coefficient when $\Delta X_t$ is regressed on $X_{t-1}$, but its null <probability distribution> is not the usual Student law. Under the standard unit-root initialization $X_1=o_P(\sqrt n)$ and innovations independent of the starting value,
$$
T_n\Rightarrow D=\frac{\int_0^1 W(u)\,dW(u)}{\sqrt{\int_0^1W(u)^2\,du}}
=\frac{W(1)^2-1}{2\sqrt{\int_0^1W(u)^2\,du}},
$$
where $W$ is standard <Brownian motion>. If $d_\alpha$ is the lower $\alpha$-quantile of $D$, the \b[asymptotic level-$\alpha$ critical region] is
$$
\boxed{T_n<d_\alpha.}
$$
The deterministic terms and null initialization must match the critical-value table. For exact finite-sample <size of a statistical test>, calibrate the statistic from its Gaussian <random walk> null with the specified initial condition and noise scale; for a zero starting value its distribution is scale-free. The printed two-sided recurrence alone specifies neither an initial law nor a universal finite-sample critical value. Ordinary normal quantiles do not give the intended <size of a statistical test>.