Computes the information criteria as -2 x log predictive density (lppd_i)
values. Inputs follow the same conventions as measure_elpd() and
measure_mlpd().
Arguments
- ylp
A numeric matrix or three-dimensional array of log predictive densities or probabilities:
Matrix (\(S \times n\)): \(S\) posterior draws (chains merged) by \(n\) observations.
Array (\(I \times C \times n\)): \(I\) MCMC iterations per chain, \(C\) chains, and \(n\) observations. Converted to an \(S \times n\) matrix internally.
- log_weights
Optional numeric matrix of unnormalized log-importance weights with dimensions \(S \times n\). Weights are column-normalized before computing each per-observation contribution.
- pointwise
Optional numeric vector of precomputed pointwise contributions \(\mathrm{ic}_i = -2 \cdot \mathrm{lppd}_i\). If provided,
ylpandlog_weightsare ignored.
Value
An object of class "measure": a list with:
estimatesA 1 \(\times\) 2 matrix. The row is named after the measure, the columns are
EstimateandSE(standard error).pointwiseAn \(n \times 1\) matrix of per-observation values. The column is named after the measure.
extraOptional. Auxiliary data for the standard error of a difference. Most measures do not set it.
Attributes measure (i.e., measure name) and dims (draws \(\times\)
observations) are also set. Use print() for a readable summary.