Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add check_convergence method for parsnip _glm model #605

Merged
merged 4 commits into from
Sep 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ S3method(check_collinearity,probitmfx)
S3method(check_collinearity,zerocount)
S3method(check_collinearity,zeroinfl)
S3method(check_concurvity,gam)
S3method(check_convergence,"_glm")
S3method(check_convergence,default)
S3method(check_convergence,glmmTMB)
S3method(check_convergence,merMod)
Expand Down
6 changes: 6 additions & 0 deletions R/check_convergence.R
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#' how to resolve convergence issues. Another clue might be large parameter
#' values, e.g. estimates (on the scale of the linear predictor) larger than
#' 10 in (non-identity link) generalized linear model *might* indicate
#' [complete separation](https://stats.oarc.ucla.edu/other/mult-pkg/faq/general/faqwhat-is-complete-or-quasi-complete-separation-in-logisticprobit-regression-and-how-do-we-deal-with-them/).

Check warning on line 35 in R/check_convergence.R

View workflow job for this annotation

GitHub Actions / lint-changed-files / lint-changed-files

file=R/check_convergence.R,line=35,col=121,[line_length_linter] Lines should not be more than 120 characters. This line is 189 characters.
#' Complete separation can be addressed by regularization, e.g. penalized
#' regression or Bayesian regression with appropriate priors on the fixed effects.
#'
Expand Down Expand Up @@ -107,3 +107,9 @@
# https://github.com/glmmTMB/glmmTMB/issues/275
isTRUE(x$sdr$pdHess)
}


#' @export
check_convergence._glm <- function(x, ...) {
isTRUE(x$fit$converged)
}
Loading