Skip to content

Commit

Permalink
minor cleaning
Browse files Browse the repository at this point in the history
  • Loading branch information
paul-buerkner committed Feb 7, 2022
1 parent 3699660 commit 8ed3795
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion R/brmsformula.R
Original file line number Diff line number Diff line change
Expand Up @@ -1321,7 +1321,8 @@ validate_formula.brmsformula <- function(
predcats <- setdiff(out$family$cats, out$family$refcat)
}
multi_dpars <- valid_dpars(out$family, multi = TRUE)
for (dp in multi_dpars) {
# 'rev' so that mu comes last but appears first in the end
for (dp in rev(multi_dpars)) {
dp_dpars <- make_stan_names(paste0(dp, predcats))
if (any(duplicated(dp_dpars))) {
stop2("Invalid response category names. Please avoid ",
Expand Down
2 changes: 1 addition & 1 deletion tests/local/tests.models_new.R
Original file line number Diff line number Diff line change
Expand Up @@ -901,7 +901,7 @@ test_that("logistic_normal models work correctly", {
expect_equal(dim(pred), c(nobs(fit), 4, 3))
expect_equal(dimnames(pred)[[3]], c("y1", "y2", "y3"))
waic <- waic(fit, ndraws = 250)
expect_range(waic$estimates[3, 1], -530, -260)
expect_range(waic$estimates[3, 1], -530, -460)
})

test_that("Addition argument 'subset' works correctly", {
Expand Down

0 comments on commit 8ed3795

Please sign in to comment.