compare_ic: Compare Information Criteria of Different Models

Description Usage Arguments Details Value See Also Examples

View source: R/loo.R

Description

Compare information criteria of different models fitted with waic or loo. Deprecated and will be removed in the future. Please use loo_compare instead.

Usage

1
compare_ic(..., x = NULL, ic = c("loo", "waic", "kfold"))

Arguments

...

At least two objects returned by waic or loo. Alternatively, brmsfit objects with information criteria precomputed via add_ic may be passed, as well.

x

A list containing the same types of objects as can be passed via ....

ic

The name of the information criterion to be extracted from brmsfit objects. Ignored if information criterion objects are only passed directly.

Details

See loo_compare for the recommended way of comparing models with the loo package.

Value

An object of class iclist.

See Also

loo, loo_compare add_criterion

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
## Not run: 
# model with population-level effects only
fit1 <- brm(rating ~ treat + period + carry,
            data = inhaler)
waic1 <- waic(fit1)

# model with an additional varying intercept for subjects
fit2 <- brm(rating ~ treat + period + carry + (1|subject),
            data = inhaler)
waic2 <- waic(fit2)

# compare both models
compare_ic(waic1, waic2)

## End(Not run)

brms documentation built on Aug. 23, 2021, 5:08 p.m.