Learn R Programming

orderedLasso (version 1.7.1)

orderedLasso.path: Fit a path of ordered lasso models

Description

Fit a path of ordered lasso models over different values of the regularization parameter.

Usage

orderedLasso.path(x, y, lamlist = NULL, minlam = NULL, maxlam = NULL,
  nlam = 50, flmin = 0.005, intercept = TRUE, standardize = TRUE,
  method = c("Solve.QP", "GG"), niter = 500, iter.gg = 100,
  strongly.ordered = FALSE, trace = FALSE, epsilon = 1e-05)

Arguments

x

A matrix of predictors, where the rows are the samples and the columns are the predictors

y

A vector of observations, where length(y) equals nrow(x)

lamlist

Optional vector of values of lambda (the regularization parameter)

minlam

Optional minimum value for lambda

maxlam

Optional maximum value for lambda

nlam

Number of values of lambda to be tried. Default nlam = 50

flmin

Fraction of maxlam; minlam= flmin*maxlam. If computation is slow, try increasing flmin to focus on the sparser part of the path

intercept

True if there is an intercept in the model.

standardize

Standardize the data matrix x. Default is TRUE.

method

Two options available, Solve.QP and Generalized Gradient.

niter

Number of iterations of ordered lasso, initialized to 500.

iter.gg

Number of iterations of genearalized gradient; Default iter.gg = 100

strongly.ordered

An option which allows users to order the coefficients non-decreasing in absolute value. Details can be seen in the orderedLasso Description.

trace

Output option; trace=TRUE gives verbose output

epsilon

Error tolerance parameter for convergence criterion. Default is 1e-5

Value

bp

p by nlam matrix of estimated positive coefficients(p=#variables)

bn

p by nlam matrix of estimated negative coefficients

beta

p by nlam matrix of estimated coefficients

b0

a length nlam vector of estimated intercepts

lamlist

Vector of values of lambda used

err

Vector of errors

call

The call to orderedLasso.path

Examples

Run this code
# NOT RUN {
set.seed(3)
n = 50
b = c(4,3,1,0)
p = length(b)
x = matrix(rnorm(n*p),nrow = n)
sigma = 5
y = x %*% b + sigma * rnorm(n, 0, 1)
path1 = orderedLasso.path(x,y, intercept =  FALSE, 
        method = "Solve.QP", strongly.ordered = TRUE)
plot(path1)
print(path1)
# }

Run the code above in your browser using DataLab