---
title: Spacing Test for Lasso Inference
url: https://www.emergentmind.com/topics/spacing-test-for-lasso
type: topic
---

# Spacing Test for Lasso Inference

Searching arXiv for the exact spacing-test paper and closely related selective-inference references.
The spacing test for the lasso is a post-selection inference procedure for significance testing along a path of adaptively selected models. In the literature summarized here, it is most precisely understood through the LARS/polyhedral selective-inference framework, where the statistic is built from neighboring knot values and yields an exact conditional pivot under a polyhedral selection event; by contrast, several nearby papers develop alternative or precursor tests for lasso-selected variables, including the covariance test and permutation-based rank tests, but these are not themselves the canonical spacing test [1301.7161] [1403.4296] [2310.05685].

## 1. Conceptual scope and terminological boundaries

The phrase “spacing test for the lasso” is often used loosely, but the surrounding literature distinguishes several different inferential constructions. One line of work is the covariance test of Lockhart, Taylor, Tibshirani and Tibshirani, which studies significance for the predictor variable that enters the current lasso model along the lasso solution path and shows an asymptotic $\operatorname{Exp}(1)$ null law under appropriate conditions [1301.7161]. Another line is the exact selective-inference framework reviewed in the post-selection survey on sparse estimation, where the spacing test is presented as a spacing test for LARS derived from polyhedral conditioning and truncated Gaussian pivots [2310.05685]. A separate alternative is the permutation/randomization-based procedure proposed for ordered lasso-selected features, which tests rank-based null hypotheses such as $H_0:\beta_{(k)}=0$ but does not derive a spacing statistic from lasso path knots [1403.4296].

This distinction is substantive rather than merely terminological. The permutation method uses the statistic $|\hat\beta_{(k)}|$ together with a response-permutation null distribution, and the authors explicitly position it as an alternative to the Lockhart et al. covariance test rather than as a spacing test [1403.4296]. The covariance-test literature, by contrast, is tied to the lasso path and the spacing between successive knots $\lambda_k,\lambda_{k+1}$ [1301.7161]. The selective-inference review then presents the spacing test in its exact conditional form through a polyhedral representation of the LARS selection event and a truncated normal pivot [2310.05685].

A plausible implication is that “spacing test for the lasso” is best treated as a member of the broader family of pathwise post-selection tests, but not every pathwise lasso significance procedure should be identified with it. The data make this especially clear for the 2014 permutation paper, which is relevant background on inference after lasso selection but not a direct source of spacing-test machinery [1403.4296].

## 2. Lasso path setting and the inferential problem

The inferential setting begins with the Gaussian linear model
\[
y = X\beta^* + \varepsilon,\qquad \varepsilon\sim N(0,\sigma^2 I),
\]
and the lasso estimator
\[
\hat\beta(\lambda) = \arg\min_{\beta\in\mathbb{R}^p} \frac{1}{2}\|y-X\beta\|_2^2+\lambda\|\beta\|_1, \qquad \lambda\ge 0.
\]
In the covariance-test formulation, the columns of $X$ are assumed to be in general position, which guarantees uniqueness of the lasso solution for each $\lambda>0$ and hence a unique piecewise linear path with knots
\[
\lambda_1\ge \lambda_2\ge \cdots \ge \lambda_r\ge 0.
\]
At each knot, some variable enters or leaves the active set [1301.7161].

The inferential target is not the same as in ordinary fixed-model regression. At step $k$, the lasso has already produced an adaptive current model $A$, and the covariance-test paper formulates the null as
\[
H_0:\ A \supseteq \operatorname{supp}(\beta^*).
\]
For $k=1$, this reduces to the global null $H_0:\beta^*=0$; for later steps it is a conditional null about whether all truly active variables are already contained in the current lasso model before the new variable enters [1301.7161]. The review article on sparse-estimation selective inference presents the analogous sequential question for the spacing test as testing whether the next variable entering at step $k$ has coefficient zero, conditional on the path event up to step $k$ [2310.05685].

This reformulation is necessary because adaptive selection invalidates naive fixed-model tests. The covariance-test paper emphasizes that, for two fixed nested linear models, the classical drop-in-RSS statistic has a $\chi^2_1$ null law, but that this is no longer appropriate once the additional variable has been chosen adaptively or greedily [1301.7161]. In the lasso path, adaptivity inflates significance measures, while shrinkage from the $\ell_1$ penalty acts in the opposite direction. The covariance statistic is designed so that these effects balance, producing a tractable asymptotic law [1301.7161]. The spacing test addresses the same difficulty through conditioning on the polyhedral selection event rather than through an asymptotic balancing argument [2310.05685].

## 3. Covariance statistic as precursor spacing machinery

The covariance test is one of the key precursors to the spacing-test viewpoint. Its statistic at step $k$ is
\[
T_k = \frac{ \bigl\langle y, X\hat\beta(\lambda_{k+1}) \bigr\rangle - \bigl\langle y, X_A\hat\beta_A(\lambda_{k+1}) \bigr\rangle }{\sigma^2},
\]
where $A$ is the active set just before the knot $\lambda_k$, the predictor $j$ enters at $\lambda_k$, and $\hat\beta_A(\lambda_{k+1})$ is the reduced lasso estimator on the current active set evaluated at the next knot [1301.7161]. The paper evaluates both fits at $\lambda_{k+1}$ because at entry time $\lambda_k$ the new coefficient is still zero [1301.7161].

Its central relevance to the spacing-test literature lies in the knot representation. Under the assumption that the reduced lasso path on $X_A$ has no sign changes between $\lambda_k$ and $\lambda_{k+1}$, the paper proves
\[
T_k = C(A,s_A,j,s)\cdot \frac{\lambda_k(\lambda_k-\lambda_{k+1})}{\sigma^2},
\]
where
\[
C(A,s_A,j,s) = \left\| (X_{A\cup\{j\}}^T)^+ s_{A\cup\{j\}} - (X_A^T)^+ s_A \right\|_2^2.
\]
Thus the covariance statistic is explicitly a function of the spacing between successive knots, $\lambda_k-\lambda_{k+1}$, scaled by the current knot $\lambda_k$ and a geometric factor [1301.7161].

Two special cases make the spacing structure transparent. In the orthogonal case, $C(A,s_A,j,s)=1$, so
\[
T_k=\frac{\lambda_k(\lambda_k-\lambda_{k+1})}{\sigma^2}.
\]
At the first step with unit-norm columns, $A=\varnothing$ and again
\[
T_1=\frac{\lambda_1(\lambda_1-\lambda_2)}{\sigma^2}.
\]
The paper therefore isolates the inferential content in the gap between adjacent lasso critical values, even though it does not yet present the later exact spacing test in truncated-Gaussian form [1301.7161].

The asymptotic null theory further strengthens the precursor role of this construction. In the orthogonal global-null case, if $V_1\ge V_2\ge \cdots \ge V_p$ are the order statistics of i.i.d. $\chi_1$ variates, then
\[
V_1(V_1-V_2)\xrightarrow{d}\operatorname{Exp}(1),
\]
and more generally the successive products converge to independent exponentials with means $1,1/2,\dots$ [1301.7161]. Under more general technical assumptions on $X$, the first-step statistic remains asymptotically $\operatorname{Exp}(1)$ under the global null [1301.7161]. In this sense, the covariance test already expresses lasso significance in terms of adjacent knot spacings and serves as a direct bridge to later spacing tests.

## 4. Polyhedral selective inference and the exact spacing pivot

The exact spacing-test framework, as summarized in the review on post-selection inference for sparse estimation, is built on a general selective-inference principle. If the selection event can be represented as a polyhedron
\[
\{Ay\le b\},
\]
and one is interested in a linear statistic $\eta^\top y$, then with
\[
c:=\Sigma\eta(\eta^\top\Sigma\eta)^{-1}, \qquad z:=(I-c\eta^\top)y,
\]
the statistic $\eta^\top y$ is independent of $z$, and the event $\{Ay\le b\}$ can be rewritten as
\[
\{Ay\le b\} = \{v^-(z)\le \eta^Ty\le v^+(z),\ v^0(z)\ge 0\},
\]
where
\[
v^-(z)= \max_{j:(Ac)_j<0} \frac{b_j-(Az)_j}{(Ac)_j},
\]
\[
v^+(z)= \min_{j:(Ac)_j>0} \frac{b_j-(Az)_j}{(Ac)_j},
\]
\[
v^0(z)= \min_{j:(Ac)_j=0} \bigl(b_j-(Az)_j\bigr).
\]
Hence,
\[
F^{[v^-(z),\,v^+(z)]}_{\eta^T\mu,\ \sigma^2\eta^T\eta}(\eta^Ty)\mid \{Ay\le b\}\sim \operatorname{Unif}[0,1],
\]
and
\[
[\eta^Ty\mid Ay\le b,\ z=z_0] \sim TN(\eta^T\mu,\ \sigma^2\|\eta\|_2^2,\ v^-(z_0),v^+(z_0)).
\]
This truncated-Gaussian pivot is the engine of exact selective inference in the spacing-test construction [2310.05685].

For LARS, the review introduces vectors
\[
c_k(j,s):= \frac{P_{k-1}^\perp X_j}{\,s-X_j^\top (X_{M_{k-1}}^+)^\top s_{M_{k-1}}\,},
\]
where $M_{k-1}$ is the active set before the $k$th step and $s_{M_{k-1}}$ is its sign vector [2310.05685]. A key identity is
\[
X_j^\top r_k=s_k\lambda_k \Longleftrightarrow c_k(j_k,s_k)^\top y=\lambda_k,
\]
which converts path geometry into affine inequalities in $y$ and allows the selection event to be encoded polyhedrally [2310.05685].

Using this machinery, the review states the spacing-test statistic at step $k$ under the null $H_0:\beta_{j_k}=0$ as
\[
T_k:= \frac{\displaystyle \Psi\left(\lambda_{k-1}\frac{\omega_k}{\sigma}\right)-\Psi\left(\lambda_{k}\frac{\omega_k}{\sigma}\right)}
{\displaystyle \Psi\left(\lambda_{k-1}\frac{\omega_k}{\sigma}\right)-\Psi\left({c^*_{k+1}}^\top y\frac{\omega_k}{\sigma}\right)},
\]
where
\[
\omega_k=\left\|(X_{M_{k}}^+)^\top s_{M_{k}} - (X_{M_{k-1}}^+)^\top s_{M_{k-1}}\right\|_2,
\]
and the norm identity $\|\eta\|_2=\omega_k^{-1}$ explains the standardization [2310.05685]. The review further states the exact finite-sample selective validity result
\[
{\mathbb P}_{H_0}(T_k\le \alpha\mid Ay\le b)=\alpha.
\]
Accordingly, the spacing test is an exact conditional Uniform$(0,1)$ pivot under the polyhedral selection event [2310.05685].

This exact conditional statement is the principal feature that separates the spacing test from the covariance test. The latter yields asymptotic exponential calibration tied to path spacings; the former uses a polyhedral truncation argument to obtain an exact selective pivot [1301.7161] [2310.05685].

## 5. Approximate spacing statistic and relation to the significance test

The exact spacing statistic involves the competitor boundary ${c^*_{k+1}}^\top y$, which the review describes as complicated to compute [2310.05685]. For this reason it also presents a simpler approximation obtained by replacing the more complicated lower truncation boundary with the next knot:
\[
T_k^{sp}:= \frac{\displaystyle \Psi\left(\lambda_{k-1}\frac{\omega_k}{\sigma}\right) -\Psi\left(\lambda_{k}\frac{\omega_k}{\sigma}\right)}
{\displaystyle \Psi\left(\lambda_{k-1}\frac{\omega_k}{\sigma}\right) -\Psi\left(\lambda_{k+1}\frac{\omega_k}{\sigma}\right)}.
\]
The corresponding validity statement is conservative:
\[
{\mathbb P}_{H_0}(T_k^{sp}\le \alpha\mid Ay\le b)\le \alpha.
\]
The review attributes the conservatism to the inequality
\[
\lambda_{k+1} \ge c_{k+1}^*,
\]
which implies
\[
T_k\le T_k^{sp}.
\]
Thus the approximate spacing test preserves selective validity at the cost of conservatism [2310.05685].

The same review then provides an explicit asymptotic connection between the approximate spacing test and the lasso significance test. Under the assumptions
\[
\omega_k\lambda_{k+1}\xrightarrow{P}\infty \quad\text{and}\quad \omega_k^2\lambda_{k-1}(\lambda_{k-1}-\lambda_k)\xrightarrow{P}\infty,
\]
one has
\[
-\log T_k^{sp}-T_k^{sig}\xrightarrow{P}0,
\]
where $T_k^{sig}$ denotes the significance-test statistic from the lasso covariance-test line of work [2310.05685]. This makes the relationship between the two procedures precise: the approximate spacing statistic and the significance statistic are asymptotically equivalent after the transform $T\mapsto -\log T$ [2310.05685].

This suggests a natural historical reading. The covariance test introduced the knot-spacing form and exponential calibration in the lasso path setting [1301.7161]. The spacing test then recast the same inferential phenomenon inside a selective-inference framework with a polyhedral conditioning argument and an exact conditional pivot [2310.05685]. The approximate spacing statistic sits between these viewpoints, being closer computationally to the covariance test while inheriting the selective-inference interpretation of the exact spacing test [2310.05685].

## 6. Related extensions, analogues, and non-examples

Several nearby papers clarify what does and does not count as a spacing test. The permutation paper on inference for feature selection using the lasso is explicit in not deriving the canonical spacing-test formula. It does not use adjacent lasso knots, does not derive a spacing statistic from path entry times, and does not provide a truncated exponential or truncated-Gaussian selective pivot [1403.4296]. Instead, it tests rank-based null hypotheses such as
\[
H_0:\beta_{(k)}=0
\]
using the observed coefficient magnitude
\[
|\hat{\beta}_{(k)}|
\]
and the Monte Carlo $p$-value
\[
p\mbox{-value} = \frac{1 + \sum_{b=1}^B 1_{\{|\hat{\beta}_{(k)}^b| \geq  |\hat{\beta}_{(k)}|\}}}{B+1}.
\]
Its conditioning strategy is weak relative to modern selective inference, since it conditions only on the predictor matrix $X$ and uses response permutation to enforce the global null of no response-predictor association [1403.4296].

By contrast, the graphical-lasso paper gives a genuine spacing-style analogue in sparse inverse covariance estimation. It defines a special subsequence of knots $\tilde\rho_1\ge \tilde\rho_2\ge \cdots$ at which connected components change, and proposes the statistic
\[
T_k = n\,\tilde\rho_k(\tilde\rho_k-\tilde\rho_{k+1}).
\]
Under the null that the true connected components are already captured, the first null step has asymptotic law $\operatorname{Exp}(1)$, and the $j$th null step after that has asymptotic law $\operatorname{Exp}(1/j)$ [1307.4765]. The paper explicitly describes this as being inspired by the lasso covariance/spacing literature, and even gives a covariance-style formulation that collapses exactly to the knot-spacing form for its chosen knot subsequence [1307.4765]. The analogy is structural: both settings use spacings between successive path knots, both test “has the true model already entered?” nulls, and both obtain asymptotic exponential laws [1307.4765].

A more recent structured-sparsity extension is the fused-lasso spacing test. In one-dimensional fused lasso signal approximation,
\[
\hat\theta(\lambda) = \arg\min_{\theta\in\mathbb{R}^n} \ \|y-\theta\|_2^2+\lambda\sum_{i=2}^n |\theta_i-\theta_{i-1}|,
\]
the paper reparameterizes the problem so that it becomes an ordinary lasso in transformed variables [2509.14229]. With transformed design $(I-P_2)X_1$ and transformed response $(I-P_2)y$, it builds a fused-LARS path and derives the spacing statistic
\[
T_k = \frac{ \Phi(w\lambda_{k-1})-\Phi(w\lambda_k) }{ \Phi(w\lambda_{k-1})-\Phi(w c_{k+1}) },
\]
where the tested parameter is the newly entered adjacent difference corresponding to a changepoint [2509.14229]. The paper states the selective-validity result as
\[
\mathbb{P}_{H_0}(T_k<a\mid Ay\le b)=a,
\]
thereby transplanting the spacing-test logic from ordinary lasso coefficients to changepoint effects in fused lasso [2509.14229].

These papers jointly indicate that the spacing-test idea is not confined to standard lasso regression. Its reusable ingredients are a piecewise linear path indexed by knots, a polyhedral representation of the selection event, and a Gaussian linear statistic whose conditional law is truncated normal [2509.14229]. At the same time, the permutation lasso-significance paper demonstrates that not every valid post-selection procedure for lasso-selected variables belongs to the spacing-test family [1403.4296].

## 7. Interpretation, limitations, and practical significance

The spacing test is a selective-inference procedure for sequential model building, and its interpretation must remain tied to that role. In the review formulation, the null at step $k$ is that the next variable entering the LARS path has coefficient zero, conditional on the event that the same path has been selected up to that point [2310.05685]. The resulting $p$-value therefore does not coincide with the ordinary regression $p$-value for a prespecified coordinate. It is instead a pathwise post-selection statement about a variable chosen adaptively by the procedure itself [2310.05685].

This conditional perspective also clarifies why the spacing test differs from simpler alternatives. The covariance test produces asymptotic exponential calibration through the balance of adaptivity and shrinkage, but it is not itself an exact polyhedral selective pivot [1301.7161]. The permutation rank test uses empirical null simulation under response exchangeability and targets the selected rank position rather than a fixed-coordinate or exact pathwise selective null [1403.4296]. The spacing test occupies a distinct position because it couples neighboring knot spacings to an explicit conditioning event and derives exact conditional uniformity from a truncated-Gaussian law [2310.05685].

Several limitations are explicit in the surrounding literature. The exact selective arguments assume a Gaussian model with known variance in the review exposition and in the fused-lasso extension [2310.05685] [2509.14229]. The approximate spacing statistic is conservative because it replaces the exact competitor threshold by the next knot [2310.05685]. The covariance-test theory for later lasso steps is asymptotic and can become conservative under correlation or more general designs [1301.7161]. The permutation alternative relies on exchangeability under the null and does not condition on the exact lasso active set, signs, or polyhedral selection event [1403.4296]. These are different limitations, but together they show that post-selection inference after lasso is method-sensitive: inferential target, conditioning event, and reference law vary sharply across procedures.

Within that broader landscape, the spacing test is best regarded as the exact polyhedral selective-inference formulation of the knot-spacing idea. The covariance-test paper established that adjacent lasso knots carry the essential inferential signal and that the statistic is, in simple cases, literally a function of $\lambda_k-\lambda_{k+1}$ [1301.7161]. The selective-inference review explains how this insight becomes an exact conditional pivot through a polyhedral representation of the LARS path event [2310.05685]. The permutation paper and the graphical- and fused-lasso analogues then delineate the boundaries of the concept: some procedures are alternatives, some are analogues, and some are direct structured extensions of the spacing-test principle [1403.4296] [1307.4765] [2509.14229].

Source: https://www.emergentmind.com/topics/spacing-test-for-lasso