Repository navigation
Conversation
This was referenced Oct 24, 2026
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.
Summary
lme4 2.1-0 reached CRAN on 2026-10-23. With it, master fails 5 expectations in
test_augdat.Randtest_datafit.R, and so do the CI runs (see, e.g. #573 to #576). This PR adapts the two tests and changes no package code.A separate issue will open discussion on what we should do with the code
This PR was assisted by Claude.
Causes
test_augdat.R:244and:308compare the traditional and the augmented-data projection of a Bernoulli reference model. For submodels with group-level terms, both projections calllme4::glmer(), which the test setup runs withnAGQ = 30.lme4 computes the objective for the group-level parameters with
binomial()$aic. That function rounds non-integer responses (traditional projection) and non-integer weights (augmented-data projection); lme4/lme4#682 describes the rounding. Up to lme4 2.0-6,nAGQ > 1used the deviance residuals, which do not round, and the two projections agreed. In 2.1-0,glmerAGQ()uses the sameaic()term as the Laplace approximation (lme4 NEWS: "normalizing constants are now included in the log-likelihoods and deviances of models fitted with nAGQ>1"; reported in lme4/lme4#1011). Now the two projections fit different rounded objectives. In the test data the rounded responses separate the data: in 4 of the 6 traditional projections, the largest fixed effect is between 38 and 60 in absolute value, against at most 1.7 with lme4 2.0-6.nAGQ = 0does not rescue the comparison. It makes the fixed effects agree in most fits, but the group-level standard deviation still comes from the rounded objective, and one setup still differs.test_datafit.R:252checks that the full-data ranking contains only terms of the formula. The default search terms also contain the linear term of each smooth term, for examples.1fors(s.1). With lme4 2.1-0 and gamm4 0.3-0, the forward search forrstanarm.gamm.brnllpicks(1 | z.1) + s.1at the second step, where it used to pick(1 | z.1) + s(s.1). Both are valid results, and the check for the CV rankings already accepts such linear terms.Changes
test_augdat.R: the two comparisons skip submodels with group-level terms. They now cover the submodels fitted byfit_glm_ridge_callback(), which is what their titles say. I removed the extra tolerances for the group-level case. The test setup still runs these projections, so other tests still use them.helpers/testers.R:vsel_tester()accepts the linear terms of smooth terms in the full-data ranking, as it already did for the CV rankings.NEWS.mdentry.The rounding also affects projections onto binomial submodels with group-level terms outside the tests, with any lme4 version at the default
nAGQ = 1. I will open a separate issue for that.Tests
On master 73cf0ee with gamm4 0.3-0,
test_augdat.Randtest_datafit.Rgive 5 failures with lme4 2.1-0 and none with lme4 2.0-6. With this PR, the full suite passes withNOT_CRAN=trueunder both lme4 versions: 253 tests, 0 failures (55 655 expectations with lme4 2.0-6, 55 401 with lme4 2.1-0). Both runs show the warnings of master plus a CHOLMOD "not positive definite" warning intest_div_minimizer.R. That warning appears with both lme4 versions and did not appear in our earlier runs of master with gamm4 0.2.7. Tested with R 4.6.1, brms 2.23.0, rstanarm 2.32.2, gamm4 0.3-0, and lme4 2.0-6 and 2.1-0, on CSC Roihu (Linux, AMD EPYC).