Description Usage Arguments Details Value References See Also Examples

Fits a linear model to potentially high-dimensional data using the square-root Lasso, also known as the scaled Lasso. The Lasso path is computed using the glmnet package.

1 2 | ```
sqrt_lasso(x, y, lam0 = NULL, exclude = integer(0), output_all = FALSE,
...)
``` |

`x` |
Input matrix of dimension nobs by nvars; each row is an observation vector. |

`y` |
Response variable; shoud be a numeric vector. |

`lam0` |
Tuning parameter for the square-root / scaled Lasso. If left blank (recommended) this is chosen using the method of Sun & Zhang (2013) implemented in the scalreg package. |

`exclude` |
Indices of variables to be excluded from the model; default is none. |

`output_all` |
In addition to the vector of coefficients, if |

`...` |
Additional arguments to be passed to |

First the Lasso path is computed using `glmnet`

from
glmnet. Next the particular point on the path corresponding to the
square-root Lasso solution is found. As the path is only computed on a grid
of points, the square-root solution is approximate.

Either an estimated vector of regression coefficients with nvars
components or, if `output_all`

is `true`

, a list with components

`beta`

the vector of regression coefficents

`a0`

an intercept term

`sigma_hat`

an estimate of the noise standard deviation; this is calculated as square-root of the average residual sums of squares

`glm_obj`

the fitted

`glmnet`

object, an S3 class “`glmnet`

"

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

1 2 3 | ```
x <- matrix(rnorm(100*250), 100, 250)
y <- x[, 1] + x[, 2] + rnorm(100)
out <- sqrt_lasso(x, y)
``` |

```
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.