Skip to content

Commit

Permalink
enhance checks on family
Browse files Browse the repository at this point in the history
  • Loading branch information
wlandau committed May 20, 2024
1 parent 8cc7132 commit 6927563
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 9 additions & 1 deletion R/brm_model.R
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ brm_model <- function(
formula,
...,
prior = NULL,
family = brms::brmsfamily(family = "gaussian", link = "identity")
family = brms::brmsfamily(family = "gaussian")
) {
brm_data_validate(data = data)
brm_formula_validate(formula)
Expand Down Expand Up @@ -119,8 +119,16 @@ brms_model_validate_family <- function(family) {
identical(family$type, "real"),
message = "family must be for continuous outcomes"
)
assert(
identical(family$family, "gaussian"),
message = "family must be gaussian"
)
assert(
identical(family$link, "identity"),
message = "family must have the identity link"
)
assert(
identical(family$link_sigma, "log"),
message = "family must link_sigma equal to 'log'"
)
}
2 changes: 1 addition & 1 deletion man/brm_model.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 6927563

Please sign in to comment.