Last chance! 50% off unlimited learning
Sale ends in
The elpd()
methods for arrays and matrices can compute the expected log
pointwise predictive density for a new dataset or the log pointwise
predictive density of the observed data (an overestimate of the elpd).
elpd(x, ...)# S3 method for array
elpd(x, ...)
# S3 method for matrix
elpd(x, ...)
A log-likelihood array or matrix. The Methods (by class) section, below, has detailed descriptions of how to specify the inputs for each method.
Currently ignored.
elpd(array)
: An
elpd(matrix)
: An
The elpd()
function is an S3 generic and methods are provided for
3-D pointwise log-likelihood arrays and matrices.
The vignette Holdout validation and K-fold cross-validation of Stan
programs with the loo package for demonstrations of using the elpd()
methods.
# Calculate the lpd of the observed data
LLarr <- example_loglik_array()
elpd(LLarr)
Run the code above in your browser using DataLab