log_lik_draws: Extract log likelihood draws

View source: R/log_lik_draws.R

log_lik_drawsR Documentation

Extract log likelihood draws

Description

Extract log likelihood from fitted model and return as a draws object.

Usage

log_lik_draws(x, ...)

## S3 method for class 'stanfit'
log_lik_draws(x, joint = FALSE, log_lik_name = "log_lik", ...)

## S3 method for class 'CmdStanFit'
log_lik_draws(x, joint = FALSE, log_lik_name = "log_lik", ...)

## S3 method for class 'draws'
log_lik_draws(x, joint = FALSE, log_lik_name = "log_lik", ...)

Arguments

x

Model fit or draws object.

...

Arguments passed to individual methods.

joint

Logical indicating whether to return the joint log likelihood or array. Default is FALSE.

log_lik_name

Name of parameter in Stan model corresponding to log likelihood, default is "log_lik".

Value

A draws_array object containing log_lik values.

Examples

ex <- example_powerscale_model()
drw <- ex$draws

log_lik_draws(drw)


n-kall/priorsense documentation built on Nov. 4, 2024, 10:30 p.m.