easystats / easystats/performance

check_model() on more brms families

Open
#461 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Enhancement :boom:
Dominant language
R
Stars
1.2k
Forks
109
Avg merge
6h 34m
Merged PRs (30d)
8

Description

Currently check_model() errors on some families, even though some plot could be produced (at least, a PP check)

m <- brms::brm(wt ~ mpg * hp, family = "shifted_lognormal", data = mtcars, refresh = 0)
#> Compiling Stan program...
#> Start sampling

# Doesn't work :'(
performance::check_model(m)
#> Error in get(family$family): object 'shifted_lognormal' not found

# Works
plot(performance::check_collinearity(m))
#> Warning: Model has interaction terms. VIFs might be inflated. You may check
#>   multicollinearity among predictors of a model without interaction terms.

# plot(performance::check_heteroscedasticity(m))

# Works
performance::check_predictions(m)
#> Using 10 posterior draws for ppc type 'dens_overlay' by default.


# Doesn't work
performance::check_homogeneity(m)
#> Error in bartlett.test.default(x = mf[[1L]], g = mf[[2L]]): there must be at least 2 observations in each group

# Works
plot(performance::check_outliers(m))

Created on 2022-08-06 by the reprex package (v2.0.1)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the shifted_lognormal brms example with performance::check_model(), then inspect the check_model() and related model-family handling entry points. Compare the failing check_model() and check_homogeneity() paths with the working check_predictions() and check_outliers() calls; done means supported families no longer error and regression coverage exists for the reported case.

Written by the indexing model from the issue text.

Assessment

Tech stack
r
Domain
data
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.