mk.steps = function (steps, min.lambda.ratio, nsteps) { if (steps=="auto") { steps <- exp (seq (log(1), log(min.lambda.ratio), length.out=nsteps)) steps <- steps[steps>=min.lambda.ratio] } else { if (max(steps) > 1 || min(steps) < 0) return(NULL) steps <- sort (steps, decreasing=T) steps[steps==0] <- 0.00001 } return (steps) } lasso.path.isolambda_descent = function (x, y, penalizations=NULL, min.lambda.ratio=0.05, steps="auto") { nsteps <- min(dim(x)) if (dim(x)[2] != length(y)) return x <- as.double(x) y <- as.double(y) if (!is.null(penalizations)) penalizations <- as.double(penalizations) steps <- mk.steps (steps, min.lambda.ratio, nsteps) .Call ("lasso_path_isolambda_descent_R", x, y, penalizations, steps) } lasso.path.homotopy = function (x, y, penalizations=NULL, min.lambda.ratio=0.05) { if (dim(x)[2] != length(y)) return x <- as.double(x) y <- as.double(y) if (!is.null(penalizations)) penalizations <- as.double(penalizations) .Call ("lasso_path_homotopy_R", x, y, penalizations, min.lambda.ratio) } lasso.path.ccd = function (x, y, penalizations=NULL, min.lambda.ratio=0.05, steps="auto", max.overcorrelation=0.001) { nsteps <- min(dim(x)) if (dim(x)[2] != length(y)) return x <- as.double(x) y <- as.double(y) if (!is.null(penalizations)) penalizations <- as.double(penalizations) steps <- mk.steps (steps, min.lambda.ratio, nsteps) .Call ("lasso_path_ccd_R", x, y, penalizations, steps, max.overcorrelation) }