Learn R Programming

rqPen (version 4.1.3)

coef.rq.pen.seq.cv: Returns coefficients from a rq.pen.seq.cv object.

Description

Returns coefficients from a rq.pen.seq.cv object.

Usage

# S3 method for rq.pen.seq.cv
coef(
  object,
  septau = ifelse(object$fit$penalty != "gq", TRUE, FALSE),
  cvmin = TRUE,
  useDefaults = TRUE,
  tau = NULL,
  ...
)

Value

Returns coefficients

Arguments

object

An rq.pen.seq.cv object.

septau

Whether tuning parameter should be optimized separately for each quantile.

cvmin

If TRUE then minimum error is used, if FALSE then one standard error rule is used.

useDefaults

Whether the default results are used. Set to FALSE if you you want to specify specific models and lambda values.

tau

Quantiles of interest.

...

Additional parameters sent to coef.rq.pen.seq()

Author

Ben Sherwood, ben.sherwood@ku.edu

Examples

Run this code
 if (FALSE) {
 set.seed(1)
 x <- matrix(rnorm(800),nrow=100)
 y <- 1 + x[,1] - 3*x[,5] + rnorm(100)
 lassoModels <- rq.pen.cv(x,y,tau=seq(.1,.9,.1))
 coefficients(lassoModels,septau=FALSE)
 coefficients(lassoModels,cvmin=FALSE)
}

Run the code above in your browser using DataLab