WAIC function

Compute WAIC value

Compute WAIC value

This function computes the WAIC value of an RprobitB_fit object.

WAIC(x)

Arguments

  • x: An object of class RprobitB_fit.

Returns

A numeric, the WAIC value, with the following attributes:

  • se_waic, the standard error of the WAIC value,
  • lppd, the log pointwise predictive density,
  • p_waic, the effective number of parameters,
  • p_waic_vec, the vector of summands of p_waic,
  • p_si, the output of compute_p_si.

Details

WAIC is short for Widely Applicable (or Watanabe-Akaike) Information Criterion. As for AIC and BIC, the smaller the WAIC value the better the model. Its definition is

WAIC=2lppd+2pWAIC, WAIC = -2 \cdot lppd + 2 \cdot p_{WAIC},

where lppdlppd stands for log pointwise predictive density and pWAICp_{WAIC} is a penalty term proportional to the variance in the posterior distribution that is sometimes called effective number of parameters. The lppdlppd is approximated as follows. Let

pis=Pr(yiθs) p_{is} = \Pr(y_i\mid \theta_s)

be the probability of observation yiy_i given the ssth set θs\theta_s of parameter samples from the posterior. Then

lppd=ilogS1spsi. lppd = \sum_i \log S^{-1} \sum_s p_{si}.

The penalty term is computed as the sum over the variances in log-probability for each observation:

pWAIC=iVθ[logpsi]. p_{WAIC} = \sum_i V_{\theta} \left[ \log p_{si} \right].