Skip to contents

Extracts the log-likelihood matrix for use with the loo package for leave-one-out cross-validation.

Usage

log_lik(fit)

Arguments

fit

An object of class bhf_fit from bhf_fit().

Value

A matrix of dimension (n_iterations x N) containing pointwise log-likelihood values.

Examples

if (FALSE) { # \dontrun{
# After fitting
fit <- bhf_fit(prepared_data, model = model)

# Get log-likelihood and compute LOO
library(loo)
ll <- log_lik(fit)
loo_result <- loo(ll)
print(loo_result)
} # }