Exact post-selection inference, with application to the lasso
Jason D. Lee, Dennis L. Sun, Yuekai Sun, Jonathan E. Taylor
Introduction
As a statistical technique, linear regression is both simple and powerful. Not only does it provide estimates of the “effect” of each variable, but it also quantifies the uncertainty in those estimates, allowing inferences to be made about the effects. However, in many applications, a practitioner starts with a large pool of candidate variables, such as genes or demographic features, and does not know a priori which are relevant. This is especially problematic when there are more variables than observations, since then the model is unidentifiable (at least in the setting where the predictors are assumed fixed).
In such settings, it is tempting to let the data decide which variables to include in the model. For example, one common approach when the number of variables is not too large is to fit a linear model with all variables included, observe which ones are significant at level , and then refit the linear model with only those variables included. The problem with this is that the -values can no longer be trusted, since the variables that are selected will tend to be those that are significant. Intuitively, we are “overfitting” to a particular realization of the data.
where is the pseudo-inverse of . Notice that (2) implies that the targets and in different models are in general different. This is simply a restatement of the well-known fact that a regression coefficient describes the effect of a predictor, adjusting for the other predictors in the model. In general, the coefficient of a predictor cannot be compared across different models.
Thus, “inference after selection” is ambiguous in linear regression because the target of inference changes with the selected model [Berk et al. (2013)]. In the next section, we discuss several ways to resolve this ambiguity.
Post-selection inference in linear regression
At first blush, the fact that the target changes with the model is deeply troubling, since it seems to imply that the parameters are random. However, the randomness is actually in the choice of which parameters to consider, not in the parameters themselves. Imagine that there are a priori well-defined population parameters, one for each coefficient in all possible models:
We only ever form inferences for the parameters in the model we select. This adaptive choice of which parameters to consider can lead to inferences with undesirable frequency properties, as noted by Benjamini and Yekutieli (2005) and Benjamini, Heller and Yekutieli (2009).
To be concrete, suppose we want a confidence interval for a parameter . What frequency properties should have? By analogy to the classical setting, we might require that
but the event inside the probability is not well-defined because is undefined when . Two ways around this issue are suggested by Berk et al. (2013): {longlist}[2.]
Conditional coverage: Since we form an interval for if and only if model is selected, that is, , it makes sense to condition on this event. Hence, we might require that our confidence interval satisfy
The benefit of this approach is that we avoid ever having to compare coefficients across two different models .
Another way to understand conditioning on the model is to consider data splitting [Cox (1975)], an approach to post-selection inference that most statisticians would agree is valid. In data splitting, the data is divided into two halves, with one half used to select the model and the other used to conduct inference. Fithian, Sun and Taylor (2014) argues that inferences obtained by data splitting are only valid conditional on the model that was selected on the first half of the data. Therefore, conditional coverage is a reasonable frequency property to require of a post-selection confidence interval.
Simultaneous coverage: It also makes sense to talk about events that are defined simultaneously over all . Berk et al. (2013) propose controlling the familywise error rate
but this is very stringent when many predictors are involved.
Instead of controlling the probability of making any error, we can control the expected proportion of errors—although “proportion of errors” is ambiguous in the event that we select zero variables. Benjamini and Yekutieli (2005) simply declare the error to be zero when :
while Storey (2003) suggests conditioning on :
Consider a family of intervals that each have conditional coverage:
Condition on and iterate expectations:
Theorem 2 in Weinstein, Fithian and Benjamini (2013) proves a special case of Lemma 2.1 for a particular selection procedure, and Proposition 11 in Fithian, Sun and Taylor (2014) provides a more general result, but this result is sufficient for our purposes: to establish that conditional coverage is a sensible criterion to consider in post-selection inference.
Although the criterion is easy to state, how do we construct an interval with conditional coverage? This requires that we understand the conditional distribution
One of the main contributions of this paper is to show that this distribution is indeed possible to characterize, making valid post-selection inference feasible in the context of linear regression.
Outline of our approach
We have argued that post-selection intervals for regression coefficients should have coverage conditional on the selected model:
both because this criterion is interesting in its own right and because it implies FCR control. To obtain an interval with this property, we study the conditional distribution
which will allow, more generally, conditional inference for parameters of the form . In particular, the regression coefficients can be written in this form, as can many other linear contrasts.
Our paper focuses on the specific case where the lasso is used to select the model . We begin in Section 4 by characterizing the event for the lasso. As it turns out, this event is a union of polyhedra. More precisely, the event , that specifies the model and the signs of the selected variables, is a polyhedron of the form
Therefore, if we condition on both the model and the signs, then we only need to study
We do this in Section 5. It turns out that this conditional distribution is essentially a (univariate) truncated Gaussian. We use this to derive a statistic whose distribution given is .
The resulting post-selection test has a similar structure to the pathwise significance tests of Lockhart et al. (2014) and Taylor et al. (2014), which also are conditional tests. However, the intended application of our test is different. While their significance tests are specifically intended for the path context, our framework allows more general questions about the model the lasso selects: we can test the model at any value of or form confidence intervals for an individual coefficient in the model.
There is also a parallel literature on confidence intervals for coefficients in high-dimensional linear models based on the lasso estimator [van de Geer et al. (2013); Zhang and Zhang (2014); Javanmard and Montanari (2013)]. The difference between their work and ours is that they do not address post-selection inference; their target is , the coefficients in the true model, rather than , the coefficients in the selected model. The two will not be the same unless happens to contain all nonzero coefficients of . Although inference for is appealing, it requires assumptions about correctness of the linear model and sparsity of . Pötscher and Schneider (2010) consider confidence intervals for the hard-thresholding and soft-thresholding estimators in the case of orthogonal design. Our approach instead regards the selected model as a linear approximation to the truth, a view shared by Berk et al. (2013) and Miller (2002).
The idea of post-selection inference conditional on the selected model appears in Pötscher (1991), although the notion of inference conditional on certain relevant subsets dates back to Fisher (1956); see also Robinson (1979). Leeb and Pötscher (2005; 2006) obtained a number of negative results about estimating the distribution of a post-selection estimator, although they note their results do not necessarily preclude the possibility of post-selection inference. Benjamini and Yekutieli (2005) also consider conditioning on the selection event, although they argue that this is too conservative. To the contrary, we show that conditioning on the selected model can produce reasonable confidence intervals in a wide variety of situations.
Inference conditional on selection has also appeared in literature on the winner’s curse: Sampson and Sill (2005); Sill and Sampson (2009); Zhong and Prentice (2008); Zollner and Pritchard (2007). These works are not really associated with model selection in linear regression, though they employ a similar approach to inference.
The lasso and its selection event
Because the lasso produces sparse solutions, we can define model “selected” by the lasso to be simply the set of predictors with nonzero coefficients:
Then post-selection inference seeks to make inferences about , given , as defined in (2).
The rest of this section focuses on characterizing this event . We begin by noting that in order for a vector of coefficients and a vector of signs to be solutions to the lasso problem (9), it is necessary and sufficient that they satisfy the Karush–Kuhn–Tucker (KKT) conditions:
Following Tibshirani (2013), we consider the equicorrelation set
Notice that we have implicitly identified the model with the equicorrelation set. Since for any , the equicorrelation set does in fact contain all predictors with nonzero coefficients, although it may also include some predictors with zero coefficients. However, for almost every , the equicorrelation set is precisely the set of predictors with nonzero coefficients.
It turns out that it is easier to first characterize and obtain as a corollary by taking a union over the possible signs. The next result is an important first step.
Assume the columns of are in general position [Tibshirani (2013)]. Let and be a candidate set of variables and their signs, respectively. Define the random variables
where is projection onto the column span of . Then the selection procedure can be rewritten in terms of and as
First, we rewrite the KKT conditions (10) by partitioning them according to the equicorrelation set , adopting the convention that means “variables not in ”:
Since the KKT conditions are necessary and sufficient for a solution, we obtain that if and only if there exist and satisfying
We can solve the first two equations for and to obtain the equivalent set of conditions
where the first two are the definitions of and given in (13) and (14), and the last two are the conditions on and given in (15).
Lemma 4.1 is remarkable because it says that the event can be rewritten as affine constraints on . This is because and are already affine functions of , and the constraints and can also be rewritten in terms of affine constraints. The following proposition makes this explicit.
Let and be defined as in (13) and (14). Then
where encode the “inactive” constraints , and encode the “active” constraints . These matrices have the explicit forms
First, substituting expression (13) for , we rewrite the “active” constraints as
Next, substituting expression (14) for , we rewrite the “inactive” constraints as
Combining Lemma 4.1 with Proposition 4.2, we obtain the following.
Let and , where and are defined in Proposition 4.2. Then
As a corollary, is simply the union of the above events over all possible sign patterns.
.
Polyhedral conditioning sets
In order to obtain inference conditional on the model, we need to understand the distribution of
However, as we saw in the previous section, is a union of polyhedra, so it is easier to condition on both the model and the signs,
since the conditioning event is a single polyhedron . Notice that inferences that are valid conditional on this finer event will also be valid conditional on . For example, if a confidence interval for has coverage conditional on the model and signs
it will also have coverage conditional only on the model by the Law of Total Probability:
This section is divided into two subsections. First, we study how to condition on a single polyhedron; this will allow us to condition on . Then we extend the framework to condition on a union of polyhedra, which will allow us to condition only on the model . The inferences obtained by conditioning on the model will in general be more efficient (i.e., narrower intervals, more powerful tests), at the price of more computation.
we rewrite in terms of and a component which is independent of . That component is
It is easy to verify that is uncorrelated with, and hence independent of, . Notice that in the case where , is simply the residual from projecting onto .
We can now rewrite in terms of and .
Let be defined as in (18) and as in (19). Then the conditioning set can be rewritten as follows:
Note that , , and refer to functions. Since they are functions of only, (20)–(22) are independent of .
We can decompose and rewrite the polyhedron as
where in the last step, we have divided the components into three categories depending on whether , since this affects the direction of the inequality (or whether we can divide at all). Since is the same quantity for all , it must be at least the maximum of the lower bounds, which is , and no more than the minimum of the upper bounds, which is .
Since are independent of , they behave as “fixed” quantities. Thus, is conditionally like a normal random variable, truncated to be between and . We would like to be able to say
but this is technically incorrect, since the distribution on the right-hand side changes with . By conditioning on the value of , is a truncated normal. We can then use the probability integral transform to obtain a statistic that has a distribution for any value of . Hence, will also have a distribution marginally over . We make this precise in the next theorem.
Let denote the CDF of a random variable truncated to the interval , that is,
where is the CDF of a random variable. Then
where and are defined in (20) and (21). Furthermore,
The only random quantities left are and . Now we can eliminate from the condition using independence:
Letting , we can apply the probability integral transform to the above result to obtain
If we let denote the density of a random variable given , what we have just shown is that
for any . The desired result now follows by integrating over :
2 Conditioning on a union of polyhedra
We have just characterized the distribution of , conditional on falling into a single polyhedron . We obtain such a polyhedron if we condition on both the model and the signs . If we want to only condition on the model , then we will have to understand the distribution of , conditional on falling into a union of such polyhedra, that is,
As Figure 3 makes clear, the argument proceeds exactly as before, except that is now truncated to a union of intervals, instead of a single interval. There is a and a for each possible sign pattern , so we index the intervals by the signs. This leads immediately to the next theorem, whose proof is essentially the same as that of Theorem 5.2.
Let denote the CDF of a random variable truncated to the set . Then
where and are defined in (20) and (21) and and .
Post-selection intervals for regression coefficients
In this section, we combine the characterization of the lasso selection event in Section 4 with the results about the distribution of a Gaussian truncated to a polyhedron (or union of polyhedra) in Section 5 to form post-selection intervals for lasso-selected regression coefficients. The key link is that the lasso selection event can be expressed as a union of polyhedra:
where and are defined in Theorem 4.3. Therefore, conditioning on selection is the same as conditioning on a union of polyhedra, so we can apply the framework of Section 5.
Recall that our goal is to form confidence intervals for , with -coverage conditional on . Taking , we can use Theorem 5.3 to obtain
This gives us a test statistic for testing any hypothesized value of . We can invert this test to obtain a confidence set
In fact, the set is an interval, as formalized in the next result.
Let . Let and be the (unique) values satisfying
Then is a confidence interval for , conditional on , that is,
Alternatively, we could have conditioned on the signs, in addition to the model, so that we would only have to condition on a single polyhedron. We also showed in Section 5 that
Inverting this statistic will produce intervals that have coverage conditional on , and hence coverage conditional on . However, these intervals will be less efficient; they will in general be wider. However, one may be willing to sacrifice statistical efficiency for computational efficiency. Notice that the main cost in computing intervals according to Theorem 6.1 is determining the intervals for each . The number of such sign patterns is . While this might be feasible when is small, it is not feasible when we select hundreds of variables. Conditioning on the signs means that we only have to compute the interval for the sign pattern that was actually observed.
Figure 4 shows the tradeoff in statistical efficiency. When the signal is strong, as in the left-hand plot, there is virtually no difference between the intervals obtained by conditioning on just the model, or the model and signs. On the other hand, in the right-hand plot, we see that we can obtain very wide intervals when the signal is weak. The widest intervals are for actual noise variables, as expected.
To understand why post-selection intervals are sometimes very wide, notice that when a truncated Gaussian random variable is close to the endpoints of the truncation interval , there are many means that would be consistent with that observation—hence, the wide intervals. Figure 5 shows confidence intervals for as a function of . When is far from the endpoints of the truncation interval, we basically recover the nominal OLS intervals (i.e., not adjusted for selection).
The implications are clear. When the signal is strong, will be far from the endpoints of the truncation region, so we obtain the nominal OLS intervals. On the other hand, when a variable just barely entered the model, then will be close to the edge of the truncation region, and the interval will be wide.
We have derived a confidence interval whose conditional coverage, given , is at least . The fact that we have found such an interval is not remarkable, since many such intervals have this property. However, given two intervals with the same coverage, we generally prefer the shorter one. This problem is considered in Fithian, Sun and Taylor (2014) where it is shown that is, with one small tweak, the shortest interval among all unbiased intervals with coverage.
An unbiased interval for a parameter is one which covers no other parameter with probability more than , that i,
Unbiasedness is a common restriction to ensure the existence of an optimal interval [Lehmann and Romano (2005)]. The shortest unbiased interval for , among all intervals with conditional coverage, resembles to the interval in Theorem 6.1. There, the critical values and were chosen symmetrically so that the pivot has area in either tail. However, it may be possible to obtain a shorter interval on average by allocating the a probability unequally between the two tails. Theorem 5 of Fithian, Sun and Taylor (2014) provides a general formula for obtaining shortest unbiased intervals in exponential families.
Data example
We apply our post-selection intervals to the diabetes data set from Efron et al. (2004). Since for this data set, we can estimate using the residual sum of squares from the full regression model with all predictors. After standardizing all variables, we chose according to the strategy in Negahban et al. (2012), . This expectation was computed by simulation, where , resulting in . The lasso selected four variables: BMI, BP, S3 and S5.
The post-selection intervals are shown in Figure 6, alongside the nominal confidence intervals produced by fitting OLS to the four selected variables, ignoring selection. The nominal intervals do not have coverage conditional on the model and are not valid post-selection intervals. Also depicted are the confidence intervals obtained by data splitting, as discussed in Section 2. This is a competitor method that also produces valid confidence intervals conditional on the model. The lasso selected the same four variables on half of the data, and then nominal intervals for these four variables using OLS on the other half of the data.
We can make two observations from Figure 6. {longlist}[2.]
The adjusted intervals provided by our method essentially reproduces the OLS intervals for the strong effects, whereas data splitting intervals are wider by a factor of (since only observations are used in the inference). For this dataset, the POSI intervals are times wider than the OLS intervals. For all the variables, our method produces the shortest intervals among the methods that control selective type 1 error.
One variable, S3 which would have been deemed significant using the OLS intervals, is no longer significant after accounting for selection. Data splitting, our selection-adjusted intervals, and POSI intervals conclude that S3 is not significant. This demonstrates that taking model selection into account can have substantive impacts on the conclusions.
Extensions
The above results rely on knowing or at least having a good estimate of it. If , then the variance of the residuals from fitting the full model is a consistent estimator and in general can be substituted for to yield asymptotically valid confidence intervals. Formally, the condition is that the pivot is smooth with respect to . Geometrically speaking, the upper and lower truncation limits and must be well-separated (with high probability). We refer the interested reader to Section 2.3 in Tian and Taylor (2015) for details.
In the setting where , obtaining an estimate of is more challenging, but if the pivot satisfies a monotonicity property, plugging in an overestimate of the variance gives conservative confidence intervals. We refer the reader to Theorem 11 in Tibshirani et al. (2015) for details.
2 Elastic net
These four conditions differ from those of Lemma 4.1 in only one respect: in the first expression is replaced by . Continuing the argument of Section 4, we see that the selection event can be rewritten
Now that we have rewritten the selection event in the form , we can once again apply the framework in Section 5 to obtain a test for the elastic net conditional on this event.
Conclusion
Model selection and inference have long been regarded as conflicting goals in linear regression. Following the lead of Berk et al. (2013), we have proposed a framework for post-selection inference that conditions on which model was selected, that is, the event . We characterize this event for the lasso and derive optimal and exact confidence intervals for linear contrasts , conditional on . With this general framework, we can form post-selection intervals for regression coefficients, equipping practitioners with a way to obtain “valid” intervals even after model selection.
Appendix: Monotonicity of F𝐹F
Let denote the cumulative distribution function of a truncated Gaussian random variable, as defined as in (24). Then is monotone decreasing in .
First, the truncated Gaussian distribution with CDF is a natural exponential family in , since it is just a Gaussian with a different base measure. Therefore, it has monotone likelihood ratio in . That is, for all and :
where denotes the density. (Instead of appealing to properties of exponential families, this property can also be directly verified.)
Therefore, the inequality is preserved if we integrate both sides with respect to on for . This yields
Now we integrate both sides with respect to on to obtain
which establishes for all .
Acknowledgements
We thank Will Fithian, Sam Gross and Josh Loftus for helpful comments and discussions. In particular, Will Fithian provided insights that led to the geometric intuition of our procedure shown in Figure 2.