rq.lasso.fit: Estimates a quantile regression model with a lasso penalized...

View source: R/mainFunctions.R

rq.lasso.fitR Documentation

Estimates a quantile regression model with a lasso penalized quanitle loss function.

Description

Fits a quantile regression model with the LASSO penalty. Uses the augmented data approach similar to the proposal in Sherwood and Wang (2016).

Usage

rq.lasso.fit(
  x,
  y,
  tau = 0.5,
  lambda = NULL,
  weights = NULL,
  intercept = TRUE,
  coef.cutoff = 1e-08,
  method = "br",
  penVars = NULL,
  scalex = TRUE,
  lambda.discard = TRUE,
  ...
)

Arguments

x

Matrix of predictors.

y

Vector of responses.

tau

Quantile of interest.

lambda

Tuning parameter.

weights

Weights for the objective function.

intercept

Whether model should include an intercept. Constant does not need to be included in "x".

coef.cutoff

Coefficients below this value will be set to zero.

method

Use method "br" or "fn" as outlined in quantreg package. We have found "br" to be more stable for penalized regression problems.

penVars

Variables that should be penalized. With default value of NULL all variables are penalized.

scalex

If set to true the predictors will be scaled to have mean zero and standard deviation of one before fitting the model. The output returned will be on the original scale of the data.

lambda.discard

If TRUE lambda sequence will stop early if for small values of lambda the estimates do not change much.

...

Additional items to be sent to rq. Note this will have to be done carefully as rq is run on the augmented data to account for penalization and could provide strange results if this is not taken into account.

Value

Returns the following:

coefficients

Coefficients from the penalized model.

PenRho

Penalized objective function value.

residuals

Residuals from the model.

rho

Objective function evaluation without the penalty.

tau

Conditional quantile being modeled.

n

Sample size.

References

  • Tibshirani, R. (1996). Regression shrinkage and selection via the lasso. Journal of the Royal Statistical Society. Series B, 58, 267–288.

  • Wu, Y. and Liu, Y. (2009). Variable selection in quantile regression. Statistica Sinica, 19, 801–817.

  • Sherwood, B. and Wang, L. (2016) Partially linear additive quantile regression in ultra-high dimension. Annals of Statistics 44, 288–317.

Examples

## Not run: 
x <- matrix(rnorm(800),nrow=100)
y <- 1 + x[,1] - 3*x[,5] + rnorm(100)
lassoModel <- rq.lasso.fit(x,y,lambda=.1)

## End(Not run)

bssherwood/rqpen documentation built on Sept. 15, 2024, 9:39 p.m.