Skip to contents

This function creates a log likelihood function that accounts for the latent variables in the model, including primary and secondary event windows and their overlap. The returned function calculates the log likelihood for a single observation by augmenting the data with the latent variables and using the underlying brms log likelihood function.

Usage

epidist_gen_log_lik_latent(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 brmsfamily(). Commonly used, such as 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 following variables:

  • vreal1: relative observation time

  • vreal2: primary event window

  • vreal3: secondary event window