Skip to content

Commit

Permalink
When the weight matrix is zero, lambda2 is now fixed to 0 instead of …
Browse files Browse the repository at this point in the history
…1 since it is more intuitive
  • Loading branch information
louisdijkstra committed May 14, 2024
1 parent e0845d9 commit 01a6891
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions R/CVN.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#' weight matrix \eqn{W}
#' @param lambda1 Vector with different \eqn{\lambda_1} LASSO penalty terms
#' (Default: \code{1:2})
#' @param lambda2 Vector with different \eqn{\lambda_2} global smoothing parameter values
#' @param <- Vector with different \eqn{\lambda_2} global smoothing parameter values
#' (Default: \code{1:2})
#' @param gamma1 A vector of \eqn{\gamma_1}'s LASSO penalty terms, where
#' \eqn{\gamma_1 = \frac{2 \lambda_1}{m p (1 - p)}}. If \code{gamma1}
Expand Down Expand Up @@ -149,10 +149,10 @@ CVN <- function(data, W, lambda1 = 1:2, lambda2 = 1:2,

# When the weight matrix is completely zero, there is no smoothing
# between graphs. Therefore, the value of lambda2 is irrelevant.
# In this case, we fix lambda2 to 1 and inform the user of this fact
# In this case, we fix lambda2 to 0 and inform the user of this fact
if (sum(W) == 0) {
warning("Since weight matrix W is zero, there is no smoothing. lambda2 is fixed to 1")
lambda2 <- 1
warning("Since weight matrix W is zero, there is no smoothing. lambda2 is fixed to 0")
lambda2 <- 0
}

# Set-up cluster ---------------------------
Expand Down

0 comments on commit 01a6891

Please sign in to comment.