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

Revising check_model() #698

Open
wants to merge 18 commits into
base: main
Choose a base branch
from
Open

Revising check_model() #698

wants to merge 18 commits into from

Conversation

@strengejacke
Copy link
Member Author

@bwiernik and @mccarthy-m-g - I think the implementation works quite well now for the first methods. The plot() method works fine for the Q-Q plots (easystats/see#329). Things we should consider:

  • We would have to update the plot for overdispersion/zero-inflation checks (see DHARMa implementation for new check_residuals() function #643 (comment)). This is still based on the classical residuals, not the simulated ones. I have played around with revising the current code, copying the function .diag_overdispersion into a new .new_diag_overdispersion (see

    .new_diag_overdispersion <- function(model, ...) {
    ). This did not really work - do you have any ideas how we can have new plots for overdispersion/zero-inflation? I found these plots quite informative and would like to keep them, beside the Q-Q plot. See also discussion here.

  • check_zeroinflation() and check_overdispersion() now rely on simulate_residuals() for zero-inflated or negative binomial models etc., so only the really "simple" models that returned identical results to DHARMa-tests still use the old code. Only Poisson mixed models also use the "old" code, which still could be inaccurate (see check_overdispersion underestimates dispersion in mixed models #464) - do we want to use simulate_residuals() in general for mixed models when calling check_zeroinflation() and check_overdispersion()?

  • How do we want to deal with y axis limits when detrend = TRUE in Q-Q plots? (see DHARMa implementation for new check_residuals() function #643 (comment))

  • A method for check_autocorrelation() is not yet implemented. Since the DHARMa tests require additional information, I'm not sure about how to best implement such methods.

Copy link

codecov bot commented Mar 18, 2024

Codecov Report

Attention: Patch coverage is 12.50000% with 7 lines in your changes missing coverage. Please review.

Project coverage is 56.93%. Comparing base (1eb4c69) to head (17b81ee).
Report is 16 commits behind head on main.

Current head 17b81ee differs from pull request most recent head 29e27bb

Please upload reports for the commit 29e27bb to get more accurate results.

Files Patch % Lines
R/check_model_diagnostics.R 12.50% 7 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #698      +/-   ##
==========================================
- Coverage   56.98%   56.93%   -0.06%     
==========================================
  Files          86       86              
  Lines        6338     6346       +8     
==========================================
+ Hits         3612     3613       +1     
- Misses       2726     2733       +7     

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

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.

Revising check_model()
3 participants