Learn R Programming

rethinking (version 1.35)

compare: Compare fit models using AICc/DIC/BIC

Description

Returns a table of model comparison statistics

Usage

compare( ... , nobs=NULL , sort="AICc" , BIC=FALSE , DIC=FALSE , delta=TRUE , 
	DICsamples=1e4 )

Arguments

...

A series of fit models, separated by commas

nobs

Number of observations to use in calculating AICc/BIC

sort

Sort table by ascending values in named column

BIC

Compute BIC as well

DIC

Compute DIC as well. See details.

delta

Include differences between AICc/BIC/DIC values

DICsamples

Number of posterior samples to use in computing DIC

Value

Details

This function computes AICc and optionally BIC and 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 AICc, BIC, DIC, numbers of parameters, and model weights.

At the moment, DIC only works for models fit with map. DIC is computing using the original Dhat + 2(Dbar-Dhat) formulation, not the variance formulation. Samples are drawn from the posterior, assuming it is multivariate gaussian and defined by the variance-covariance matrix of the MAP estimates. The column pD in the results is the effective number of parameters, Dbar-Dhat.

References

McElreath 2011, Statistical Rethinking.