Commit f429e234 authored by Tom Reynkens's avatar Tom Reynkens

Provide informative error message when the maximum value of lambda cannot be computed

parent 72bf400e
Type: Package
Package: smurf
Title: Sparse Multi-Type Regularized Feature Modeling
Version: 0.4.1.9007
Date: 2018-10-24
Version: 0.4.1.9008
Date: 2018-10-25
Authors@R: c(
person("Tom", "Reynkens", email = "tomreynkens@hotmail.com", role = c("aut", "cre"),
comment = c(ORCID = "0000-0002-5516-5107")),
......
......@@ -110,8 +110,20 @@
print("Computing maximum value of lambda")
}
lambda.max <- max(.max.lambda(X = X, y = y, weights = weights, start = start, offset = offset, family = family,
pen.cov = pen.cov, n.par.cov = n.par.cov, pen.mat = pen.mat, pen.mat.transform = pen.mat.transform))
# Return NULL if error
tmp <- tryCatch(.max.lambda(X = X, y = y, weights = weights, start = start, offset = offset, family = family,
pen.cov = pen.cov, n.par.cov = n.par.cov, pen.mat = pen.mat,
pen.mat.transform = pen.mat.transform),
error = function(e) NULL)
if (is.null(tmp)) {
stop("An error occured when determining the maximum value of lambda. Please set it manually using 'lambda.max' in the control object.")
} else {
lambda.max <- max(tmp)
}
if (lambda.max <= 0) {
stop("The computed value of 'lambda.max' is not strictly positive,",
......
......@@ -7,6 +7,7 @@
\subsection{Changes in \code{R}-code:}{
\itemize{
\item \code{p}: change order of \code{group} and \code{refcat} arguments.
\item \code{mtpglm}: catch errors when computing the maximum value of lambda (\href{https://gitlab.com/TReynkens/smurf/issues/2}{#2}).
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment