Repository navigation
Conversation
…fference Hessian of large smoothing variances is inexact
…and test with fits for which the full lme4 check gives false flags
…ger gamm4() submodel, and muffle the gradient warning in a prediction test
…est that the non-integer fits are checked
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR is part of #479. #630 covers additive submodels without group-level terms.
Summary
gamm4::gamm4()fits the lme4 part of a submodel with smooth and group-level terms, but it does not calllme4::checkConv(). So projpred's convergence check of these submodels uses only the convergence code and the warnings of the optimizer. This PR addsgamm_check_conv(), which applies the gradient rule oflme4::checkConv()aftergamm4(), with the tolerance ofcheck.conv.grad. A fit that fails the rule gives the lme4 warning, and the projection warns that the submodel fits might not have converged.The new check does not test the Hessian, and it uses the unscaled gradient if it cannot compute the scaled gradient. With responses without noise, as in the projection, the finite-difference Hessian of large smoothing parameters can be not positive definite although the fit converged. In a study of 240
gamm4()fits to such responses, the fulllme4::checkConv()gave a nonzero code for 17 of 80 Gaussian fits. The new check gave none for these 80 fits. A code comment lists the other differences fromlme4::checkConv().Tests
New tests in
test_submodel_fitters.Rcompare the new check withlme4::checkConv()inglmer()andlmer(). They cover the special cases (Hessian not positive definite, NA gradient, fit at a boundary, actions"ignore"and"stop") and the projection warning. They also check that converged fits give no warning. The fits use Gaussian data without noise, non-integer binomial responses (as the existing Poisson test does), and the smooth term of a linear function. A prediction test intest_proj_predfun.Rnow muffles the new warning. Without the change, the new tests give 1 failure and 2 errors. The full suite passes (R 4.6.1, lme4 2.0.6, gamm4 0.3.0) with the same warnings as master.This PR was assisted by Claude.