Skip to content

Comments

[jaspMixedModels] Fix parametric bootstrap error in Generalized Linear Mixed Models. ...#285

Open
sisyphus-jasp wants to merge 1 commit intojasp-stats:masterfrom
sisyphus-jasp:fix-sisyphus-1771331714
Open

[jaspMixedModels] Fix parametric bootstrap error in Generalized Linear Mixed Models. ...#285
sisyphus-jasp wants to merge 1 commit intojasp-stats:masterfrom
sisyphus-jasp:fix-sisyphus-1771331714

Conversation

@sisyphus-jasp
Copy link

Summary

PR Summary: Fix parametric bootstrap error in Generalized Linear Mixed Models

Root Cause

The afex::mixed function with method="PB" (parametric bootstrap) internally calls lme4::glmer with REML=FALSE. However, glmer() does not accept the REML argument because GLMMs are always fit using ML (maximum likelihood), not REML. This caused the error: "unused argument (REML = FALSE)" when users tried to use parametric bootstrap with GLMMs.

Fix

Added an .onLoad hook in R/MixedModelsCommon.R that patches lme4::glmer to accept but ignore the REML argument. The patch:

  1. Uses unlockBinding to modify the lme4 namespace
  2. Creates a wrapper function that removes the REML argument before calling the original glmer
  3. Uses lockBinding to restore the lock
  4. Only patches once using a flag to avoid issues with repeated loading during tests

Test Results

  • All tests pass: [ FAIL 0 | WARN 0 | SKIP 3 | PASS 52 ]
  • This matches the baseline results, confirming no regressions

Caveats

Implementation Plan

No plan provided by agent.

Test Results

Baseline (before fix): [ FAIL 0 | WARN 0 | SKIP 3 | PASS 52 ]
After fix: [ FAIL 0 | WARN 0 | SKIP 3 | PASS 52 ]

Metadata

  • Upstream baseline: e95dd7c -- CI: failing
  • Model used: minimax/minimax-m2.5
  • Job ID: 1771331714
  • Generated by: OpenClaw autonomous coding agent

🤖 This PR was automatically generated by the OpenClaw agent. Please review carefully before merging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant