Create a function to calculate the pointwise log likelihood of the latent model
Source:R/latent_model.R
epidist_gen_log_lik_latent.Rd
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.
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 aslognormal()
, are also reexported as part ofepidist
.
Value
A function that calculates the log likelihood for a single observation. The prep object must have the following variables:
vreal1
: relative observation timevreal2
: primary event windowvreal3
: secondary event window
See also
brms::log_lik()
for details on the brms log likelihood interface.
Other latent_model:
as_epidist_latent_model()
,
as_epidist_latent_model.epidist_linelist_data()
,
epidist_family_model.epidist_latent_model()
,
epidist_formula_model.epidist_latent_model()
,
is_epidist_latent_model()
,
new_epidist_latent_model()