Learn R Programming

biglars (version 1.0.2)

biglars.fit: Least-Angle, Lasso and Stepwise Regression

Description

Least-angle, lasso and stepwise methods for linear regression.

Usage

biglars.fit(x, y, type = "lasso", removeColumns = TRUE, eps = sqrt(.Machine$double.eps), blockSize = NULL, maxStages = NULL)

Arguments

x
A matrix or ff of numeric predictors. The number of columns should not be larger than the number of rows.
y
A numeric response vector or 1-column ff.
type
The type of regression to be performed. The usual choices are
lasso
lasso method (L1 penalty)

lar
least-angle regression

stepwise
forward stepwise regression

but see the details section below for other possibilities. Default is "lasso".

removeColumns
A logical scalar indicating whether columns with small variance should be removed from consideration as predictors; default `TRUE'.
eps
Numerical tolerance used for assessment of sign, equality, rank determination, column removal, etc. The default is the square root of .Machine\$double.eps, the relative machine precision.
blockSize
If NULL, the block size is determined using methods of class ff. Otherwise the passed value is used.
maxStages
The maximum number of stages allowed in the algorithm. This argument applies only to the lasso option. The defaults is 2p for lasso, where p if the number of predictors.

Value

A list with the following elements:
coef
An array of regression coefficients for each stage.
moves
Any array describing variables added or removed at each stage.
RSS
Residual sum of squares.

Details

An intercept is always included in the regression. This function calls other routines to do the core calculations, one of biglars.fit.lasso, biglars.fit.lar, or biglars.fit.stepwise. These functions are associated with Fraley et~al. (2007) and will not be undergoing further development except for things like bug fixes. For ongoing development of least-angle regression, see the glars library.

References

B. Efron, T. Hastie, I. Johnstone and R. Tibshirani (2004), "Least Angle Regression" (with discussion), Annals of Statistics 32, 407-499.

C. Fraley and T. Hesterberg (2007), " Least-Angle Regression for Large Datasets", Technical Report, Insightful Corporation.

See Also

qrBlockApply

Examples

Run this code

data(diabetes)

larFit <- biglars.fit(diabetes$x, diabetes$y, type = "lar")
larFitBlocked <- biglars.fit(diabetes$x, diabetes$y, type = "lar",
                           blockSize = 50)

lassoFit <- biglars.fit(diabetes$x, diabetes$y, type = "lasso")
lassoFitBlocked <- biglars.fit(diabetes$x, diabetes$y, type = "lasso",
                              blockSize = 34)

Run the code above in your browser using DataLab