Skip to contents

For 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.

Usage

read_log_lik(x)

Arguments

x

A fitted ame/lame object with $log_lik (fit with save_log_lik = TRUE) or, for a lame fit, $log_lik_chunks (fit with save_log_lik = "chunked").

Value

The full [n_stored, n_obs] double matrix.

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