Learn R Programming

rqPen (version 4.1.3)

coef.rq.pen.seq: Returns coefficients of a rq.pen.seq object

Description

Returns coefficients of a rq.pen.seq object

Usage

# S3 method for rq.pen.seq
coef(
  object,
  tau = NULL,
  a = NULL,
  lambda = NULL,
  modelsIndex = NULL,
  lambdaIndex = NULL,
  ...
)

Value

A list of a matrix of coefficients for each tau and a combination

Arguments

object

rq.pen.seq object

tau

Quantile of interest. Default is NULL, which will return all quantiles. Should not be specified if modelsIndex is used.

a

Tuning parameter of a. Default is NULL, which returns coefficients for all values of a. Should not be specified if modelsIndex is used.

lambda

Tuning parameter of \(\lambda\). Default is NULL, which returns coefficients for all values of \(\lambda\).

modelsIndex

Index of the models for which coefficients should be returned. Does not need to be specified if tau or a are specified.

lambdaIndex

Index of the lambda values for which coefficients should be returned. Does not need to be specified if lambda is specified.

...

Additional parameters.

Author

Ben Sherwood, ben.sherwood@ku.edu

Examples

Run this code
x <- matrix(runif(800),ncol=8)
y <- 1 + x[,1] + x[,8] + (1+.5*x[,3])*rnorm(100)
m1 <- rq.pen(x,y,penalty="ENet",a=c(0,.5,1),tau=c(.25,.75),lambda=c(.1,.05,.01))
allCoefs <- coef(m1)
targetCoefs <- coef(m1,tau=.25,a=.5,lambda=.1)
idxApproach <- coef(m1,modelsIndex=2)
bothIdxApproach <- coef(m1,modelsIndex=2,lambdaIndex=1)

Run the code above in your browser using DataLab