Learn R Programming

lassoscore (version 0.6)

glassoscore: Penalized score test, for the graphical lasso.

Description

Test whether an element of the precision matrix is zero, using the graphical lasso to approximate the parameters in remainder of the precision matrix.

Usage

glassoscore(x, lambda, subset=NULL, penalize.diagonal=FALSE, tol=1e-8) mbscore(x, lambda, subset=NULL, tol=1e-8,...)

Arguments

x
data matrix. Unlike glasso, this function requires the original data, not just the covariance matrix.
lambda
a non-negative tuning parameter
subset
An ncol(x) by ncol(x) logical matrix, giving a subset of edges to test.
penalize.diagonal
logical. Whether or not to penalize the diagonal in the graphical lasso. Defaults to FALSE.
tol
convergence tolerance for glasso or glmnet
...
for mbscore, additional arguments to be passed to lassoscore

Value

for an object of class either `glassoscore' or `mbscore', containing
scores
the penalized score statistics
scorevar.model
the variance of the score statistics, estimated using a model-based variance estimate
scorevar.sand
the variance of the score statistcs, using a conservative variance estimate
p.model
p-value, using the model-based variance
p.sand
p-value, using the sandwich variance
beta
for mbscore, the beta[-i,i] contains the coefficients from lasso regression of x[,i] on x[,-i].
In addition, glassoscore contains the output from `glasso' applied to x.

Details

This function tests for pairwise association between features, using the graphical lasso (glassoscore) or neighborhood selection (mbscore). Tests are based on the penalized score statistic $T_\lambda$, described in Voorman et al (2014). Note that a feature is non-zero in the (graphical) lasso solution if and only if $$| T[\lambda] | > \lambda \sqrt{n},$$ where $T_\lambda$ is penalized the score statistic. Calculating the variance of $T_\lambda$ can be computationally expensive for glassoscore. If there are $q$ non-zero parameters in the graphical lasso solution, it will (roughly) require construction, and inversion, of a $q x q$ matrix for each of the $q$ non-zero parameters. That is, complexity is roughly $q^4$.

For mbscore, the results are typically not symmetric. For instance, p.sand[-i,i] contains the p-values produced by lassoscore(x[,i],x[,-i],lambda), i.e. using x[,i] as the outcome variable, and thus p.sand[i,-i] contains p-values associated with feature i when used as the a predictor variable.

References

Jerome Friedman, Trevor Hastie and Robert Tibshirani (2007). Sparse inverse covariance estimation with the lasso. Biostatistics 2007. http://www-stat.stanford.edu/~tibs/ftp/graph.pdf

N. Meinshausen and P. Buhlmann. High-dimensional graphs and variable selection with the lasso. Annals of Statistics, 34(3):1436-1462, 2006.

See Also

lassoscore, glasso

Examples

Run this code
set.seed(100)

x<-matrix(rnorm(50*20),ncol=20)

gl <- glassoscore(x,0.2)
mb <- mbscore(x,0.2)

par(mfrow=c(1,2))
plot(gl)
plot(mb)

Run the code above in your browser using DataLab