sparse_proj: Sparse projections using the square-root Lasso

Description Usage Arguments Value References See Also Examples

View source: R/projections.R

Description

Regresses each column of x against all others in turn, using the square-root Lasso, and outputs residuals from the regressions. Thus it outputs a form of sparse projection of each column on all others. Alternatively, given two matrices x_null and x_alt, it regresses each column of x_null on x_alt in a similar fashion.

Usage

1
sparse_proj(x, x_null, x_alt, mc.cores = 1L, rescale = FALSE, ...)

Arguments

x

Matrix with each row an observation vector. Need not be supplied if x_alt and x_null are given.

x_null

Matrix whose columns are to be regressed on to x_alt.

x_alt

Matrix which the columns of x_null are regressed on to. Must be specified if x_null is given.

mc.cores

The number of cores to use. Will always be 1 in Windows.

rescale

Should the columns of the output be rescaled to have l_2-norm the square-root of the number of observations? Default is FALSE.

...

Additional arguments to be passed to sqrt_lasso.

Value

A matrix where each column gives the residuals.

References

A. Belloni, V. Chernozhukov, and L. Wang. (2011) Square-root lasso: pivotal recovery of sparse signals via conic programming. Biometrika, 98(4):791-806. http://biomet.oxfordjournals.org/content/98/4/791.refs T. Sun and C.-H. Zhang. (2012) Scaled sparse linear regression. Biometrika, 99(4):879-898. http://biomet.oxfordjournals.org/content/early/2012/09/24/biomet.ass043.short T. Sun and C.-H. Zhang. (2013) Sparse matrix inversion with scaled lasso. The Journal of Machine Learning Research, 14(1):3385-3418. www.jmlr.org/papers/volume14/sun13a/sun13a.pdf

See Also

sqrt_lasso and RPtest_single.

Examples

1
2
x <- matrix(rnorm(50*100), 50, 100)
out <- sparse_proj(x)

RPtests documentation built on May 29, 2017, 9:06 a.m.