diff options
| author | Gertjan van den Burg <gertjanvandenburg@gmail.com> | 2021-01-09 15:05:09 +0000 |
|---|---|---|
| committer | Gertjan van den Burg <gertjanvandenburg@gmail.com> | 2021-01-09 15:05:09 +0000 |
| commit | a9641c7743c865b28bbad72f12e0affd50431c6f (patch) | |
| tree | 4f66ded7d25b08f06c0ee5ad6cdfe1061bf886fa | |
| parent | Change arXiv identifier to preferred format (diff) | |
| download | sparsestep-a9641c7743c865b28bbad72f12e0affd50431c6f.tar.gz sparsestep-a9641c7743c865b28bbad72f12e0affd50431c6f.zip | |
Code formatting
| -rw-r--r-- | R/path.sparsestep.R | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/R/path.sparsestep.R b/R/path.sparsestep.R index 700cf51..fb4f2e9 100644 --- a/R/path.sparsestep.R +++ b/R/path.sparsestep.R @@ -82,7 +82,8 @@ path.sparsestep <- function(x, y, max.depth=10, gamma0=1e3, gammastop=1e-4, IMsteps=2, gammastep=2.0, normalize=TRUE, intercept=TRUE, force.zero=TRUE, threshold=1e-7, - XX=NULL, Xy=NULL, use.XX=TRUE, use.Xy=TRUE, quiet=FALSE) + XX=NULL, Xy=NULL, use.XX=TRUE, use.Xy=TRUE, + quiet=FALSE) { call <- match.call() @@ -111,9 +112,9 @@ path.sparsestep <- function(x, y, max.depth=10, gamma0=1e3, gammastop=1e-4, } } - if (!quiet) { - cat("Found maximum value of lambda: 2^(", log(lambda.max)/log(2), ")\n") - } + if (!quiet) { + cat("Found maximum value of lambda: 2^(", log(lambda.max)/log(2), ")\n") + } iter <- iter + 1 if (is.null(last.beta)) { @@ -139,9 +140,9 @@ path.sparsestep <- function(x, y, max.depth=10, gamma0=1e3, gammastop=1e-4, break } } - if (!quiet) { - cat("Found minimum value of lambda: 2^(", log(lambda.min)/log(2), ")\n") - } + if (!quiet) { + cat("Found minimum value of lambda: 2^(", log(lambda.min)/log(2), ")\n") + } iter <- iter + 1 if (is.null(last.beta)) { betas.min <- beta @@ -185,12 +186,12 @@ path.sparsestep <- function(x, y, max.depth=10, gamma0=1e3, gammastop=1e-4, lambda.search <- function(x, y, depth, max.depth, have.zeros, left, right, lidx, ridx, XX, Xy, gamma0, gammastep, gammastop, - IMsteps, force.zero, threshold, quiet) + IMsteps, force.zero, threshold, quiet) { - if (!quiet) { - cat("Running search in interval [", left, ",", right, "] ... \n") - } - nvars <- dim(XX)[1] + if (!quiet) { + cat("Running search in interval [", left, ",", right, "] ... \n") + } + nvars <- dim(XX)[1] betas <- NULL lambdas <- NULL |
