lasso.stars(x, y, rep.num = 20, lambda = NULL, nlambda = 100,
lambda.min.ratio = 0.001, stars.thresh = 0.1, sample.ratio = NULL,
alpha = 1, verbose = TRUE)
n
by d
data matrix representing n
observations in d
dimensions
n
-dimensional response vector
20
.
lambda = NULL
and have the program compute its own lambda
sequence based on nlambda
and lambda.min.ratio
. Users can also specify a sequence to override this. Use with care - it is better to supply a decreasing sequence values than a single (small) value.
100
.
lambda
, as a fraction of the uppperbound (MAX
) of the regularization parameter which makes all estimates equal to 0
. The program can automatically generate lambda
as a sequence of length = nlambda
starting from MAX
to lambda.min.ratio*MAX
in log scale. The default value is 0.001
.
0.1
. The alternative value is 0.05
. Only applicable when criterion = "stars"
10*sqrt(n)/n
when n>144
and 0.8
when n<=144< code="">, where n
is the sample size.
=144<>
1
(lasso).
verbose = FALSE
, tracing information printing is disabled. The default value is TRUE
.
d
by nlambda
matrix)
0.05
is chosen under the assumption that the model is correctly specified. In applications, the model is usually an approximation of the true model, 0.1
is a safer choice. The implementation is based on the popular package "glmnet".
bigdata-package
#generate data
x = matrix(rnorm(50*80),50,80)
beta = c(3,2,1.5,rep(0,77))
y = rnorm(50) + x%*%beta
#StARS for Lasso
z1 = lasso.stars(x,y)
summary(z1)
plot(z1)
#StARS for Lasso
z2 = lasso.stars(x,y, stars.thresh = 0.05)
summary(z2)
plot(z2)
#StARS for Lasso
z3 = lasso.stars(x,y,rep.num = 50)
summary(z3)
plot(z3)
Run the code above in your browser using DataLab