Extract log-likelihood components for likelihood profiling from MCMC samples.
Uses get_posterior to obtain the log-likelihood components.
Arguments
- loglikes
A
data.frameof log-likelihood values fromget_posterior.- fit
The fitted MCMC object the log-likelihoods came from. Defaults to an object named
mcmcfound 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 globalmcmc, and errored with "object 'mcmc' not found" otherwise. Pass it explicitly.
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)
