Learn R Programming

rethinking (version 1.59)

compare: Compare fit models using WAIC or DIC

Description

Returns a table of model comparison statistics, by default focused on WAIC.

Usage

compare( ... , n=1e3 , sort="WAIC" , func=WAIC , WAIC=TRUE , refresh=0 )
ICweights( dev )

Arguments

...

A series of fit models, separated by commas

n

Number of samples from posterior to use in computing WAIC/DIC

sort

Sort table by ascending values in named column

func

Function to use in computing criteria for comparison

WAIC

Deprecated: If TRUE, uses func for comparison. If FALSE, uses DIC.

refresh

Progress display update interval. 0 suppresses display.

dev

Vector of values to use in computing model weights

Value

An object of class compareIC with slots output (table of results) and dSE (matrix of standard errors of differences in IC between pairs of models).

Details

This function computes WAIC and optionally DIC values for fit models and returns a table sorted by ascending values. Each row in this table is a model, and the various columns provide WAIC, effective numbers of parameters, model weights, and standard errors.

A plot method is supported, for graphic display of the information criteria.