Open mmp3 opened 3 years ago
A simple workaround is to create a dummy fraclist
and then just select what you want.
The following works with the vignette example from above:
my_lambda <- 0.15
fraclist <- c( my_lambda , my_lambda * 0.99)
fit <- trac(Z = log(mat+1) , y = y , A = A , fraclist = fraclist )
It turns out that fraclist
must be in descending order. Otherwise, it will throw an error. This requirement is not documented.
@mmp3 Thanks for raising this issue! Indeed, we did not beta-test this case, and we will fix it. The issue stems from the fact you point out in c-lasso where we use a path algorithm to solve the underlying optimization problem. It is, of course, possible to solve for a single lambda, and we can include this option. In terms of speed, your workaround above should be fine since the path algorithm will, at least in the sparse part of the aggregation path, be as fast in returning all values as returning a single value. We'll update this issue once, single-lambda trac computations are possible.
OK, thank you for confirming this, @muellsen. I was concerned that perhaps I misunderstood the model or the implementation.
And thank you for the great model and package!
Suppose I have already chosen a penalization parameter lambda, and I want to fit
trac()
on a dataset with only that value oflambda
.This situation arises if I want to perform the cross-validation for selection of regularization parameter
lambda
outside oftrac()
, for instance.Let's suppose I want to use
lambda = 0.15
. Following the vignette, the following attempt causes an error inc-lasso
:The error message is:
It looks like it fails because
c-lasso
requires at least two values oflambda
in order to work.In support of that hypothesis, the same error message is returned if I try to execute
trac()
as in the vignette but restrictingnlam=1
: