Posterior log-density
Usage
# S3 method for class 'nsbi_mcmc_posterior'
log_prob(post, theta, x = NULL, normalize = TRUE, ...)
log_prob(post, theta, x = NULL, ...)
# S3 method for class 'nsbi_posterior'
log_prob(
post,
theta,
x = NULL,
normalize = TRUE,
n_normalization = 10000L,
...
)Arguments
- post
An
nsbi_posteriorobject.- theta
Matrix (or vector) of parameter values to evaluate.
- x
Observation to condition on (defaults to
x_obs).- normalize
For bounded priors, renormalize by the estimated acceptance probability and return
-Infoutside the prior support.- ...
Passed to methods.
- n_normalization
Number of draws used to estimate the normalizing (acceptance) constant when
normalize = TRUE. If none of them land inside the prior support, the estimate is floored at1 / n_normalizationto avoidlog(0)and a warning says so – the same warningsample()raises when rejection sampling comes up empty. These draws are internal to the estimate (always taken from a fixed, throwaway stream) and never advance the caller's own RNG, unlikesample(), which is documented to consume randomness.
