Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updates for glmmTMB changes #861

Merged
merged 5 commits into from Mar 20, 2024
Merged

updates for glmmTMB changes #861

merged 5 commits into from Mar 20, 2024

Conversation

bbolker
Copy link
Contributor

@bbolker bbolker commented Mar 20, 2024

There are two changes here:

  1. account for the fact that Gaussian dispersion is parameterized as log-SD rather than log-variance now
  2. change starting value for theta to avoid a singular fit (caused by slight changes in numerical stability due to Gaussian reparameterization)

also some minor spelling corrections (sorry)

@strengejacke
Copy link
Member

Thanks!

This test is also failing:

══ Failed tests ════════════════════════════════════════════════════════════════
── Failure ('test-glmmTMB.R:899:3'): get_parameters ────────────────────────────
get_parameters(m0)$Estimate (`actual`) not equal to c(200.03431, -99.71491, 1.6014, 0.69323) (`expected`).

  `actual`: 200.034 -99.715 3.203 1.386
`expected`: 200.034 -99.715 1.601 0.693

[ FAIL 1 | WARN 0 | SKIP 10 | PASS 3987 ]

Am I right that glmmTMB 1.1.9 is introducing these "errors"? If so, we should conditionally run the affected tests on that version only, i.e. adding skip_if_not_installed("glmmTMB", minimum_version = "1.1.9"), and probably require that version in the DESCRIPTION file as well?

@strengejacke
Copy link
Member

This may also break code in performance (but I'm planning a new release the next days anyway). I think functions like icc() or r2_nakagawa() should be affected, if variance components change. On the other hand, if the breaking change is:

account for the fact that Gaussian dispersion is parameterized as log-SD rather than log-variance now

then tests shouldn't probably be changed, but rather we want to fix insight::get_variance(), so that indeed the variance, not SD, is returned again? I think that makes more sense, in order to get correct results for r2/icc again.

@bbolker
Copy link
Contributor Author

bbolker commented Mar 20, 2024

I think I fixed that one too?

Yes, these tests should be conditional.

I don't see any need to require version 1.1.9 in DESCRIPTION.

@bbolker
Copy link
Contributor Author

bbolker commented Mar 20, 2024

Have to run, will respond later, but hopefully get_variance would be using accessor methods such as sigma() or VarCorr that would be robust to these internal changes?

@strengejacke
Copy link
Member

I think I fixed that one too?

Yeah, the PR still used glmmTMB 1.1.8, that's why tests are failing now.

@strengejacke
Copy link
Member

Have to run, will respond later, but hopefully get_variance would be using accessor methods such as sigma() or VarCorr that would be robust to these internal changes?

Ok, I'll also take a look.

Copy link

codecov bot commented Mar 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 55.79%. Comparing base (ad16942) to head (a864be5).

❗ Current head a864be5 differs from pull request most recent head 0c36061. Consider uploading reports for the commit 0c36061 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #861      +/-   ##
==========================================
+ Coverage   55.75%   55.79%   +0.03%     
==========================================
  Files         125      125              
  Lines       15514    15514              
==========================================
+ Hits         8650     8656       +6     
+ Misses       6864     6858       -6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@strengejacke
Copy link
Member

r2/icc are identical between glmmTMB version 1.1.8 and 1.1.9, so no need for action here.

@strengejacke
Copy link
Member

Thanks, looks good!

@strengejacke strengejacke merged commit 56655d3 into easystats:main Mar 20, 2024
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.

None yet

2 participants