Skip to content

Commit

Permalink
add check for negative penalty strength
Browse files Browse the repository at this point in the history
  • Loading branch information
yunqiyang0215 committed Jun 1, 2023
1 parent 2e3c219 commit e40e06f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions R/ud_fit.R
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,8 @@ ud_fit <- function (fit, X, control = list(), verbose = TRUE) {
control$rank1.update,
control$unconstrained.update))
if (control$lambda!=0)
if (control$lambda < 0)
stop("Penalty strength lambda can't be negative")
cat(sprintf("covariance regularization: penalty strength = %0.2e, method = %s\n",
control$lambda, control$penalty.type))
cat(sprintf("mixture weights update: %s\n",control$weights.update))
Expand Down

0 comments on commit e40e06f

Please sign in to comment.