bwqs_waic: Compute of Watanabe-Akaike Information Criterion

View source: R/bwqs_main-revised.R

bwqs_waicR Documentation

Compute of Watanabe-Akaike Information Criterion

Description

This function compute the WAIC and LOO given a posterior distribution. The values of the logarithmic likelihood are extracted from Stan object of the bwqs function.

Usage

bwqs_waic(stanfit)

Arguments

stanfit

Object fit is returned from the bwqs function.

Details

This function is implemented based on the formulas given in http://www.stat.columbia.edu/~gelman/research/unpublished/waic_stan. For examples of this function see example of bwqs function

Value

The function returns a list with:

waic

value of total WAIC for the model

elpd_waic

expected log pointwise predictive density for a new dataset

p_waic

the estimated effective number of parameters

elpd_loo

approximation to the actual out-of-sample prediction error under the model

p_loo

effective number of parameters as the bias adjustment corresponding to the overfitting inherent


ElenaColicino/bwqs documentation built on Feb. 26, 2023, 12:13 a.m.