Skip to content

Commit 9fd9f0d

Browse files
committed
close #459
1 parent 5484259 commit 9fd9f0d

File tree

4 files changed

+7
-36
lines changed

4 files changed

+7
-36
lines changed

DESCRIPTION

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Type: Package
22
Package: performance
33
Title: Assessment of Regression Models Performance
4-
Version: 0.9.1.5
4+
Version: 0.9.1.6
55
Authors@R:
66
c(person(given = "Daniel",
77
family = "Lüdecke",
@@ -65,8 +65,6 @@ Imports:
6565
methods,
6666
stats,
6767
utils
68-
Remotes:
69-
easystats/datawizard, easystats/bayestestR
7068
Suggests:
7169
AER,
7270
afex,
@@ -127,3 +125,5 @@ Language: en-US
127125
RoxygenNote: 7.2.1
128126
Config/testthat/edition: 3
129127
Roxygen: list(markdown = TRUE)
128+
Remotes:
129+
easystats/insight, easystats/datawizard, easystats/bayestestR

NAMESPACE

-2
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ S3method(check_collinearity,probitmfx)
3131
S3method(check_collinearity,zerocount)
3232
S3method(check_collinearity,zeroinfl)
3333
S3method(check_concurvity,gam)
34-
S3method(check_convergence,default)
35-
S3method(check_convergence,merMod)
3634
S3method(check_distribution,default)
3735
S3method(check_distribution,numeric)
3836
S3method(check_heteroscedasticity,default)

R/check_convergence.R

+2-28
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,7 @@
44
#' @description `check_convergence()` provides an alternative convergence
55
#' test for `merMod`-objects.
66
#'
7-
#' @param x A `merMod`-object.
8-
#' @param tolerance Indicates up to which value the convergence result is
9-
#' accepted. The smaller `tolerance` is, the stricter the test
10-
#' will be.
11-
#' @param ... Currently not used.
7+
#' @inheritParams insight::is_converged
128
#'
139
#' @return `TRUE` if convergence is fine and `FALSE` if convergence
1410
#' is suspicious. Additionally, the convergence value is returned as attribute.
@@ -63,27 +59,5 @@
6359
#' }
6460
#' @export
6561
check_convergence <- function(x, tolerance = 0.001, ...) {
66-
UseMethod("check_convergence")
67-
}
68-
69-
70-
#' @export
71-
check_convergence.default <- function(x, tolerance = 0.001, ...) {
72-
insight::print_color(sprintf("check_convergence() does not work for models of class '%s'.\n", class(x)[1]), "red")
73-
}
74-
75-
76-
#' @export
77-
check_convergence.merMod <- function(x, tolerance = 0.001, ...) {
78-
insight::check_if_installed("Matrix")
79-
80-
relgrad <- with(x@optinfo$derivs, Matrix::solve(Hessian, gradient))
81-
82-
# copy logical value, TRUE if convergence is OK
83-
retval <- max(abs(relgrad)) < tolerance
84-
# copy convergence value
85-
attr(retval, "gradient") <- max(abs(relgrad))
86-
87-
# return result
88-
retval
62+
insight::is_converged(x, tolerance = tolerance, ...)
8963
}

man/check_convergence.Rd

+2-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)