larInf: Selective inference for least angle regression

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/funs.lar.R

Description

Computes p-values and confidence intervals for least angle regression

Usage

1
2
larInf(obj, sigma=NULL, alpha=0.1, k=NULL, type=c("active","all","aic"), 
       gridrange=c(-100,100), bits=NULL, mult=2, ntimes=2, verbose=FALSE) 

Arguments

obj

Object returned by lar function (not the lars function!)

sigma

Estimate of error standard deviation. If NULL (default), this is estimated using the mean squared residual of the full least squares fit when n >= 2p, and using the standard deviation of y when n < 2p. In the latter case, the user should use estimateSigma function for a more accurate estimate

alpha

Significance level for confidence intervals (target is miscoverage alpha/2 in each tail)

k

See "type" argument below. Default is NULL, in which case k is taken to be the the number of steps computed in the least angle regression path

type

Type of analysis desired: with "active" (default), p-values and confidence intervals are computed for each predictor as it is entered into the active step, all the way through k steps; with "all", p-values and confidence intervals are computed for all variables in the active model after k steps; with "aic", the number of steps k is first estimated using a modified AIC criterion, and then the same type of analysis as in "all" is carried out for this particular value of k.

Note that the AIC scheme is defined to choose a number of steps k after which the AIC criterion increases ntimes in a row, where ntimes can be specified by the user (see below). Under this definition, the AIC selection event is characterizable as a polyhedral set, and hence the extra conditioning can be taken into account exactly. Also note that an analogous BIC scheme can be specified through the mult argument (see below)

gridrange

Grid range for constructing confidence intervals, on the standardized scale

bits

Number of bits to be used for p-value and confidence interval calculations. Default is NULL, in which case standard floating point calculations are performed. When not NULL, multiple precision floating point calculations are performed with the specified number of bits, using the R package Rmpfr (if this package is not installed, then a warning is thrown, and standard floating point calculations are pursued). Note: standard double precision uses 53 bits so, e.g., a choice of 200 bits uses about 4 times double precision. The confidence interval computation is sometimes numerically challenging, and the extra precision can be helpful (though computationally more costly). In particular, extra precision might be tried if the values in the output columns of tailarea differ noticeably from alpha/2.

mult

Multiplier for the AIC-style penalty. Hence a value of 2 (default) gives AIC, whereas a value of log(n) would give BIC

ntimes

Number of steps for which AIC-style criterion has to increase before minimizing point is declared

verbose

Print out progress along the way? Default is FALSE

Details

This function computes selective p-values and confidence intervals (selection intervals) for least angle regression. The default is to report the results for each predictor after its entry into the model. See the "type" argument for other options. The confidence interval construction involves numerical search and can be fragile: if the observed statistic is too close to either end of the truncation interval (vlo and vup, see references), then one or possibly both endpoints of the interval of desired coverage cannot be computed, and default to +/- Inf. The output tailarea gives the achieved Gaussian tail areas for the reported intervals—these should be close to alpha/2, and can be used for error-checking purposes.

Value

type

Type of analysis (active, all, or aic)

k

Value of k specified in call

khat

When type is "active", this is an estimated stopping point declared by forwardStop; when type is "aic", this is the value chosen by the modified AIC scheme

pv

P-values for active variables

ci

Confidence intervals

tailarea

Realized tail areas (lower and upper) for each confidence interval

vlo

Lower truncation limits for statistics

vup

Upper truncation limits for statistics

vmat

Linear contrasts that define the observed statistics

y

Vector of outcomes

pv.spacing

P-values from the spacing test (here M+ is used)

pv.modspac

P-values from the modified form of the spacing test (here M+ is replaced by the next knot)

pv.covtest

P-values from covariance test

vars

Variables in active set

sign

Signs of active coefficients

alpha

Desired coverage (alpha/2 in each tail)

sigma

Value of error standard deviation (sigma) used

call

The call to larInf

Author(s)

Ryan Tibshirani, Rob Tibshirani, Jonathan Taylor, Joshua Loftus, Stephen Reid

References

Ryan Tibshirani, Jonathan Taylor, Richard Lockhart, and Rob Tibshirani (2014). Exact post-selection inference for sequential regression procedures. arXiv:1401.3889.

See Also

lar

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
set.seed(43)
n = 50
p = 10
sigma = 1
x = matrix(rnorm(n*p),n,p)
beta = c(3,2,rep(0,p-2))
y = x%*%beta + sigma*rnorm(n)

# run LAR
larfit = lar(x,y)

# compute sequential p-values and confidence intervals
# (sigma estimated from full model)
out.seq = larInf(larfit)
out.seq

# compute p-values and confidence intervals after AIC stopping
out.aic = larInf(larfit,type="aic")
out.aic

# compute p-values and confidence intervals after 5 fixed steps
out.fix = larInf(larfit,type="all",k=5)
out.fix

Example output

Loading required package: glmnet
Loading required package: Matrix
Loading required package: foreach
Loaded glmnet 2.0-16

Loading required package: intervals

Attaching package: 'intervals'

The following object is masked from 'package:Matrix':

    expand

Loading required package: survival

Call:
larInf(obj = larfit)

Standard deviation of noise (specified or estimated) sigma = 1.012

Sequential testing results with alpha = 0.100

 Step Var   Coef Z-score P-value LowConfPt UpConfPt Spacing CovTest LowTailArea
    1   1  2.606  17.395   0.000     2.358    2.853   0.000   0.000       0.049
    2   2  2.048  14.174   0.000     1.809    2.286   0.000   0.000       0.049
    3   7  0.183   1.246   0.592    -1.036    0.583   0.623   0.693       0.000
    4   6 -0.140  -1.016   0.602    -1.346    2.401   0.602   0.848       0.050
    5   9 -0.144  -0.912   0.633    -2.641    5.171   0.633   0.922       0.050
    6   5 -0.135  -0.991   0.229    -3.951    0.998   0.208   0.720       0.050
    7   3  0.095   0.587   0.603    -2.802    1.637   0.603   0.906       0.050
    8   4  0.118   0.681   0.676    -4.446    1.785   0.444   0.824       0.050
    9   8  0.050   0.300   0.633    -4.155    2.189   0.543   0.950       0.050
   10  10 -0.029  -0.155   0.440    -4.480    3.460   0.558   0.976       0.050
 UpTailArea
      0.049
      0.049
      0.050
      0.050
      0.050
      0.000
      0.050
      0.050
      0.050
      0.050

Estimated stopping point from ForwardStop rule = 2

Call:
larInf(obj = larfit, type = "aic")

Standard deviation of noise (specified or estimated) sigma = 1.012

Testing results at step = 2, with alpha = 0.100

 Var  Coef Z-score P-value LowConfPt UpConfPt LowTailArea UpTailArea
   1 2.961  19.497       0     2.710    3.212       0.049      0.049
   2 2.048  14.174       0     1.809    2.286       0.049      0.049

Estimated stopping point from AIC rule = 2

Call:
larInf(obj = larfit, k = 5, type = "all")

Standard deviation of noise (specified or estimated) sigma = 1.012

Testing results at step = 5, with alpha = 0.100

 Var   Coef Z-score P-value LowConfPt UpConfPt LowTailArea UpTailArea
   1  2.955  18.931   0.000     2.184    3.331       0.050      0.049
   2  2.060  14.238   0.000     1.820    2.298       0.049      0.050
   7  0.127   0.831   0.517    -1.585    1.304       0.050      0.050
   6 -0.148  -1.077   0.581    -1.368    2.229       0.050      0.050
   9 -0.144  -0.912   0.633    -2.641    5.171       0.050      0.050

selectiveInference documentation built on Sept. 7, 2019, 9:02 a.m.