Skip to content

Fix zero-inflation parameters in bootstrapped glmmTMB output - #1287

Merged
strengejacke merged 12 commits into
mainfrom
glmmtmb-bootstrap-zi
Oct 29, 2026
Merged

strengejacke merged 12 commits into
mainfrom
glmmtmb-bootstrap-zi

Conversation

@jmgirard

@jmgirard jmgirard commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #1284

The example from the issue now gives:

set.seed(1)
bootstrap_parameters(m, iterations = 20)
#> # Fixed Effects
#>
#> Parameter   | Coefficient |        95% CI |      p
#> --------------------------------------------------
#> (Intercept) |       -0.03 | [-0.38, 0.34] | 0.900
#> minedno     |        1.24 | [ 0.89, 1.66] | < .001
#>
#> # Zero-Inflation
#>
#> Parameter   | Coefficient |         95% CI |      p
#> ---------------------------------------------------
#> (Intercept) |        0.98 | [ 0.81,  1.42] | < .001
#> minedno     |       -1.63 | [-2.01, -1.39] | < .001

bootstrap_model() now names the zero-inflation columns <name>_zi, as simulate_model() does. With bootstrap = TRUE, model_parameters() now respects component, no longer adds the dispersion row with Wald intervals (component = "dispersion" gives an error), and the footer says the intervals are bootstrapped.

Still open: ci() and p_value() with method = "boot" return Wald values for glmmTMB, and the bootstrap path ignores p_adjust and ci_method, as before.

@jmgirard
jmgirard requested a lite review from Copilot October 19, 2026 16:51

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Copilot review overview

2 open issues
1 file not reviewed
  • man/model_parameters.glmmTMB.Rd: Generated file
What changed in this PR

Fixes bootstrap output for glmmTMB models so zero-inflation (ZI) parameters are correctly named and surfaced as a distinct component, aligning bootstrap behavior with non-bootstrap output.

Changes:

  • Name ZI bootstrap draw columns as <name>_zi in bootstrap_model() and map them back to standard parameter names + Component in bootstrap summaries.
  • Update model_parameters.glmmTMB() bootstrap path to filter by component, drop dispersion rows for bootstrap, and adjust footer/attributes for bootstrap intervals.
  • Add tests covering column naming, component handling, printing, and matching of draws to the correct parameters.
File Description
tests/​testthat/​test-bootstrap_parameters.R Adds regression tests for ZI naming/component behavior and bootstrap printing/footer expectations.
R/​methods_glmmTMB.R Adjusts bootstrap handling for component, removes dispersion row for bootstrap, and sets bootstrap CI metadata.
R/​bootstrap_parameters.R Adds helper to restore ZI parameter names and attach Component for bootstrapped glmmTMB parameters.
R/​bootstrap_model.R Names ZI draw columns with _zi suffix to avoid NA column names and missing estimates.
NEWS.md Documents the fix and behavior changes for bootstrap + components/dispersion/footer.
DESCRIPTION Bumps package version.

Review effort: Lite

Comment thread R/methods_glmmTMB.R
Comment thread R/methods_glmmTMB.R
@jmgirard

Copy link
Copy Markdown
Contributor Author

#1287 (review)

  • R/methods_glmmTMB.R:283, component of NULL: rejected. insight::validate_argument() turns NULL into "all" before these lines.
  • R/methods_glmmTMB.R:370, ci_method overwritten: left for a follow-up. The bootstrap path ignored ci_method before this PR as well.

Comment thread R/bootstrap_parameters.R Outdated
Comment thread DESCRIPTION Outdated
@jmgirard jmgirard changed the title Name zero-inflation parameters of glmmTMB models in bootstrap output Fix zero-inflation parameters in bootstrapped glmmTMB output Oct 21, 2026
@strengejacke
strengejacke merged commit 2f83788 into main Oct 29, 2026
9 of 21 checks passed
@strengejacke
strengejacke deleted the glmmtmb-bootstrap-zi branch October 29, 2026 10:14
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.

bootstrap_parameters() mislabels zero-inflation parameters of glmmTMB models

4 participants