Skip to contents

Extract log-likelihood components for likelihood profiling from MCMC samples. Uses get_posterior to obtain the log-likelihood components.

Usage

get_mcmc_profile(loglikes, fit = NULL)

Arguments

loglikes

A data.frame of log-likelihood values from get_posterior.

fit

The fitted MCMC object the log-likelihoods came from. Defaults to an object named mcmc found in the calling environment, which is how this was previously resolved – it was picked up implicitly, so the function only worked when the caller happened to have a global mcmc, and errored with "object 'mcmc' not found" otherwise. Pass it explicitly.

Value

a data.frame with likelihood components formatted for profiling.

Examples

pars <- c("tag_ll", "cpue_ll", "sexr_ll", "lf_ll", "prior")
# lls <- get_posterior(object = obj, posterior = mcmc, pars = pars)
# get_mcmc_profile(loglikes = lls, fit = mcmc)