Skip to contents

Individual level rows use the marginal model log likelihood created by epidist_gen_log_lik(). Summary rows use the sampling distributions described in as_epidist_meta_model(), evaluated at the implied summaries for each posterior draw. A row that stands for several summaries reported by one study returns the joint log likelihood of all of them, so an observation here is a group of summaries rather than a single reported value.

Usage

epidist_gen_meta_log_lik(family)

Arguments

family

A description of the response distribution and link function to be used in the model. Every family function has a link argument allowing users to specify the link function to be applied on the response variable. If not specified, default links are used. For details of all supported families see brms::brmsfamily(). Commonly used, such as brms::lognormal(), are also reexported as part of epidist.

Value

A function that calculates the log likelihood for a single observation. The prep object must have the meta model vint and vreal slots.

Details

Summary rows are evaluated in R, one posterior draw at a time, and each evaluation can run a quadrature of up to 2000 intervals by default. The cost of brms::log_lik() and loo::loo() therefore grows with the number of draws times the number of summary rows. Pass ndraws to either to use fewer draws, at the price of noisier estimates.