Read the per-iteration log-lik matrix back from on-disk chunks
Source:R/loo_methods.R
read_log_lik.RdFor lame fits run with save_log_lik = "chunked", the per-iteration
pointwise log-likelihood lives in per-column-chunk binary files instead
of fit$log_lik. This helper reconstitutes the
[n_stored, n_obs] matrix in memory by issuing one readBin
per chunk. loo.lame() / waic.lame() call this transparently.
Examples
set.seed(1)
n <- 12
Y <- matrix(rnorm(n * n), n, n); diag(Y) <- NA
# chains = 1 keeps the example short; the default runs two chains and compares them
fit <- ame(Y, R = 1, nscan = 20, burn = 5, odens = 1,
save_log_lik = TRUE, verbose = FALSE, chains = 1)
ll <- read_log_lik(fit)
dim(ll)
#> [1] 20 132