elpd_compare: Compare Sitewise Differences in Expected Log Posterior...

Description Usage Arguments Details Value Examples

View source: R/elpd_compare.R

Description

Compare Sitewise Differences in Expected Log Posterior Density

Usage

1
elpd_compare(elpds, refname = NULL)

Arguments

elpds

A data.frame or matrix of expected log posterior densities. Each row is ModelSite, each column is a Model. Typically the columns will have names.

refname

The column name (i.e. Model) to compare all other models to. If NULL then uses the model with the highest sum of elpd.

Details

Very similar to loo::loo_compare(), but with fewer checks

Value

A matrix with a column for the aggregate (summed) difference of model sites between models, and the standard error of this difference (computed as the sample standard deviation of difference, multiplied by the square root of the number of ModelSites)

Examples

1
2
3
4
waics_l <- readRDS("./tmpdata/7_3_01_waics.rds")
mat1 <- elpd_compare(elpds = do.call(cbind, lapply(waics_l, function(x) x$loo$pointwise[, 1])))
matref <- loo::loo_compare(lapply(waics_l, function(x) x$loo))
all(mat1 == matref[, c("elpd_diff", "se_diff")])

sustainablefarms/linking-data documentation built on Oct. 28, 2020, 2:41 a.m.