Skip to contents

Returns the BPIC/DIC based model weights for each participant in a list of samples objects

Usage

compare_subject(
  sList,
  stage = "sample",
  filter = 0,
  use_best_fit = TRUE,
  print_summary = TRUE,
  digits = 3
)

Arguments

sList

List of samples objects

stage

A string. Specifies which stage the samples are to be taken from "preburn", "burn", "adapt", or "sample"

filter

An integer or vector. If it's an integer, iterations up until the value set by filter will be excluded. If a vector is supplied, only the iterations in the vector will be considered.

use_best_fit

Boolean, defaults to TRUE, use minimal likelihood or mean likelihood (whichever is better) in the calculation, otherwise always uses the mean likelihood.

print_summary

Boolean (defaults to TRUE) print table of results

digits

Integer, significant digits in printed table

Value

List of matrices for each subject of effective number of parameters, mean deviance, deviance of mean, DIC, BPIC and associated weights.

Examples

# For a broader illustration see `compare`.
# Here we just take two times the same model, but normally one would compare
# different models
compare_subject(list(m0 = samples_LNR, m1 = samples_LNR))
#> Warning: subject-by-subject comparison is best done with models of type `single`
#>      wDIC_m0 wDIC_m1 wBPIC_m0 wBPIC_m1
#> as1t     0.5     0.5      0.5      0.5
#> bd6t     0.5     0.5      0.5      0.5
#> bl1t     0.5     0.5      0.5      0.5
#> 
#> Winners
#>      m0
#> DIC   3
#> BPIC  3