Computes the density (or log-density) at one or more points using a compressed posterior.

density_posterior(object, x, log = FALSE, ...)

Arguments

object

A posterior_compressed object, or a path to an .rds file containing one.

x

A matrix or data.frame of points to evaluate (rows = points, cols = parameters in the same order as object$param_names). A plain numeric vector is treated as a single point.

log

Logical; if TRUE, return the log-density. Default FALSE.

...

Currently unused.

Value

A numeric vector of densities (or log-densities), one entry per row of x.