extract_log_lik | R Documentation |
Extracts the pointwise log-likelihood matrix or array from a model.
This is useful as an input for functions in the loo
package.
If called on a ubmsFit
object, the log-likelihood matrix or array
is calculated using the posterior distributions of the parameters; the
log-likelihood values are not actually saved inside the model object.
If called on a stanfit
object, loo::extract_log_lik
is used.
In this case, the log-likelihood must be saved as one of the output
parameters in Stan.
extract_log_lik(object, parameter_name = "log_lik", merge_chains = TRUE)
object |
A |
parameter_name |
The name of the log-likelihood parameter in the
Stan output; ignored when |
merge_chains |
If |
A matrix (samples x sites) or array (samples x chains x sites)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.