@@ -117,15 +117,15 @@ NULL
117
117
118
118
# ' @export
119
119
# ' @rdname model_evaluation
120
- add_criterion <- function (x , criterion = c(" loo" , " waic" , " aic " , " bic " ),
120
+ add_criterion <- function (x , criterion = c(" loo" , " waic" ),
121
121
overwrite = FALSE , save = TRUE , ... , r_eff = NA ) {
122
122
model <- check_model(x , required_class = " measrfit" , name = " x" )
123
- if (model $ method != " mcmc" & criterion %in% c(" loo" , " waic" )) {
123
+ if (any( model $ method != " mcmc" & criterion %in% c(" loo" , " waic" ) )) {
124
124
rlang :: abort(" error_bad_method" ,
125
125
message = glue :: glue(" LOO and WAIC model criteria are only " ,
126
126
" available for models estimated with " ,
127
127
" `method = \" mcmc\" `." ))
128
- } else if (model $ method != " optim" & criterion %in% c(" aic" , " bic" )) {
128
+ } else if (any( model $ method != " optim" & criterion %in% c(" aic" , " bic" ) )) {
129
129
rlang :: abort(" error_bad_method" ,
130
130
message = glue :: glue(" AIC and BIC model criteria are only " ,
131
131
" available for models estimated with " ,
0 commit comments