Showing 2 of 13 files from the diff.

@@ -43,25 +43,44 @@
Loading
43 43
44 44
  # get lambda sequence -----------------------------------------------------
45 45
46 -
  lamb <- lambdalasso(ggmix_object,
47 -
    penalty.factor = penalty.factor,
48 -
    nlambda = nlambda,
49 -
    lambda_min_ratio = lambda_min_ratio,
50 -
    eta_init = eta_init,
51 -
    epsilon = epsilon
52 -
  )
46 +
  if (is.null(lambda)) {
47 +
    
48 +
    if (lambda_min_ratio >= 1) stop("lambda_min_ratio should be less than 1")
49 +
    
50 +
    lamb <- lambdalasso(ggmix_object,
51 +
                        penalty.factor = penalty.factor,
52 +
                        nlambda = nlambda,
53 +
                        lambda_min_ratio = lambda_min_ratio,
54 +
                        eta_init = eta_init,
55 +
                        epsilon = epsilon
56 +
    )
57 +
    
58 +
    lambda_max <- lamb$sequence[[1]]
59 +
    lamb$sequence[[1]] <- .Machine$double.xmax
60 +
    
61 +
    tuning_params_mat <- matrix(lamb$sequence, nrow = 1, ncol = nlambda, byrow = T)
62 +
    dimnames(tuning_params_mat)[[1]] <- list("lambda")
63 +
    dimnames(tuning_params_mat)[[2]] <- paste0("s", seq_len(nlambda))
64 +
    lambda_names <- dimnames(tuning_params_mat)[[2]]
65 +
    
66 +
  } else {
67 +
    
68 +
    if (any(lambda < 0)) stop("lambdas should be non-negative")
69 +
    nlambda <- length(lambda)
70 +
    lambda <- as.double(rev(sort(lambda)))
71 +
    lambda_max <- lambda[[1]]
72 +
    
73 +
    tuning_params_mat <- matrix(lambda, nrow = 1, ncol = nlambda, byrow = T)
74 +
    dimnames(tuning_params_mat)[[1]] <- list("lambda")
75 +
    dimnames(tuning_params_mat)[[2]] <- paste0("s", seq_len(nlambda))
76 +
    lambda_names <- dimnames(tuning_params_mat)[[2]]
77 +
  }
53 78
54 -
  lambda_max <- lamb$sequence[[1]]
55 79
56 -
  lamb$sequence[[1]] <- .Machine$double.xmax
57 80
58 81
59 -
  # create matrix to store results ------------------------------------------
60 82
61 -
  tuning_params_mat <- matrix(lamb$sequence, nrow = 1, ncol = nlambda, byrow = T)
62 -
  dimnames(tuning_params_mat)[[1]] <- list("lambda")
63 -
  dimnames(tuning_params_mat)[[2]] <- paste0("s", seq_len(nlambda))
64 -
  lambda_names <- dimnames(tuning_params_mat)[[2]]
83 +
  # create matrix to store results ------------------------------------------
65 84
66 85
  coefficient_mat <- matrix(
67 86
    nrow = p_design + 3,

@@ -92,7 +92,7 @@
Loading
92 92
#' @param epsilon Convergence threshold for block relaxation of the entire
93 93
#'   parameter vector \eqn{\Theta = ( \beta, \eta, \sigma^2 )}. The algorithm
94 94
#'   converges when \deqn{crossprod(\Theta_{j+1} - \Theta_{j}) < \epsilon}.
95 -
#'   Defaults value is 1E-7
95 +
#'   Defaults value is 1E-4
96 96
#' @param verbose display progress. Can be either 0,1 or 2. 0 will not display
97 97
#'   any progress, 2 will display very detailed progress and 1 is somewhere in
98 98
#'   between. Default: 0.
Files Coverage
R 68.32%
Project Totals (13 files) 68.32%
1
comment: false
2

3
coverage:
4
  status:
5
    project:
6
      default:
7
        target: auto
8
        threshold: 1%
9
    patch:
10
      default:
11
        target: auto
12
        threshold: 1%
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading