Returns a log-likelihood function that caches the data frame split and resolved dispatchers. During optimization, optim calls the returned function hundreds of times with the same df but varying par – caching eliminates repeated split() and obs_type() overhead.

# S3 method for class 'likelihood_contr_model'
loglik(model, ...)

Arguments

model

The likelihood model

...

Additional arguments

Value

A function to compute the log-likelihood given a data frame and parameters